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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
purcell/icfpc2015 | src/AI.hs | gpl-3.0 | nextMovesUntil :: (GameState -> Bool) -> GameState -> [GameState]
nextMovesUntil f gs = filter f $ walkTree (stateTreeUntil f gs) | 129 | nextMovesUntil :: (GameState -> Bool) -> GameState -> [GameState]
nextMovesUntil f gs = filter f $ walkTree (stateTreeUntil f gs) | 129 | nextMovesUntil f gs = filter f $ walkTree (stateTreeUntil f gs) | 63 | false | true | 0 | 9 | 19 | 57 | 27 | 30 | null | null |
edsko/hackage-server | Distribution/Server/Features/Documentation.hs | bsd-3-clause | mapParaM :: Monad m => (a -> m b) -> [a] -> m [(a, b)]
mapParaM f = mapM (\x -> (,) x `liftM` f x) | 98 | mapParaM :: Monad m => (a -> m b) -> [a] -> m [(a, b)]
mapParaM f = mapM (\x -> (,) x `liftM` f x) | 98 | mapParaM f = mapM (\x -> (,) x `liftM` f x) | 43 | false | true | 0 | 10 | 25 | 80 | 42 | 38 | null | null |
cullina/Extractor | src/PowerSeries.hs | bsd-3-clause | evenPart [x] = [x] | 18 | evenPart [x] = [x] | 18 | evenPart [x] = [x] | 18 | false | false | 0 | 5 | 3 | 16 | 8 | 8 | null | null |
nagyf/wyas | src/Main.hs | mit | -- |The main method, used to either evaluate an expression or run the REPL.
-- In order to evaluate a lisp expression, you have to pass it as a command line
-- argument. If you want to run the REPL, you have to call main without any arguments.
main :: IO ()
main = do args <- getArgs
if null args then runRepl else runOne $ args | 338 | main :: IO ()
main = do args <- getArgs
if null args then runRepl else runOne $ args | 94 | main = do args <- getArgs
if null args then runRepl else runOne $ args | 80 | true | true | 0 | 8 | 76 | 44 | 23 | 21 | null | null |
siddhanathan/ghc | compiler/deSugar/MatchCon.hs | bsd-3-clause | matchConFamily :: [Id]
-> Type
-> [[EquationInfo]]
-> DsM MatchResult
-- Each group of eqns is for a single constructor
matchConFamily (var:vars) ty groups
= do dflags <- getDynFlags
alts <- mapM (fmap toRealAlt . matchOneConLike vars ty) groups
return (mkCoAlgCaseMatchResult dflags var ty alts)
where
toRealAlt alt = case alt_pat alt of
RealDataCon dcon -> alt{ alt_pat = dcon }
_ -> panic "matchConFamily: not RealDataCon" | 508 | matchConFamily :: [Id]
-> Type
-> [[EquationInfo]]
-> DsM MatchResult
matchConFamily (var:vars) ty groups
= do dflags <- getDynFlags
alts <- mapM (fmap toRealAlt . matchOneConLike vars ty) groups
return (mkCoAlgCaseMatchResult dflags var ty alts)
where
toRealAlt alt = case alt_pat alt of
RealDataCon dcon -> alt{ alt_pat = dcon }
_ -> panic "matchConFamily: not RealDataCon" | 458 | matchConFamily (var:vars) ty groups
= do dflags <- getDynFlags
alts <- mapM (fmap toRealAlt . matchOneConLike vars ty) groups
return (mkCoAlgCaseMatchResult dflags var ty alts)
where
toRealAlt alt = case alt_pat alt of
RealDataCon dcon -> alt{ alt_pat = dcon }
_ -> panic "matchConFamily: not RealDataCon" | 343 | true | true | 0 | 11 | 149 | 146 | 71 | 75 | null | null |
redien/reuse-lang | standard-library/specification/string.hs | cc0-1.0 | prop_string_first :: NonEmptyList Char -> Bool
prop_string_first (NonEmpty s) = maybe_to_hs (Reuse.maybe_map (Char.chr . fromIntegral) (Reuse.string_first (string_to_reuse s))) == Just (head s) | 193 | prop_string_first :: NonEmptyList Char -> Bool
prop_string_first (NonEmpty s) = maybe_to_hs (Reuse.maybe_map (Char.chr . fromIntegral) (Reuse.string_first (string_to_reuse s))) == Just (head s) | 193 | prop_string_first (NonEmpty s) = maybe_to_hs (Reuse.maybe_map (Char.chr . fromIntegral) (Reuse.string_first (string_to_reuse s))) == Just (head s) | 146 | false | true | 0 | 12 | 21 | 76 | 37 | 39 | null | null |
ghcjs/ghcjs | src/Compiler/Program.hs | mit | isStopLnMode :: Mode -> Bool
isStopLnMode (Right (Right (StopBefore StopLn))) = True | 84 | isStopLnMode :: Mode -> Bool
isStopLnMode (Right (Right (StopBefore StopLn))) = True | 84 | isStopLnMode (Right (Right (StopBefore StopLn))) = True | 55 | false | true | 0 | 13 | 11 | 42 | 19 | 23 | null | null |
haskell-distributed/distributed-process-platform | src/Control/Distributed/Process/Platform/ManagedProcess/Server.hs | bsd-3-clause | -- | Instructs the process to send a reply /and/ evaluate the 'ProcessAction'.
replyWith :: (Serializable r)
=> r
-> ProcessAction s
-> Process (ProcessReply r s)
replyWith r s = return $ ProcessReply r s | 234 | replyWith :: (Serializable r)
=> r
-> ProcessAction s
-> Process (ProcessReply r s)
replyWith r s = return $ ProcessReply r s | 155 | replyWith r s = return $ ProcessReply r s | 41 | true | true | 2 | 11 | 65 | 64 | 29 | 35 | null | null |
asvanberg/hsfv | Main.hs | mit | parseArgs :: [String] -> IO (Flags, FilePath)
parseArgs args =
case getOpt RequireOrder options args of
(o, [sfv], []) -> return (foldl (flip id) defaultOptions o, sfv)
(_, _, errs) -> ioError . userError =<< fmap
(\progName -> concat errs ++ usageInfo (header progName) options)
getProgName
where
header progName = "Usage: " ++ progName ++ " [OPTION...] file"
defaultOptions = Flags { tolerant = False, failFast = False } | 456 | parseArgs :: [String] -> IO (Flags, FilePath)
parseArgs args =
case getOpt RequireOrder options args of
(o, [sfv], []) -> return (foldl (flip id) defaultOptions o, sfv)
(_, _, errs) -> ioError . userError =<< fmap
(\progName -> concat errs ++ usageInfo (header progName) options)
getProgName
where
header progName = "Usage: " ++ progName ++ " [OPTION...] file"
defaultOptions = Flags { tolerant = False, failFast = False } | 456 | parseArgs args =
case getOpt RequireOrder options args of
(o, [sfv], []) -> return (foldl (flip id) defaultOptions o, sfv)
(_, _, errs) -> ioError . userError =<< fmap
(\progName -> concat errs ++ usageInfo (header progName) options)
getProgName
where
header progName = "Usage: " ++ progName ++ " [OPTION...] file"
defaultOptions = Flags { tolerant = False, failFast = False } | 410 | false | true | 1 | 15 | 102 | 176 | 93 | 83 | null | null |
nushio3/dynamic-object | Data/Object/Dynamic/Examples/PointParticle.hs | bsd-3-clause | velocity :: MemberLens o Velocity
velocity = memberLens Velocity | 64 | velocity :: MemberLens o Velocity
velocity = memberLens Velocity | 64 | velocity = memberLens Velocity | 30 | false | true | 0 | 5 | 8 | 19 | 9 | 10 | null | null |
input-output-hk/pos-haskell-prototype | lib/bench/Bench/Pos/Diffusion/BlockDownload.hs | mit | runBenchmark :: IO ()
runBenchmark = do
{-
Wlog.setupLogging Nothing $ (Wlog.defaultConfig "arbitrary_logger_name")
{ Wlog._lcTree = Wlog.LoggerTree mempty [] (Just Wlog.allSeverities)
}
-}
-- Parse criterion arguments before setting anything up. Wouldn't want to
-- bring up a transport if the arguments don't parse.
criterionMode <- Opt.execParser (Criterion.describe Criterion.defaultConfig)
putStrLn ("Generating and forcing the necessary blockchain data ..." :: String)
streamIORef <- newIORef []
let seed = 0
size = 4
!arbitraryBlock = force $ Right (generateMainBlock protocolMagic seed size)
!arbitraryHashes = force $ someHash :| replicate 2199 someHash
!arbitraryHeader = force $ Block.getBlockHeader arbitraryBlock
!arbitraryHeaders = force $ arbitraryHeader :| replicate 2199 arbitraryHeader
blockSize = LBS.length $ serialize arbitraryBlock
setStreamIORef = \n -> writeIORef streamIORef (replicate n arbitraryBlock)
putStrLn $ "Using block of size " ++ show blockSize ++ " bytes"
putStrLn ("Bringing up client and server infrastructure ..." :: String)
withTransport $ \transport ->
withServer transport (serverLogic streamIORef arbitraryBlock arbitraryHashes arbitraryHeaders) $ \serverAddress ->
-- client needs the serverAddress so that it can put it into its
-- outbound queue.
withClient transport clientLogic serverAddress $
liftIO . runBlockDownloadBenchmark criterionMode serverAddress setStreamIORef | 1,584 | runBenchmark :: IO ()
runBenchmark = do
{-
Wlog.setupLogging Nothing $ (Wlog.defaultConfig "arbitrary_logger_name")
{ Wlog._lcTree = Wlog.LoggerTree mempty [] (Just Wlog.allSeverities)
}
-}
-- Parse criterion arguments before setting anything up. Wouldn't want to
-- bring up a transport if the arguments don't parse.
criterionMode <- Opt.execParser (Criterion.describe Criterion.defaultConfig)
putStrLn ("Generating and forcing the necessary blockchain data ..." :: String)
streamIORef <- newIORef []
let seed = 0
size = 4
!arbitraryBlock = force $ Right (generateMainBlock protocolMagic seed size)
!arbitraryHashes = force $ someHash :| replicate 2199 someHash
!arbitraryHeader = force $ Block.getBlockHeader arbitraryBlock
!arbitraryHeaders = force $ arbitraryHeader :| replicate 2199 arbitraryHeader
blockSize = LBS.length $ serialize arbitraryBlock
setStreamIORef = \n -> writeIORef streamIORef (replicate n arbitraryBlock)
putStrLn $ "Using block of size " ++ show blockSize ++ " bytes"
putStrLn ("Bringing up client and server infrastructure ..." :: String)
withTransport $ \transport ->
withServer transport (serverLogic streamIORef arbitraryBlock arbitraryHashes arbitraryHeaders) $ \serverAddress ->
-- client needs the serverAddress so that it can put it into its
-- outbound queue.
withClient transport clientLogic serverAddress $
liftIO . runBlockDownloadBenchmark criterionMode serverAddress setStreamIORef | 1,584 | runBenchmark = do
{-
Wlog.setupLogging Nothing $ (Wlog.defaultConfig "arbitrary_logger_name")
{ Wlog._lcTree = Wlog.LoggerTree mempty [] (Just Wlog.allSeverities)
}
-}
-- Parse criterion arguments before setting anything up. Wouldn't want to
-- bring up a transport if the arguments don't parse.
criterionMode <- Opt.execParser (Criterion.describe Criterion.defaultConfig)
putStrLn ("Generating and forcing the necessary blockchain data ..." :: String)
streamIORef <- newIORef []
let seed = 0
size = 4
!arbitraryBlock = force $ Right (generateMainBlock protocolMagic seed size)
!arbitraryHashes = force $ someHash :| replicate 2199 someHash
!arbitraryHeader = force $ Block.getBlockHeader arbitraryBlock
!arbitraryHeaders = force $ arbitraryHeader :| replicate 2199 arbitraryHeader
blockSize = LBS.length $ serialize arbitraryBlock
setStreamIORef = \n -> writeIORef streamIORef (replicate n arbitraryBlock)
putStrLn $ "Using block of size " ++ show blockSize ++ " bytes"
putStrLn ("Bringing up client and server infrastructure ..." :: String)
withTransport $ \transport ->
withServer transport (serverLogic streamIORef arbitraryBlock arbitraryHashes arbitraryHeaders) $ \serverAddress ->
-- client needs the serverAddress so that it can put it into its
-- outbound queue.
withClient transport clientLogic serverAddress $
liftIO . runBlockDownloadBenchmark criterionMode serverAddress setStreamIORef | 1,562 | false | true | 0 | 13 | 346 | 288 | 139 | 149 | null | null |
markus1189/xmonad-contrib-710 | XMonad/Layout/DecorationMadness.hs | bsd-3-clause | -- | Similar to 'accordionSimpleDece' but with the possibility of
-- setting a custom shrinker and a custom theme.
accordionDeco :: Shrinker s => s -> Theme
-> ModifiedLayout (Decoration SimpleDecoration s) Accordion Window
accordionDeco s t = decoration s t (Simple True) Accordion | 296 | accordionDeco :: Shrinker s => s -> Theme
-> ModifiedLayout (Decoration SimpleDecoration s) Accordion Window
accordionDeco s t = decoration s t (Simple True) Accordion | 181 | accordionDeco s t = decoration s t (Simple True) Accordion | 58 | true | true | 0 | 10 | 57 | 63 | 31 | 32 | null | null |
ribag/ganeti-experiments | src/Ganeti/OpParams.hs | gpl-2.0 | -- FIXME: this should be compiled at load time?
pTagSearchPattern :: Field
pTagSearchPattern =
withDoc "Search pattern (regular expression)" .
renameField "TagSearchPattern" $
simpleField "pattern" [t| NonEmptyString |] | 225 | pTagSearchPattern :: Field
pTagSearchPattern =
withDoc "Search pattern (regular expression)" .
renameField "TagSearchPattern" $
simpleField "pattern" [t| NonEmptyString |] | 177 | pTagSearchPattern =
withDoc "Search pattern (regular expression)" .
renameField "TagSearchPattern" $
simpleField "pattern" [t| NonEmptyString |] | 150 | true | true | 0 | 5 | 33 | 36 | 19 | 17 | null | null |
dolio/vector | Data/Vector.hs | bsd-3-clause | cons = G.cons | 13 | cons = G.cons | 13 | cons = G.cons | 13 | false | false | 1 | 6 | 2 | 12 | 4 | 8 | null | null |
mcschroeder/ghc | compiler/basicTypes/OccName.hs | bsd-3-clause | mkDataCOcc = mk_simple_deriv varName "$c" | 42 | mkDataCOcc = mk_simple_deriv varName "$c" | 42 | mkDataCOcc = mk_simple_deriv varName "$c" | 42 | false | false | 0 | 5 | 5 | 11 | 5 | 6 | null | null |
junjihashimoto/persistent | persistent-mongoDB/Database/Persist/MongoDB.hs | mit | -- | Same as '&~>.', but works against a Maybe type
(?&~>.) :: forall val nes nes1. PersistEntity nes1 => EntityField val (Maybe nes1) -> NestedField nes1 nes -> NestedField val nes
(?&~>.) = MidNestFldsNullable | 211 | (?&~>.) :: forall val nes nes1. PersistEntity nes1 => EntityField val (Maybe nes1) -> NestedField nes1 nes -> NestedField val nes
(?&~>.) = MidNestFldsNullable | 159 | (?&~>.) = MidNestFldsNullable | 29 | true | true | 0 | 11 | 34 | 65 | 33 | 32 | null | null |
pachopepe/mfxparser | src/MixFix/Parser.hs | bsd-3-clause | colon :: Token
colon = Token SYMBOL ":" | 40 | colon :: Token
colon = Token SYMBOL ":" | 39 | colon = Token SYMBOL ":" | 24 | false | true | 0 | 6 | 8 | 23 | 9 | 14 | null | null |
eltongo/unicorn | bindings/haskell/src/Unicorn/Hook.hs | gpl-2.0 | inHookAdd :: Storable a
=> Engine -- ^ 'Unicorn' engine handle
-> InHook a -- ^ IN instruction callback
-> a -- ^ User-defined data. This will be passed to the
-- callback function
-> Word64 -- ^ Start address
-> Word64 -- ^ End address
-> Emulator Hook -- ^ The hook handle on success, or an 'Error' on
-- failure
inHookAdd uc callback userData begin end = do
result <- lift . alloca $ \userDataPtr -> do
poke userDataPtr userData
funPtr <- marshalInHook callback
getResult $ ucInsnHookAdd uc HookInsn funPtr userDataPtr begin end
X86.In
hoistEither result
-- | Register a callback for an OUT instruction hook event (X86). | 850 | inHookAdd :: Storable a
=> Engine -- ^ 'Unicorn' engine handle
-> InHook a -- ^ IN instruction callback
-> a -- ^ User-defined data. This will be passed to the
-- callback function
-> Word64 -- ^ Start address
-> Word64 -- ^ End address
-> Emulator Hook
inHookAdd uc callback userData begin end = do
result <- lift . alloca $ \userDataPtr -> do
poke userDataPtr userData
funPtr <- marshalInHook callback
getResult $ ucInsnHookAdd uc HookInsn funPtr userDataPtr begin end
X86.In
hoistEither result
-- | Register a callback for an OUT instruction hook event (X86). | 760 | inHookAdd uc callback userData begin end = do
result <- lift . alloca $ \userDataPtr -> do
poke userDataPtr userData
funPtr <- marshalInHook callback
getResult $ ucInsnHookAdd uc HookInsn funPtr userDataPtr begin end
X86.In
hoistEither result
-- | Register a callback for an OUT instruction hook event (X86). | 375 | true | true | 0 | 14 | 336 | 132 | 65 | 67 | null | null |
apyrgio/ganeti | src/Ganeti/HTools/Cluster.hs | bsd-2-clause | -- | Update a cluster statistics twice.
updateClusterStatisticsTwice :: [Statistics]
-> (Node.Node, Node.Node)
-> (Node.Node, Node.Node)
-> [Statistics]
updateClusterStatisticsTwice s a =
updateClusterStatistics (updateClusterStatistics s a) | 339 | updateClusterStatisticsTwice :: [Statistics]
-> (Node.Node, Node.Node)
-> (Node.Node, Node.Node)
-> [Statistics]
updateClusterStatisticsTwice s a =
updateClusterStatistics (updateClusterStatistics s a) | 299 | updateClusterStatisticsTwice s a =
updateClusterStatistics (updateClusterStatistics s a) | 90 | true | true | 0 | 9 | 123 | 66 | 36 | 30 | null | null |
ciderpunx/57-exercises-for-programmers | src/P20StateTax.hs | gpl-3.0 | -- Given a string name of a region, and a lookup; get back either a
-- load of subregions or the rate for the region or 0 rate if the region
-- cannot be looked up
getTaxRateFor :: String -> TaxLookup -> TaxLookup
getTaxRateFor _ r@(Rate _) = r | 244 | getTaxRateFor :: String -> TaxLookup -> TaxLookup
getTaxRateFor _ r@(Rate _) = r | 80 | getTaxRateFor _ r@(Rate _) = r | 30 | true | true | 0 | 8 | 48 | 36 | 20 | 16 | null | null |
infotroph/pandoc | src/Text/Pandoc/Readers/LaTeX.hs | gpl-2.0 | umlaut 'I' = "Ï" | 16 | umlaut 'I' = "Ï" | 16 | umlaut 'I' = "Ï" | 16 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
armoredsoftware/protocol | tpm/mainline/src/TPM/Digest.hs | bsd-3-clause | tpm_encauth_info :: TPM_DIGEST -> TPM_NONCE -> TPM_DIGEST -> TPM_ENCAUTH
tpm_encauth_info secret nonce s = TPM_AUTHDATA $ pack result
where enckey = bytestringDigest (sha1 (concat [encode secret,encode nonce]))
result = zipWith xor enckey (encode s)
-------------------------------------------------------------------------------
-- Perform an HMAC SHA-1 calculation on a bytestring producing the
-- resulting digest value. The first argument is the key to use for the
-- HMAC calculation.
------------------------------------------------------------------------------- | 584 | tpm_encauth_info :: TPM_DIGEST -> TPM_NONCE -> TPM_DIGEST -> TPM_ENCAUTH
tpm_encauth_info secret nonce s = TPM_AUTHDATA $ pack result
where enckey = bytestringDigest (sha1 (concat [encode secret,encode nonce]))
result = zipWith xor enckey (encode s)
-------------------------------------------------------------------------------
-- Perform an HMAC SHA-1 calculation on a bytestring producing the
-- resulting digest value. The first argument is the key to use for the
-- HMAC calculation.
------------------------------------------------------------------------------- | 584 | tpm_encauth_info secret nonce s = TPM_AUTHDATA $ pack result
where enckey = bytestringDigest (sha1 (concat [encode secret,encode nonce]))
result = zipWith xor enckey (encode s)
-------------------------------------------------------------------------------
-- Perform an HMAC SHA-1 calculation on a bytestring producing the
-- resulting digest value. The first argument is the key to use for the
-- HMAC calculation.
------------------------------------------------------------------------------- | 511 | false | true | 1 | 11 | 78 | 95 | 49 | 46 | null | null |
Megaleo/Minehack | src/Input.hs | bsd-3-clause | -- | Transforms an Input into an action, based on
-- the player's location and the WorldState.
handleInput :: WorldState -> TileCoord -> Input -> A.Action
handleInput ws c MoveUp = A.Action (loadTile c ws) (Just $ loadTile (c |-| (0, 1)) ws) A.Move | 255 | handleInput :: WorldState -> TileCoord -> Input -> A.Action
handleInput ws c MoveUp = A.Action (loadTile c ws) (Just $ loadTile (c |-| (0, 1)) ws) A.Move | 160 | handleInput ws c MoveUp = A.Action (loadTile c ws) (Just $ loadTile (c |-| (0, 1)) ws) A.Move | 100 | true | true | 0 | 11 | 50 | 78 | 41 | 37 | null | null |
shockkolate/arata | plugins/NickServ/Group.hs | apache-2.0 | extHelp = defaultExtHelp { short = "Adds your current nick to your account" } | 77 | extHelp = defaultExtHelp { short = "Adds your current nick to your account" } | 77 | extHelp = defaultExtHelp { short = "Adds your current nick to your account" } | 77 | false | false | 1 | 7 | 13 | 18 | 8 | 10 | null | null |
phyrex1an/galaxy-parser | src/Galaxy/Operators.hs | gpl-3.0 | assignementOperators :: [[(String, AssignOp)]]
assignementOperators = [ [ ("=" , SetV)
, ("+=", IncV)
, ("-=", DecV)
, ("*=", MulV)
, ("/=", DivV)
, ("%=", ModV)
, ("&=", BinAndV)
, ("|=", BinOrV)
, ("^=", BinXorV)
, ("~=", BinNotV)
, ("<<=", LeftShiftV)
, (">>=", RightShiftV)
]
] | 604 | assignementOperators :: [[(String, AssignOp)]]
assignementOperators = [ [ ("=" , SetV)
, ("+=", IncV)
, ("-=", DecV)
, ("*=", MulV)
, ("/=", DivV)
, ("%=", ModV)
, ("&=", BinAndV)
, ("|=", BinOrV)
, ("^=", BinXorV)
, ("~=", BinNotV)
, ("<<=", LeftShiftV)
, (">>=", RightShiftV)
]
] | 604 | assignementOperators = [ [ ("=" , SetV)
, ("+=", IncV)
, ("-=", DecV)
, ("*=", MulV)
, ("/=", DivV)
, ("%=", ModV)
, ("&=", BinAndV)
, ("|=", BinOrV)
, ("^=", BinXorV)
, ("~=", BinNotV)
, ("<<=", LeftShiftV)
, (">>=", RightShiftV)
]
] | 557 | false | true | 0 | 7 | 368 | 134 | 88 | 46 | null | null |
anton-dessiatov/stack | src/windows/System/Terminal.hs | bsd-3-clause | -- | Get the width, in columns, of the terminal if we can.
getTerminalWidth :: IO (Maybe Int)
getTerminalWidth = return Nothing | 127 | getTerminalWidth :: IO (Maybe Int)
getTerminalWidth = return Nothing | 68 | getTerminalWidth = return Nothing | 33 | true | true | 0 | 7 | 21 | 24 | 12 | 12 | null | null |
rueshyna/gogol | gogol-youtube/gen/Network/Google/YouTube/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'I18nLanguageSnippet' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ilsHl'
--
-- * 'ilsName'
i18nLanguageSnippet
:: I18nLanguageSnippet
i18nLanguageSnippet =
I18nLanguageSnippet'
{ _ilsHl = Nothing
, _ilsName = Nothing
} | 352 | i18nLanguageSnippet
:: I18nLanguageSnippet
i18nLanguageSnippet =
I18nLanguageSnippet'
{ _ilsHl = Nothing
, _ilsName = Nothing
} | 147 | i18nLanguageSnippet =
I18nLanguageSnippet'
{ _ilsHl = Nothing
, _ilsName = Nothing
} | 100 | true | true | 0 | 6 | 72 | 32 | 22 | 10 | null | null |
sdiehl/ghc | libraries/base/GHC/IO/Handle/Internals.hs | bsd-3-clause | wantReadableHandle_ :: String -> Handle -> (Handle__ -> IO a) -> IO a
wantReadableHandle_ fun h@(FileHandle _ m) act
= wantReadableHandle' fun h m act | 155 | wantReadableHandle_ :: String -> Handle -> (Handle__ -> IO a) -> IO a
wantReadableHandle_ fun h@(FileHandle _ m) act
= wantReadableHandle' fun h m act | 155 | wantReadableHandle_ fun h@(FileHandle _ m) act
= wantReadableHandle' fun h m act | 85 | false | true | 0 | 10 | 29 | 63 | 31 | 32 | null | null |
voidlizard/emufat | src/FatGen.hs | bsd-3-clause | randomW32 :: IO Word32
randomW32 = liftM fromIntegral (randomIO :: IO Int) | 74 | randomW32 :: IO Word32
randomW32 = liftM fromIntegral (randomIO :: IO Int) | 74 | randomW32 = liftM fromIntegral (randomIO :: IO Int) | 51 | false | true | 0 | 7 | 11 | 28 | 14 | 14 | null | null |
KommuSoft/dep-software | Dep.Ui.Utils.hs | gpl-3.0 | linC 150 = '\x2543' | 19 | linC 150 = '\x2543' | 19 | linC 150 = '\x2543' | 19 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
fumieval/call | src/Call.hs | bsd-3-clause | linkGraphic :: Call => (Time -> IO Sight) -> IO ()
linkGraphic f = do
g <- readIORef $ coreGraphic given
writeIORef (coreGraphic given) $ \dt -> liftA2 (<>) (f dt) (g dt) | 174 | linkGraphic :: Call => (Time -> IO Sight) -> IO ()
linkGraphic f = do
g <- readIORef $ coreGraphic given
writeIORef (coreGraphic given) $ \dt -> liftA2 (<>) (f dt) (g dt) | 174 | linkGraphic f = do
g <- readIORef $ coreGraphic given
writeIORef (coreGraphic given) $ \dt -> liftA2 (<>) (f dt) (g dt) | 123 | false | true | 0 | 11 | 36 | 94 | 45 | 49 | null | null |
facebook/fbthrift | thrift/compiler/test/fixtures/namespace/gen-hs/My/Namespacing/Test/Hsmodule_Types.hs | apache-2.0 | to_HsFoo _ = error "not a struct" | 33 | to_HsFoo _ = error "not a struct" | 33 | to_HsFoo _ = error "not a struct" | 33 | false | false | 0 | 5 | 6 | 12 | 5 | 7 | null | null |
mjhopkins/StopPayingForFreeMonads | Expressions.hs | mit | mulExpr :: Fix (Val :+: Mul)
mulExpr = val 42 |*| val 3 | 55 | mulExpr :: Fix (Val :+: Mul)
mulExpr = val 42 |*| val 3 | 55 | mulExpr = val 42 |*| val 3 | 26 | false | true | 0 | 7 | 12 | 31 | 15 | 16 | null | null |
mightymoose/liquidhaskell | benchmarks/vector-0.10.0.1/Data/Vector/Primitive/Mutable.hs | bsd-3-clause | drop = G.drop | 13 | drop = G.drop | 13 | drop = G.drop | 13 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
hasufell/CGA | Algorithms/QuadTree.hs | gpl-2.0 | neSq ((xl, yl), (xu, yu)) = (,) ((xl + xu) / 2, (yl + yu) / 2) (xu, yu) | 73 | neSq ((xl, yl), (xu, yu)) = (,) ((xl + xu) / 2, (yl + yu) / 2) (xu, yu) | 73 | neSq ((xl, yl), (xu, yu)) = (,) ((xl + xu) / 2, (yl + yu) / 2) (xu, yu) | 73 | false | false | 0 | 9 | 20 | 69 | 40 | 29 | null | null |
thoferon/seakale | tests/SpecHelpers.hs | bsd-3-clause | comment1337Ent :: Entity Comment
comment1337Ent = Entity (CommentID 1337) comment1337 | 85 | comment1337Ent :: Entity Comment
comment1337Ent = Entity (CommentID 1337) comment1337 | 85 | comment1337Ent = Entity (CommentID 1337) comment1337 | 52 | false | true | 0 | 7 | 9 | 25 | 12 | 13 | null | null |
ekmett/wxHaskell | samples/test/XRCControls/XRCControls_Wx.hs | lgpl-2.1 | gui :: IO ()
gui =
do -- main gui elements: frame, panel, text control, and the notebook
f <- frameLoadRes "controls.xrc" "f" []
-- use text control as logger
textlog <- textCtrlRes f "textlog" []
textCtrlMakeLogActiveTarget textlog
logMessage "logging enabled"
-- button page
ok <- buttonRes f "ok" [on command := logMessage "ok button pressed"]
quit <- buttonRes f "ok" [on command := close f]
-- radio box page
r1 <- radioBoxRes f "r1" [on select ::= logSelect]
r2 <- radioBoxRes f "r2" [on select ::= logSelect]
rb1 <- buttonRes f "rb1" [on command ::= onEnable r1]
-- choice page
c1 <- choiceRes f "c1" [on select ::= logSelect]
c2 <- choiceRes f "c2" [on select ::= logSelect]
cb1 <- buttonRes f "cb1" [on command ::= onEnable c1]
-- list box page
sl1 <- singleListBoxRes f "sl1" [on select ::= logSelect]
sl2 <- singleListBoxRes f "sl2" [on select ::= logSelect]
sc1 <- checkBoxRes f "sc1" [on command ::= onEnable sl1]
-- slider/gauge page
s <- sliderRes f "s" []
g <- gaugeRes f "g" []
set s [on command := do { i <- get s selection; set g [selection := i] } ]
-- specify layout
set f [ clientSize := sz 400 300 ]
windowShow f
return ()
where
-- logSelect :: (Selection w, Items w String) => w -> IO ()
logSelect w
= do i <- get w selection
s <- get w (item i)
logMessage ("selected index: " ++ show i ++ ": " ++ s)
onEnable w b
= do set w [enabled :~ not]
enable <- get w enabled
set b [text := (if enable then "disable" else "enable")] | 1,746 | gui :: IO ()
gui =
do -- main gui elements: frame, panel, text control, and the notebook
f <- frameLoadRes "controls.xrc" "f" []
-- use text control as logger
textlog <- textCtrlRes f "textlog" []
textCtrlMakeLogActiveTarget textlog
logMessage "logging enabled"
-- button page
ok <- buttonRes f "ok" [on command := logMessage "ok button pressed"]
quit <- buttonRes f "ok" [on command := close f]
-- radio box page
r1 <- radioBoxRes f "r1" [on select ::= logSelect]
r2 <- radioBoxRes f "r2" [on select ::= logSelect]
rb1 <- buttonRes f "rb1" [on command ::= onEnable r1]
-- choice page
c1 <- choiceRes f "c1" [on select ::= logSelect]
c2 <- choiceRes f "c2" [on select ::= logSelect]
cb1 <- buttonRes f "cb1" [on command ::= onEnable c1]
-- list box page
sl1 <- singleListBoxRes f "sl1" [on select ::= logSelect]
sl2 <- singleListBoxRes f "sl2" [on select ::= logSelect]
sc1 <- checkBoxRes f "sc1" [on command ::= onEnable sl1]
-- slider/gauge page
s <- sliderRes f "s" []
g <- gaugeRes f "g" []
set s [on command := do { i <- get s selection; set g [selection := i] } ]
-- specify layout
set f [ clientSize := sz 400 300 ]
windowShow f
return ()
where
-- logSelect :: (Selection w, Items w String) => w -> IO ()
logSelect w
= do i <- get w selection
s <- get w (item i)
logMessage ("selected index: " ++ show i ++ ": " ++ s)
onEnable w b
= do set w [enabled :~ not]
enable <- get w enabled
set b [text := (if enable then "disable" else "enable")] | 1,746 | gui =
do -- main gui elements: frame, panel, text control, and the notebook
f <- frameLoadRes "controls.xrc" "f" []
-- use text control as logger
textlog <- textCtrlRes f "textlog" []
textCtrlMakeLogActiveTarget textlog
logMessage "logging enabled"
-- button page
ok <- buttonRes f "ok" [on command := logMessage "ok button pressed"]
quit <- buttonRes f "ok" [on command := close f]
-- radio box page
r1 <- radioBoxRes f "r1" [on select ::= logSelect]
r2 <- radioBoxRes f "r2" [on select ::= logSelect]
rb1 <- buttonRes f "rb1" [on command ::= onEnable r1]
-- choice page
c1 <- choiceRes f "c1" [on select ::= logSelect]
c2 <- choiceRes f "c2" [on select ::= logSelect]
cb1 <- buttonRes f "cb1" [on command ::= onEnable c1]
-- list box page
sl1 <- singleListBoxRes f "sl1" [on select ::= logSelect]
sl2 <- singleListBoxRes f "sl2" [on select ::= logSelect]
sc1 <- checkBoxRes f "sc1" [on command ::= onEnable sl1]
-- slider/gauge page
s <- sliderRes f "s" []
g <- gaugeRes f "g" []
set s [on command := do { i <- get s selection; set g [selection := i] } ]
-- specify layout
set f [ clientSize := sz 400 300 ]
windowShow f
return ()
where
-- logSelect :: (Selection w, Items w String) => w -> IO ()
logSelect w
= do i <- get w selection
s <- get w (item i)
logMessage ("selected index: " ++ show i ++ ": " ++ s)
onEnable w b
= do set w [enabled :~ not]
enable <- get w enabled
set b [text := (if enable then "disable" else "enable")] | 1,733 | false | true | 2 | 14 | 576 | 603 | 273 | 330 | null | null |
ptitfred/ftv-vods | src/GoogleAPIsClient/Secrets.hs | bsd-3-clause | analyze :: Variant -> ObjectPath -> Success
analyze v "/" = Success v | 72 | analyze :: Variant -> ObjectPath -> Success
analyze v "/" = Success v | 72 | analyze v "/" = Success v | 28 | false | true | 0 | 6 | 15 | 27 | 13 | 14 | null | null |
smly/haskell-xsystem | System35/File/Vsp/Pixel.hs | bsd-3-clause | toRGB' ((b0,b1,b2,b3):bs) = b ++ toRGB' bs
where
r = shiftR
l = shiftL
b = map fromIntegral (l0:l1:l2:l3:l4:l5:l6:l7:[])
l0 = (r b0 7 .&. 0x01) .|. (r b1 6 .&. 0x02) .|. (r b2 5 .&. 0x04) .|. (r b3 4 .&. 0x08)
l1 = (r b0 6 .&. 0x01) .|. (r b1 5 .&. 0x02) .|. (r b2 4 .&. 0x04) .|. (r b3 3 .&. 0x08)
l2 = (r b0 5 .&. 0x01) .|. (r b1 4 .&. 0x02) .|. (r b2 3 .&. 0x04) .|. (r b3 2 .&. 0x08)
l3 = (r b0 4 .&. 0x01) .|. (r b1 3 .&. 0x02) .|. (r b2 2 .&. 0x04) .|. (r b3 1 .&. 0x08)
l4 = (r b0 3 .&. 0x01) .|. (r b1 2 .&. 0x02) .|. (r b2 1 .&. 0x04) .|. ( b3 .&. 0x08)
l5 = (r b0 2 .&. 0x01) .|. (r b1 1 .&. 0x02) .|. ( b2 .&. 0x04) .|. (l b3 1 .&. 0x08)
l6 = (r b0 1 .&. 0x01) .|. ( b1 .&. 0x02) .|. (l b2 1 .&. 0x04) .|. (l b3 2 .&. 0x08)
l7 = ( b0 .&. 0x01) .|. (l b1 1 .&. 0x02) .|. (l b2 2 .&. 0x04) .|. (l b3 3 .&. 0x08) | 902 | toRGB' ((b0,b1,b2,b3):bs) = b ++ toRGB' bs
where
r = shiftR
l = shiftL
b = map fromIntegral (l0:l1:l2:l3:l4:l5:l6:l7:[])
l0 = (r b0 7 .&. 0x01) .|. (r b1 6 .&. 0x02) .|. (r b2 5 .&. 0x04) .|. (r b3 4 .&. 0x08)
l1 = (r b0 6 .&. 0x01) .|. (r b1 5 .&. 0x02) .|. (r b2 4 .&. 0x04) .|. (r b3 3 .&. 0x08)
l2 = (r b0 5 .&. 0x01) .|. (r b1 4 .&. 0x02) .|. (r b2 3 .&. 0x04) .|. (r b3 2 .&. 0x08)
l3 = (r b0 4 .&. 0x01) .|. (r b1 3 .&. 0x02) .|. (r b2 2 .&. 0x04) .|. (r b3 1 .&. 0x08)
l4 = (r b0 3 .&. 0x01) .|. (r b1 2 .&. 0x02) .|. (r b2 1 .&. 0x04) .|. ( b3 .&. 0x08)
l5 = (r b0 2 .&. 0x01) .|. (r b1 1 .&. 0x02) .|. ( b2 .&. 0x04) .|. (l b3 1 .&. 0x08)
l6 = (r b0 1 .&. 0x01) .|. ( b1 .&. 0x02) .|. (l b2 1 .&. 0x04) .|. (l b3 2 .&. 0x08)
l7 = ( b0 .&. 0x01) .|. (l b1 1 .&. 0x02) .|. (l b2 2 .&. 0x04) .|. (l b3 3 .&. 0x08) | 902 | toRGB' ((b0,b1,b2,b3):bs) = b ++ toRGB' bs
where
r = shiftR
l = shiftL
b = map fromIntegral (l0:l1:l2:l3:l4:l5:l6:l7:[])
l0 = (r b0 7 .&. 0x01) .|. (r b1 6 .&. 0x02) .|. (r b2 5 .&. 0x04) .|. (r b3 4 .&. 0x08)
l1 = (r b0 6 .&. 0x01) .|. (r b1 5 .&. 0x02) .|. (r b2 4 .&. 0x04) .|. (r b3 3 .&. 0x08)
l2 = (r b0 5 .&. 0x01) .|. (r b1 4 .&. 0x02) .|. (r b2 3 .&. 0x04) .|. (r b3 2 .&. 0x08)
l3 = (r b0 4 .&. 0x01) .|. (r b1 3 .&. 0x02) .|. (r b2 2 .&. 0x04) .|. (r b3 1 .&. 0x08)
l4 = (r b0 3 .&. 0x01) .|. (r b1 2 .&. 0x02) .|. (r b2 1 .&. 0x04) .|. ( b3 .&. 0x08)
l5 = (r b0 2 .&. 0x01) .|. (r b1 1 .&. 0x02) .|. ( b2 .&. 0x04) .|. (l b3 1 .&. 0x08)
l6 = (r b0 1 .&. 0x01) .|. ( b1 .&. 0x02) .|. (l b2 1 .&. 0x04) .|. (l b3 2 .&. 0x08)
l7 = ( b0 .&. 0x01) .|. (l b1 1 .&. 0x02) .|. (l b2 2 .&. 0x04) .|. (l b3 3 .&. 0x08) | 902 | false | false | 10 | 38 | 296 | 613 | 306 | 307 | null | null |
brendanhay/gogol | gogol-partners/gen/Network/Google/Resource/Partners/Offers/List.hs | mpl-2.0 | -- | Second level identifier to indicate where the traffic comes from. An
-- identifier has multiple letters created by a team which redirected the
-- traffic to us.
olRequestMetadataTrafficSourceTrafficSubId :: Lens' OffersList (Maybe Text)
olRequestMetadataTrafficSourceTrafficSubId
= lens _olRequestMetadataTrafficSourceTrafficSubId
(\ s a ->
s{_olRequestMetadataTrafficSourceTrafficSubId = a}) | 414 | olRequestMetadataTrafficSourceTrafficSubId :: Lens' OffersList (Maybe Text)
olRequestMetadataTrafficSourceTrafficSubId
= lens _olRequestMetadataTrafficSourceTrafficSubId
(\ s a ->
s{_olRequestMetadataTrafficSourceTrafficSubId = a}) | 248 | olRequestMetadataTrafficSourceTrafficSubId
= lens _olRequestMetadataTrafficSourceTrafficSubId
(\ s a ->
s{_olRequestMetadataTrafficSourceTrafficSubId = a}) | 172 | true | true | 0 | 8 | 62 | 51 | 27 | 24 | null | null |
aa755/roshask | src/Ros/ROSCoqUtil.hs | bsd-3-clause | flattenTL :: Topic IO [a] -> Topic IO a
flattenTL t = Topic $ do
(x, t') <- runTopic t
lcons x (flattenTL t')
-- | a is intended to be instantiated with Message from Coq. fdel pulls out the delay field.
-- FIX!! either make the delay bounded in the Coq type signature, or use a loop to
-- properly handle the case when the first argument is beyond the bounds of Int | 380 | flattenTL :: Topic IO [a] -> Topic IO a
flattenTL t = Topic $ do
(x, t') <- runTopic t
lcons x (flattenTL t')
-- | a is intended to be instantiated with Message from Coq. fdel pulls out the delay field.
-- FIX!! either make the delay bounded in the Coq type signature, or use a loop to
-- properly handle the case when the first argument is beyond the bounds of Int | 380 | flattenTL t = Topic $ do
(x, t') <- runTopic t
lcons x (flattenTL t')
-- | a is intended to be instantiated with Message from Coq. fdel pulls out the delay field.
-- FIX!! either make the delay bounded in the Coq type signature, or use a loop to
-- properly handle the case when the first argument is beyond the bounds of Int | 340 | false | true | 2 | 10 | 88 | 74 | 35 | 39 | null | null |
dorchard/gram_lang | interpreter/src/Language/Granule/Interpreter/Eval.hs | bsd-3-clause | applyBindings :: Ctxt RExpr -> RExpr -> RExpr
applyBindings [] e = e | 68 | applyBindings :: Ctxt RExpr -> RExpr -> RExpr
applyBindings [] e = e | 68 | applyBindings [] e = e | 22 | false | true | 0 | 6 | 12 | 29 | 14 | 15 | null | null |
pparkkin/eta | compiler/ETA/Prelude/PrelNames.hs | bsd-3-clause | readClassKey = mkPreludeClassUnique 13 | 49 | readClassKey = mkPreludeClassUnique 13 | 49 | readClassKey = mkPreludeClassUnique 13 | 49 | false | false | 0 | 5 | 14 | 9 | 4 | 5 | null | null |
tokiwoousaka/egison4 | hs-src/Language/Egison/Parser.hs | mit | parseValuePatExpr :: Parser EgisonExpr
parseValuePatExpr = char ',' >> ValuePatExpr <$> parseEgisonExpr | 103 | parseValuePatExpr :: Parser EgisonExpr
parseValuePatExpr = char ',' >> ValuePatExpr <$> parseEgisonExpr | 103 | parseValuePatExpr = char ',' >> ValuePatExpr <$> parseEgisonExpr | 64 | false | true | 0 | 7 | 11 | 25 | 12 | 13 | null | null |
aleksanb/hdc | src/Serializer.hs | mit | serializeInstruction :: IR -> String
serializeInstruction (TwoIR (R reg) (I immediate) masked) =
prefix ++ "ldi $" ++ (show reg) ++ ", " ++ (show immediate)
where prefix = if masked then "? " else "" | 204 | serializeInstruction :: IR -> String
serializeInstruction (TwoIR (R reg) (I immediate) masked) =
prefix ++ "ldi $" ++ (show reg) ++ ", " ++ (show immediate)
where prefix = if masked then "? " else "" | 204 | serializeInstruction (TwoIR (R reg) (I immediate) masked) =
prefix ++ "ldi $" ++ (show reg) ++ ", " ++ (show immediate)
where prefix = if masked then "? " else "" | 167 | false | true | 5 | 8 | 40 | 94 | 44 | 50 | null | null |
scvalex/ltorrent | Data/Checksum.hs | lgpl-3.0 | hexGroupsToBytes :: (IsByteString a, IsByteString b) => a -> b
hexGroupsToBytes = fromByteString . go L.empty . toByteString
where
go acc s
| L.null s = acc
| otherwise = let (h, t) = L.splitAt 2 s
c = chr . fst . head . readHex . L.unpack $ h
in go (acc `L.snoc` c) t
-- FIXME: bytesToHexGroups is ugly.
-- | Convert a binary hex number to a pretty-printed one (16 bit
-- digits). Useful when used in conjunction with
-- 'bytesToHexGroups'. Used to manipulate the output of 'sha1'. | 564 | hexGroupsToBytes :: (IsByteString a, IsByteString b) => a -> b
hexGroupsToBytes = fromByteString . go L.empty . toByteString
where
go acc s
| L.null s = acc
| otherwise = let (h, t) = L.splitAt 2 s
c = chr . fst . head . readHex . L.unpack $ h
in go (acc `L.snoc` c) t
-- FIXME: bytesToHexGroups is ugly.
-- | Convert a binary hex number to a pretty-printed one (16 bit
-- digits). Useful when used in conjunction with
-- 'bytesToHexGroups'. Used to manipulate the output of 'sha1'. | 564 | hexGroupsToBytes = fromByteString . go L.empty . toByteString
where
go acc s
| L.null s = acc
| otherwise = let (h, t) = L.splitAt 2 s
c = chr . fst . head . readHex . L.unpack $ h
in go (acc `L.snoc` c) t
-- FIXME: bytesToHexGroups is ugly.
-- | Convert a binary hex number to a pretty-printed one (16 bit
-- digits). Useful when used in conjunction with
-- 'bytesToHexGroups'. Used to manipulate the output of 'sha1'. | 501 | false | true | 0 | 14 | 172 | 160 | 78 | 82 | null | null |
lachrist/kusasa-hs | semantic.hs | gpl-2.0 | concretize :: Store Promise -> Value -> Term
concretize pstore (Data dta) = Right dta | 85 | concretize :: Store Promise -> Value -> Term
concretize pstore (Data dta) = Right dta | 85 | concretize pstore (Data dta) = Right dta | 40 | false | true | 0 | 7 | 14 | 36 | 17 | 19 | null | null |
griba2001/tree23-map-set | src/Data/Tree23/SortedMap.hs | bsd-3-clause | lookup :: Ord k => k -> Map k v -> Maybe (k, v)
lookup = T23.lookup | 67 | lookup :: Ord k => k -> Map k v -> Maybe (k, v)
lookup = T23.lookup | 67 | lookup = T23.lookup | 19 | false | true | 0 | 9 | 16 | 42 | 21 | 21 | null | null |
fpco/cabal | Cabal/Distribution/PackageDescription/Check.hs | bsd-3-clause | fileExtensionSupportedLanguage :: FilePath -> Bool
fileExtensionSupportedLanguage path =
isHaskell || isC
where
extension = takeExtension path
isHaskell = extension `elem` [".hs", ".lhs"]
isC = isJust (filenameCDialect extension) | 253 | fileExtensionSupportedLanguage :: FilePath -> Bool
fileExtensionSupportedLanguage path =
isHaskell || isC
where
extension = takeExtension path
isHaskell = extension `elem` [".hs", ".lhs"]
isC = isJust (filenameCDialect extension) | 253 | fileExtensionSupportedLanguage path =
isHaskell || isC
where
extension = takeExtension path
isHaskell = extension `elem` [".hs", ".lhs"]
isC = isJust (filenameCDialect extension) | 202 | false | true | 2 | 8 | 50 | 66 | 34 | 32 | null | null |
hpacheco/jasminv | src/Utils.hs | gpl-3.0 | funit :: Functor f => f a -> f ()
funit = fmap (const ()) | 57 | funit :: Functor f => f a -> f ()
funit = fmap (const ()) | 57 | funit = fmap (const ()) | 23 | false | true | 0 | 9 | 14 | 47 | 20 | 27 | null | null |
ekmett/wxHaskell | wx/src/Graphics/UI/WX/Events.hs | lgpl-2.1 | alendarEvent :: Event (CalendarCtrl a) (EventCalendar -> IO ())
calendarEvent
= newEvent "calendarEvent" calendarCtrlGetOnCalEvent calendarCtrlOnCalEvent
| 156 | calendarEvent :: Event (CalendarCtrl a) (EventCalendar -> IO ())
calendarEvent
= newEvent "calendarEvent" calendarCtrlGetOnCalEvent calendarCtrlOnCalEvent | 156 | calendarEvent
= newEvent "calendarEvent" calendarCtrlGetOnCalEvent calendarCtrlOnCalEvent | 91 | false | true | 0 | 10 | 17 | 43 | 20 | 23 | null | null |
d0kt0r0/InnerEar | src/InnerEar/Exercises/SpectralShape.hs | gpl-3.0 | renderAnswer _ f0 _ Nothing = return () | 39 | renderAnswer _ f0 _ Nothing = return () | 39 | renderAnswer _ f0 _ Nothing = return () | 39 | false | false | 0 | 6 | 7 | 20 | 9 | 11 | null | null |
AndrewWUw/cs9181 | Data/Array/Accelerate/C/Exp.hs | bsd-3-clause | isSignedIntegralType _ = True | 43 | isSignedIntegralType _ = True | 43 | isSignedIntegralType _ = True | 43 | false | false | 0 | 5 | 17 | 9 | 4 | 5 | null | null |
johntyree/traduisons-hs | src/Traduisons/Resources.hs | bsd-3-clause | tokenURL :: String
tokenURL = "https://datamarket.accesscontrol.windows.net/v2/OAuth2-13" | 89 | tokenURL :: String
tokenURL = "https://datamarket.accesscontrol.windows.net/v2/OAuth2-13" | 89 | tokenURL = "https://datamarket.accesscontrol.windows.net/v2/OAuth2-13" | 70 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
wayofthepie/stash-client | src/StashClient.hs | bsd-3-clause | mod2get :: Request -> Request
mod2get r = r { method = "GET" } | 62 | mod2get :: Request -> Request
mod2get r = r { method = "GET" } | 62 | mod2get r = r { method = "GET" } | 32 | false | true | 0 | 6 | 13 | 26 | 14 | 12 | null | null |
sdiehl/ghc | hadrian/src/Rules/Selftest.hs | bsd-3-clause | testDependencies :: Action ()
testDependencies = do
putBuild "==== pkgDependencies"
let pkgs = ghcPackages \\ [libffi] -- @libffi@ does not have a Cabal file.
depLists <- mapM pkgDependencies pkgs
test $ and [ deps == sort deps | deps <- depLists ]
putBuild "==== Dependencies of the 'ghc-bin' binary"
ghcDeps <- pkgDependencies ghc
test $ pkgName compiler `elem` ghcDeps
stage0Deps <- contextDependencies (vanillaContext Stage0 ghc)
stage1Deps <- contextDependencies (vanillaContext Stage1 ghc)
stage2Deps <- contextDependencies (vanillaContext Stage2 ghc)
test $ vanillaContext Stage0 compiler `notElem` stage1Deps
test $ vanillaContext Stage1 compiler `elem` stage1Deps
test $ vanillaContext Stage2 compiler `notElem` stage1Deps
test $ stage1Deps /= stage0Deps
test $ stage1Deps == stage2Deps | 858 | testDependencies :: Action ()
testDependencies = do
putBuild "==== pkgDependencies"
let pkgs = ghcPackages \\ [libffi] -- @libffi@ does not have a Cabal file.
depLists <- mapM pkgDependencies pkgs
test $ and [ deps == sort deps | deps <- depLists ]
putBuild "==== Dependencies of the 'ghc-bin' binary"
ghcDeps <- pkgDependencies ghc
test $ pkgName compiler `elem` ghcDeps
stage0Deps <- contextDependencies (vanillaContext Stage0 ghc)
stage1Deps <- contextDependencies (vanillaContext Stage1 ghc)
stage2Deps <- contextDependencies (vanillaContext Stage2 ghc)
test $ vanillaContext Stage0 compiler `notElem` stage1Deps
test $ vanillaContext Stage1 compiler `elem` stage1Deps
test $ vanillaContext Stage2 compiler `notElem` stage1Deps
test $ stage1Deps /= stage0Deps
test $ stage1Deps == stage2Deps | 858 | testDependencies = do
putBuild "==== pkgDependencies"
let pkgs = ghcPackages \\ [libffi] -- @libffi@ does not have a Cabal file.
depLists <- mapM pkgDependencies pkgs
test $ and [ deps == sort deps | deps <- depLists ]
putBuild "==== Dependencies of the 'ghc-bin' binary"
ghcDeps <- pkgDependencies ghc
test $ pkgName compiler `elem` ghcDeps
stage0Deps <- contextDependencies (vanillaContext Stage0 ghc)
stage1Deps <- contextDependencies (vanillaContext Stage1 ghc)
stage2Deps <- contextDependencies (vanillaContext Stage2 ghc)
test $ vanillaContext Stage0 compiler `notElem` stage1Deps
test $ vanillaContext Stage1 compiler `elem` stage1Deps
test $ vanillaContext Stage2 compiler `notElem` stage1Deps
test $ stage1Deps /= stage0Deps
test $ stage1Deps == stage2Deps | 828 | false | true | 0 | 11 | 170 | 241 | 112 | 129 | null | null |
noteed/intake | Intake/Client.hs | bsd-3-clause | status :: WorkflowIdPrefix -> IO WStatus
status (WorkflowIdPrefix i) = do
m <- get ("/instances/" `B.append` B.pack i `B.append` "/status") []
return $ maybe (error "GET /instances") id m | 191 | status :: WorkflowIdPrefix -> IO WStatus
status (WorkflowIdPrefix i) = do
m <- get ("/instances/" `B.append` B.pack i `B.append` "/status") []
return $ maybe (error "GET /instances") id m | 191 | status (WorkflowIdPrefix i) = do
m <- get ("/instances/" `B.append` B.pack i `B.append` "/status") []
return $ maybe (error "GET /instances") id m | 150 | false | true | 0 | 13 | 32 | 85 | 42 | 43 | null | null |
slpopejoy/fadno-braids | src/Fadno/Braids.hs | bsd-2-clause | -- | Find all locations of a sub-braid within a braid, matrix version.
find' :: (Integral i, Braid b i) => [[Gen i]] -> Int -> i -> b i -> [Loc i]
find' ba w h bb = [ Loc x y | x <- [0 .. stepCount bb] ,
y <- [minIndex bb .. maxIndex bb] ,
test x y ]
where gba = normalGenVals ba
gbb = toGens bb
test x y = gbb == toGens (clearMerge gba x y w h gbb)
-- | clear generators and merge. TODO: doesn't clear adjacent gens. | 482 | find' :: (Integral i, Braid b i) => [[Gen i]] -> Int -> i -> b i -> [Loc i]
find' ba w h bb = [ Loc x y | x <- [0 .. stepCount bb] ,
y <- [minIndex bb .. maxIndex bb] ,
test x y ]
where gba = normalGenVals ba
gbb = toGens bb
test x y = gbb == toGens (clearMerge gba x y w h gbb)
-- | clear generators and merge. TODO: doesn't clear adjacent gens. | 411 | find' ba w h bb = [ Loc x y | x <- [0 .. stepCount bb] ,
y <- [minIndex bb .. maxIndex bb] ,
test x y ]
where gba = normalGenVals ba
gbb = toGens bb
test x y = gbb == toGens (clearMerge gba x y w h gbb)
-- | clear generators and merge. TODO: doesn't clear adjacent gens. | 335 | true | true | 0 | 11 | 161 | 178 | 90 | 88 | null | null |
lucasfcosta/haskell-experiences | Chapter 4/guardsGuardsGuards.hs | mit | -- Guards, Guards Guards
-- Testing guards by implementing a function that tells me about my BMI
bmiTell :: (RealFloat a) => a -> a -> String
bmiTell weight height
| bmi <= skinny = "EAT MORE"
| bmi <= normal = "GOOD JOB"
| bmi <= fat = "EAT LESS"
| otherwise = "OTHER STUFF"
where bmi = weight / height ^ 2
(skinny, normal, fat) = (18.5, 25.0, 30.0)
-- Returning initials with pattern matching on the where clause | 450 | bmiTell :: (RealFloat a) => a -> a -> String
bmiTell weight height
| bmi <= skinny = "EAT MORE"
| bmi <= normal = "GOOD JOB"
| bmi <= fat = "EAT LESS"
| otherwise = "OTHER STUFF"
where bmi = weight / height ^ 2
(skinny, normal, fat) = (18.5, 25.0, 30.0)
-- Returning initials with pattern matching on the where clause | 352 | bmiTell weight height
| bmi <= skinny = "EAT MORE"
| bmi <= normal = "GOOD JOB"
| bmi <= fat = "EAT LESS"
| otherwise = "OTHER STUFF"
where bmi = weight / height ^ 2
(skinny, normal, fat) = (18.5, 25.0, 30.0)
-- Returning initials with pattern matching on the where clause | 307 | true | true | 5 | 9 | 116 | 138 | 67 | 71 | null | null |
amccausl/Swish | Swish/HaskellRDF/GraphTest.hs | lgpl-2.1 | t06_2 = makeScopedArc 2 t06 | 27 | t06_2 = makeScopedArc 2 t06 | 27 | t06_2 = makeScopedArc 2 t06 | 27 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
versusvoid/blaise | src/Interpreter.hs | mit | initScope :: [Identifier] -> Scope
initScope = foldl (\m v -> M.insert v 0 m) M.empty | 85 | initScope :: [Identifier] -> Scope
initScope = foldl (\m v -> M.insert v 0 m) M.empty | 85 | initScope = foldl (\m v -> M.insert v 0 m) M.empty | 50 | false | true | 0 | 9 | 15 | 44 | 23 | 21 | null | null |
ublubu/tile-rider | src/Utils/Utils.hs | mit | pairMap :: (a -> b) -> (a, a) -> (b, b)
pairMap f (x, y) = (f x, f y) | 69 | pairMap :: (a -> b) -> (a, a) -> (b, b)
pairMap f (x, y) = (f x, f y) | 69 | pairMap f (x, y) = (f x, f y) | 29 | false | true | 0 | 9 | 19 | 67 | 35 | 32 | null | null |
josuf107/Adverb | Adverb/Common.hs | gpl-3.0 | ceaselessly = id | 16 | ceaselessly = id | 16 | ceaselessly = id | 16 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
k-bx/bottom-up-merge-sort | src/BottomUpMergeSort.hs | bsd-3-clause | sort :: Sortable a -> [a]
sort (Sortable l _ segs) = mergeAll [] segs
where
mergeAll xs [] = xs
mergeAll xs (seg:segs') = mergeAll (merge l xs seg) segs' | 169 | sort :: Sortable a -> [a]
sort (Sortable l _ segs) = mergeAll [] segs
where
mergeAll xs [] = xs
mergeAll xs (seg:segs') = mergeAll (merge l xs seg) segs' | 169 | sort (Sortable l _ segs) = mergeAll [] segs
where
mergeAll xs [] = xs
mergeAll xs (seg:segs') = mergeAll (merge l xs seg) segs' | 143 | false | true | 0 | 9 | 46 | 87 | 43 | 44 | null | null |
soenkehahn/ghc-imported-from | Language/Haskell/GhcImportedFrom.hs | bsd-3-clause | bestPrefixMatches :: Name -> [GlobalRdrElt] -> [String]
bestPrefixMatches name lookUp = x''
where name' = showSDoc tdflags $ ppr name
name'' = fromJust $ moduleOfQualifiedName name' -- FIXME dangerous fromJust
x = concatMap symbolImportedFrom lookUp
x' = map (showSDoc tdflags . ppr) x
x'' = filter (name'' `isPrefixOf`) x'
-- | Find the haddock module. Returns a 4-tuple consisting of: module that the symbol is imported
-- from, haddock url, module, and module's HTML filename. | 527 | bestPrefixMatches :: Name -> [GlobalRdrElt] -> [String]
bestPrefixMatches name lookUp = x''
where name' = showSDoc tdflags $ ppr name
name'' = fromJust $ moduleOfQualifiedName name' -- FIXME dangerous fromJust
x = concatMap symbolImportedFrom lookUp
x' = map (showSDoc tdflags . ppr) x
x'' = filter (name'' `isPrefixOf`) x'
-- | Find the haddock module. Returns a 4-tuple consisting of: module that the symbol is imported
-- from, haddock url, module, and module's HTML filename. | 527 | bestPrefixMatches name lookUp = x''
where name' = showSDoc tdflags $ ppr name
name'' = fromJust $ moduleOfQualifiedName name' -- FIXME dangerous fromJust
x = concatMap symbolImportedFrom lookUp
x' = map (showSDoc tdflags . ppr) x
x'' = filter (name'' `isPrefixOf`) x'
-- | Find the haddock module. Returns a 4-tuple consisting of: module that the symbol is imported
-- from, haddock url, module, and module's HTML filename. | 471 | false | true | 4 | 9 | 122 | 110 | 58 | 52 | null | null |
meiersi-11ce/stack | src/Stack/Options.hs | bsd-3-clause | pvpBoundsOption :: Parser PvpBounds
pvpBoundsOption =
option
readPvpBounds
(long "pvp-bounds" <> metavar "PVP-BOUNDS" <>
help
"How PVP version bounds should be added to .cabal file: none, lower, upper, both")
where
readPvpBounds = do
s <- readerAsk
case parsePvpBounds $ T.pack s of
Left e -> readerError e
Right v -> return v | 414 | pvpBoundsOption :: Parser PvpBounds
pvpBoundsOption =
option
readPvpBounds
(long "pvp-bounds" <> metavar "PVP-BOUNDS" <>
help
"How PVP version bounds should be added to .cabal file: none, lower, upper, both")
where
readPvpBounds = do
s <- readerAsk
case parsePvpBounds $ T.pack s of
Left e -> readerError e
Right v -> return v | 414 | pvpBoundsOption =
option
readPvpBounds
(long "pvp-bounds" <> metavar "PVP-BOUNDS" <>
help
"How PVP version bounds should be added to .cabal file: none, lower, upper, both")
where
readPvpBounds = do
s <- readerAsk
case parsePvpBounds $ T.pack s of
Left e -> readerError e
Right v -> return v | 378 | false | true | 0 | 10 | 139 | 94 | 42 | 52 | null | null |
erochest/barth-scrape | src/BarthPar/Scrape/XML.hs | apache-2.0 | buildText :: Node -> Builder
buildText = (`buildText'` mempty) | 62 | buildText :: Node -> Builder
buildText = (`buildText'` mempty) | 62 | buildText = (`buildText'` mempty) | 33 | false | true | 0 | 5 | 8 | 21 | 13 | 8 | null | null |
mrmonday/Idris-dev | src/Idris/Elab/Record.hs | bsd-3-clause | asArg (Constraint os _) n t = PConstraint 0 os n t | 50 | asArg (Constraint os _) n t = PConstraint 0 os n t | 50 | asArg (Constraint os _) n t = PConstraint 0 os n t | 50 | false | false | 0 | 7 | 11 | 30 | 14 | 16 | null | null |
dgvncsz0f/iyql | src/main/haskell/Yql/UI/CLI/Options.hs | gpl-3.0 | verbose :: Options -> Bool
verbose Verbose = True | 49 | verbose :: Options -> Bool
verbose Verbose = True | 49 | verbose Verbose = True | 22 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F12.hs | bsd-3-clause | -- glGetSeparableFilterEXT -----------------------------------------------------
glGetSeparableFilterEXT
:: MonadIO m
=> GLenum -- ^ @target@ of type [SeparableTargetEXT](Graphics-GL-Groups.html#SeparableTargetEXT).
-> GLenum -- ^ @format@ of type [PixelFormat](Graphics-GL-Groups.html#PixelFormat).
-> GLenum -- ^ @type@ of type [PixelType](Graphics-GL-Groups.html#PixelType).
-> Ptr a -- ^ @row@ pointing to @COMPSIZE(target,format,type)@ elements of type @a@.
-> Ptr b -- ^ @column@ pointing to @COMPSIZE(target,format,type)@ elements of type @b@.
-> Ptr c -- ^ @span@ pointing to @COMPSIZE(target,format,type)@ elements of type @c@.
-> m ()
glGetSeparableFilterEXT v1 v2 v3 v4 v5 v6 = liftIO $ dyn420 ptr_glGetSeparableFilterEXT v1 v2 v3 v4 v5 v6 | 767 | glGetSeparableFilterEXT
:: MonadIO m
=> GLenum -- ^ @target@ of type [SeparableTargetEXT](Graphics-GL-Groups.html#SeparableTargetEXT).
-> GLenum -- ^ @format@ of type [PixelFormat](Graphics-GL-Groups.html#PixelFormat).
-> GLenum -- ^ @type@ of type [PixelType](Graphics-GL-Groups.html#PixelType).
-> Ptr a -- ^ @row@ pointing to @COMPSIZE(target,format,type)@ elements of type @a@.
-> Ptr b -- ^ @column@ pointing to @COMPSIZE(target,format,type)@ elements of type @b@.
-> Ptr c -- ^ @span@ pointing to @COMPSIZE(target,format,type)@ elements of type @c@.
-> m ()
glGetSeparableFilterEXT v1 v2 v3 v4 v5 v6 = liftIO $ dyn420 ptr_glGetSeparableFilterEXT v1 v2 v3 v4 v5 v6 | 685 | glGetSeparableFilterEXT v1 v2 v3 v4 v5 v6 = liftIO $ dyn420 ptr_glGetSeparableFilterEXT v1 v2 v3 v4 v5 v6 | 105 | true | true | 0 | 14 | 107 | 99 | 49 | 50 | null | null |
nevrenato/Hets_Fork | CASL/OMDocExport.hs | gpl-2.0 | sfail :: String -> Range -> a
sfail s r = error $ show (Diag Error ("unexpected " ++ s) r) | 90 | sfail :: String -> Range -> a
sfail s r = error $ show (Diag Error ("unexpected " ++ s) r) | 90 | sfail s r = error $ show (Diag Error ("unexpected " ++ s) r) | 60 | false | true | 0 | 10 | 20 | 48 | 24 | 24 | null | null |
d0kt0r0/estuary | client/src/Estuary/Languages/BlackBox.hs | gpl-3.0 | commaSep1 = P.commaSep1 tokenParser | 35 | commaSep1 = P.commaSep1 tokenParser | 35 | commaSep1 = P.commaSep1 tokenParser | 35 | false | false | 1 | 5 | 3 | 15 | 5 | 10 | null | null |
Pitometsu/bake | src/General/Lens.hs | bsd-3-clause | (%~) :: Lens s a -> (a -> a) -> s -> s
(%~) = over | 50 | (%~) :: Lens s a -> (a -> a) -> s -> s
(%~) = over | 50 | (%~) = over | 11 | false | true | 0 | 9 | 15 | 46 | 23 | 23 | null | null |
ganeti/ganeti | src/Ganeti/HTools/Node.hs | bsd-2-clause | -- | Add multiple values.
addTags :: (Ord k) => Map.Map k Int -> [k] -> Map.Map k Int
addTags = foldl' addTag | 109 | addTags :: (Ord k) => Map.Map k Int -> [k] -> Map.Map k Int
addTags = foldl' addTag | 83 | addTags = foldl' addTag | 23 | true | true | 0 | 9 | 22 | 49 | 25 | 24 | null | null |
vTurbine/ghc | compiler/utils/Pretty.hs | bsd-3-clause | -- Don't
sepX :: Bool -> [Doc] -> Doc
sepX _ [] = empty | 60 | sepX :: Bool -> [Doc] -> Doc
sepX _ [] = empty | 50 | sepX _ [] = empty | 21 | true | true | 0 | 9 | 18 | 36 | 17 | 19 | null | null |
d0kt0r0/Tidal | src/Sound/Tidal/Core.hs | gpl-3.0 | in117 :: Pattern Double
in117 = cF 0 "117" | 42 | in117 :: Pattern Double
in117 = cF 0 "117" | 42 | in117 = cF 0 "117" | 18 | false | true | 1 | 5 | 8 | 24 | 9 | 15 | null | null |
ckaestne/CIDE | other/CaseStudies/fgl/CIDEfgl/Data/Graph/Inductive/Graph.hs | gpl-3.0 | context4l :: (Graph gr) => gr a b -> Node -> Adj b;
context4l = context4l' .: context | 87 | context4l :: (Graph gr) => gr a b -> Node -> Adj b
context4l = context4l' .: context | 84 | context4l = context4l' .: context | 33 | false | true | 1 | 8 | 19 | 47 | 22 | 25 | null | null |
tolysz/y-bower | lsbow/Main.hs | bsd-3-clause | -- | extract directory name from bowerrc
readRc = (DA.decode <$> B.readFile defRC) >>= \case
Nothing -> return defFolder
Just v -> return (BT.directory v) | 181 | readRc = (DA.decode <$> B.readFile defRC) >>= \case
Nothing -> return defFolder
Just v -> return (BT.directory v) | 140 | readRc = (DA.decode <$> B.readFile defRC) >>= \case
Nothing -> return defFolder
Just v -> return (BT.directory v) | 140 | true | false | 1 | 13 | 51 | 60 | 27 | 33 | null | null |
ucsd-progsys/nanomaly | src/NanoML/Pretty.hs | bsd-3-clause | isFun (Prim1 {}) = True | 23 | isFun (Prim1 {}) = True | 23 | isFun (Prim1 {}) = True | 23 | false | false | 0 | 7 | 4 | 16 | 8 | 8 | null | null |
keithodulaigh/Hets | ExtModal/Ship.hs | gpl-2.0 | foltl, primFoltl, preFoltl, quantFoltl, andFoltl, orFoltl :: CharParser st Foltl
primFoltl = fmap ABoxass (try abox)
<|> fmap (PreOp NotF) (skipKey "not" >> quantFoltl)
<|> parent foltl | 190 | foltl, primFoltl, preFoltl, quantFoltl, andFoltl, orFoltl :: CharParser st Foltl
primFoltl = fmap ABoxass (try abox)
<|> fmap (PreOp NotF) (skipKey "not" >> quantFoltl)
<|> parent foltl | 189 | primFoltl = fmap ABoxass (try abox)
<|> fmap (PreOp NotF) (skipKey "not" >> quantFoltl)
<|> parent foltl | 108 | false | true | 6 | 8 | 31 | 75 | 42 | 33 | null | null |
LambdaMx/haskelldojo | session_6/EightQueens.hs | unlicense | isValidSolution sol = all isValid fullPositions
where fullPositions = zip sol [1..8]
isValid pos = null $ intersect fullPositions (diags pos)
diags pos = diag1 pos ++ diag2 pos ++ diag3 pos ++ diag4 pos
diag1 (r,c) = [(r',c') | r' <- [r-1,r-2..1], r' >= 1, c' <- [c-1,c-2..1], c' >= 1, r'-c' == r-c ]
diag2 (r,c) = [(r',c') | r' <- [r+1..8], r' <= 8, c' <- [c+1..8], c' <= 8, r'-c' == r-c ]
diag3 (r,c) = [(r',c') | r' <- [r+1..8], r' <= 8, c' <- [c-1,c-2..1], c' >= 1, r'+c' == r+c ]
diag4 (r,c) = [(r',c') | r' <- [r-1,r-2..1], r' >= 1, c' <- [c+1..8], c' <= 8, r'+c' == r+c ] | 660 | isValidSolution sol = all isValid fullPositions
where fullPositions = zip sol [1..8]
isValid pos = null $ intersect fullPositions (diags pos)
diags pos = diag1 pos ++ diag2 pos ++ diag3 pos ++ diag4 pos
diag1 (r,c) = [(r',c') | r' <- [r-1,r-2..1], r' >= 1, c' <- [c-1,c-2..1], c' >= 1, r'-c' == r-c ]
diag2 (r,c) = [(r',c') | r' <- [r+1..8], r' <= 8, c' <- [c+1..8], c' <= 8, r'-c' == r-c ]
diag3 (r,c) = [(r',c') | r' <- [r+1..8], r' <= 8, c' <- [c-1,c-2..1], c' >= 1, r'+c' == r+c ]
diag4 (r,c) = [(r',c') | r' <- [r-1,r-2..1], r' >= 1, c' <- [c+1..8], c' <= 8, r'+c' == r+c ] | 660 | isValidSolution sol = all isValid fullPositions
where fullPositions = zip sol [1..8]
isValid pos = null $ intersect fullPositions (diags pos)
diags pos = diag1 pos ++ diag2 pos ++ diag3 pos ++ diag4 pos
diag1 (r,c) = [(r',c') | r' <- [r-1,r-2..1], r' >= 1, c' <- [c-1,c-2..1], c' >= 1, r'-c' == r-c ]
diag2 (r,c) = [(r',c') | r' <- [r+1..8], r' <= 8, c' <- [c+1..8], c' <= 8, r'-c' == r-c ]
diag3 (r,c) = [(r',c') | r' <- [r+1..8], r' <= 8, c' <- [c-1,c-2..1], c' >= 1, r'+c' == r+c ]
diag4 (r,c) = [(r',c') | r' <- [r-1,r-2..1], r' >= 1, c' <- [c+1..8], c' <= 8, r'+c' == r+c ] | 660 | false | false | 0 | 9 | 200 | 475 | 248 | 227 | null | null |
foreverbell/project-euler-solutions | src/124.hs | bsd-3-clause | main = print $ snd $ sort [ (rad n, n) | n <- [1 .. 100000] ] !! 9999 | 69 | main = print $ snd $ sort [ (rad n, n) | n <- [1 .. 100000] ] !! 9999 | 69 | main = print $ snd $ sort [ (rad n, n) | n <- [1 .. 100000] ] !! 9999 | 69 | false | false | 0 | 11 | 19 | 47 | 25 | 22 | null | null |
jmaessen/Data.FastSequence | test/FastSequenceTest.hs | bsd-3-clause | prop_last xs = P.last xs == last (check $ fromList xs) | 54 | prop_last xs = P.last xs == last (check $ fromList xs) | 54 | prop_last xs = P.last xs == last (check $ fromList xs) | 54 | false | false | 0 | 9 | 10 | 31 | 14 | 17 | null | null |
robstewart57/ripl | src/Inference/Dimension.hs | bsd-3-clause | dimensionOfRHSId (R.SplitYSkel _ rhsId) dfMap =
let varNode = (Map.lookup rhsId dfMap)
in (dim varNode) | 107 | dimensionOfRHSId (R.SplitYSkel _ rhsId) dfMap =
let varNode = (Map.lookup rhsId dfMap)
in (dim varNode) | 107 | dimensionOfRHSId (R.SplitYSkel _ rhsId) dfMap =
let varNode = (Map.lookup rhsId dfMap)
in (dim varNode) | 107 | false | false | 1 | 11 | 18 | 49 | 23 | 26 | null | null |
alexgadea/fun | Fun/Declarations.hs | gpl-3.0 | checkDefVarVal :: ValDecl -> Declarations -> [DeclError]
checkDefVarVal d ds = checkDefVar d $ (vals %~ L.filter ((d/=) . snd)) ds | 132 | checkDefVarVal :: ValDecl -> Declarations -> [DeclError]
checkDefVarVal d ds = checkDefVar d $ (vals %~ L.filter ((d/=) . snd)) ds | 132 | checkDefVarVal d ds = checkDefVar d $ (vals %~ L.filter ((d/=) . snd)) ds | 74 | false | true | 0 | 12 | 22 | 60 | 31 | 29 | null | null |
trygvis/hledger | hledger/Hledger/Cli/Convert.hs | gpl-3.0 | csvrulesfile :: GenParser Char CsvRules CsvRules
csvrulesfile = do
many blankorcommentline
many definitions
r <- getState
ars <- many accountrule
many blankorcommentline
eof
return r{accountRules=ars}
-- | Real independent parser choice, even when alternative matches share a prefix.
-- choice' parsers = choice $ map try (init parsers) ++ [last parsers]
-- definitions :: GenParser Char CsvRules CsvRules | 421 | csvrulesfile :: GenParser Char CsvRules CsvRules
csvrulesfile = do
many blankorcommentline
many definitions
r <- getState
ars <- many accountrule
many blankorcommentline
eof
return r{accountRules=ars}
-- | Real independent parser choice, even when alternative matches share a prefix.
-- choice' parsers = choice $ map try (init parsers) ++ [last parsers]
-- definitions :: GenParser Char CsvRules CsvRules | 421 | csvrulesfile = do
many blankorcommentline
many definitions
r <- getState
ars <- many accountrule
many blankorcommentline
eof
return r{accountRules=ars}
-- | Real independent parser choice, even when alternative matches share a prefix.
-- choice' parsers = choice $ map try (init parsers) ++ [last parsers]
-- definitions :: GenParser Char CsvRules CsvRules | 372 | false | true | 0 | 9 | 73 | 73 | 33 | 40 | null | null |
marcinmrotek/repa-linear-algebra | src/Numeric/LinearAlgebra/Repa/Conversion.hs | bsd-3-clause | repa2hv :: Storable t => Array F DIM1 t -> H.Vector t
-- ^O(1). Convert a Repa Array to a HMatrix Vector.
repa2hv r = V.unsafeFromForeignPtr0 (toForeignPtr r) ln
where ln = size $ extent r | 190 | repa2hv :: Storable t => Array F DIM1 t -> H.Vector t
repa2hv r = V.unsafeFromForeignPtr0 (toForeignPtr r) ln
where ln = size $ extent r | 138 | repa2hv r = V.unsafeFromForeignPtr0 (toForeignPtr r) ln
where ln = size $ extent r | 84 | true | true | 3 | 9 | 37 | 74 | 32 | 42 | null | null |
mattias-lundell/timber-llvm | src/Reduce.hs | bsd-3-clause | resolve env pe = do -- tr ("############### Before resolve:\n" ++ render (nest 8 (vpr pe)))
-- tr ("tevars: " ++ show env_tvs ++ ", reachable: " ++ show reachable_tvs)
(s1,q1,[],es) <- red [] (map mkGoal pe)
-- tr ("############### After resolve:\n" ++ render (nest 8 (vpr q1)))
let f1 = eLet pe (dom pe `zip` es)
badq = filter badDummy q1
-- assert1 (null badq) "Cannot resolve predicates" badq
-- tr "DONE RESOLVING"
(s2,q2,f2) <- simplify (subst s1 env) q1
return (s2@@s1, q2, f2 . f1)
where env_tvs = tevars env
reachable_tvs = vclose (map tvars pe) (ps ++ ns ++ env_tvs)
where (ps,ns) = pols env
mkGoal (v,p) = (force env' (coercion || ambig), p)
where tvs = tvars p
coercion = isCoercion v
ambig = null (tvs `intersect` reachable_tvs)
env' = tick env coercion
badDummy (v,p) = isDummy v && null (tvars p `intersect` env_tvs)
{-
C1 x < C x
C2 x < C Y
C3 x < C y \\ x < y
|- m aa < C b |- Int < Int (All a . Exists b . m a < C b)
------------------------------ (All a . m a < C b)
|- C b -> Int < m aa -> Int
--------------------------------------- (All a . (All b . m a < C b) =>
|- (All b . C b -> Int) < m aa -> Int
----------------------------------------------
|- All a . (All b . C b -> Int) < m a -> Int
|- C1 aa < C aa |- Int < Int C1 / m, aa / b
--------------------------------
|- C aa -> Int < C1 aa -> Int
----------------------------------------
|- (All b . C b -> Int) < C1 aa -> Int
-----------------------------------------------
|- All a . (All b . C b -> Int) < C1 a -> Int
|- C2 aa < C Y |- Int < Int C2 / m, Y / b
-------------------------------
|- C Y -> Int < C2 aa -> Int
----------------------------------------
|- (All b . C b -> Int) < C2 aa -> Int
------------------------------------------------
|- All a . (All b . C b -> Int) < C2 ab -> Int
All a . a < b |- aa < b C3 / m
-----------------------
All a . a < b |- C3 aa < C b |- Int < Int
---------------------------------------------
All a . a < b |- C b -> Int < C3 aa -> Int
-----------------------------------------------------
All a . a < b |- (All b . C b -> Int) < m aa -> Int
------------------------------------------------------------
All a . a < b |- All a . (All b . C b -> Int) < m a -> Int
-}
-- Scheme reduction -----------------------------------------------------------------------------
--
-- If red cs ps == (s,q,es,es') then q |- es :: subst s cs and q |- es' :: subst s ps
--
------------------------------------------------------------------------------------------------- | 3,543 | resolve env pe = do -- tr ("############### Before resolve:\n" ++ render (nest 8 (vpr pe)))
-- tr ("tevars: " ++ show env_tvs ++ ", reachable: " ++ show reachable_tvs)
(s1,q1,[],es) <- red [] (map mkGoal pe)
-- tr ("############### After resolve:\n" ++ render (nest 8 (vpr q1)))
let f1 = eLet pe (dom pe `zip` es)
badq = filter badDummy q1
-- assert1 (null badq) "Cannot resolve predicates" badq
-- tr "DONE RESOLVING"
(s2,q2,f2) <- simplify (subst s1 env) q1
return (s2@@s1, q2, f2 . f1)
where env_tvs = tevars env
reachable_tvs = vclose (map tvars pe) (ps ++ ns ++ env_tvs)
where (ps,ns) = pols env
mkGoal (v,p) = (force env' (coercion || ambig), p)
where tvs = tvars p
coercion = isCoercion v
ambig = null (tvs `intersect` reachable_tvs)
env' = tick env coercion
badDummy (v,p) = isDummy v && null (tvars p `intersect` env_tvs)
{-
C1 x < C x
C2 x < C Y
C3 x < C y \\ x < y
|- m aa < C b |- Int < Int (All a . Exists b . m a < C b)
------------------------------ (All a . m a < C b)
|- C b -> Int < m aa -> Int
--------------------------------------- (All a . (All b . m a < C b) =>
|- (All b . C b -> Int) < m aa -> Int
----------------------------------------------
|- All a . (All b . C b -> Int) < m a -> Int
|- C1 aa < C aa |- Int < Int C1 / m, aa / b
--------------------------------
|- C aa -> Int < C1 aa -> Int
----------------------------------------
|- (All b . C b -> Int) < C1 aa -> Int
-----------------------------------------------
|- All a . (All b . C b -> Int) < C1 a -> Int
|- C2 aa < C Y |- Int < Int C2 / m, Y / b
-------------------------------
|- C Y -> Int < C2 aa -> Int
----------------------------------------
|- (All b . C b -> Int) < C2 aa -> Int
------------------------------------------------
|- All a . (All b . C b -> Int) < C2 ab -> Int
All a . a < b |- aa < b C3 / m
-----------------------
All a . a < b |- C3 aa < C b |- Int < Int
---------------------------------------------
All a . a < b |- C b -> Int < C3 aa -> Int
-----------------------------------------------------
All a . a < b |- (All b . C b -> Int) < m aa -> Int
------------------------------------------------------------
All a . a < b |- All a . (All b . C b -> Int) < m a -> Int
-}
-- Scheme reduction -----------------------------------------------------------------------------
--
-- If red cs ps == (s,q,es,es') then q |- es :: subst s cs and q |- es' :: subst s ps
--
------------------------------------------------------------------------------------------------- | 3,543 | resolve env pe = do -- tr ("############### Before resolve:\n" ++ render (nest 8 (vpr pe)))
-- tr ("tevars: " ++ show env_tvs ++ ", reachable: " ++ show reachable_tvs)
(s1,q1,[],es) <- red [] (map mkGoal pe)
-- tr ("############### After resolve:\n" ++ render (nest 8 (vpr q1)))
let f1 = eLet pe (dom pe `zip` es)
badq = filter badDummy q1
-- assert1 (null badq) "Cannot resolve predicates" badq
-- tr "DONE RESOLVING"
(s2,q2,f2) <- simplify (subst s1 env) q1
return (s2@@s1, q2, f2 . f1)
where env_tvs = tevars env
reachable_tvs = vclose (map tvars pe) (ps ++ ns ++ env_tvs)
where (ps,ns) = pols env
mkGoal (v,p) = (force env' (coercion || ambig), p)
where tvs = tvars p
coercion = isCoercion v
ambig = null (tvs `intersect` reachable_tvs)
env' = tick env coercion
badDummy (v,p) = isDummy v && null (tvars p `intersect` env_tvs)
{-
C1 x < C x
C2 x < C Y
C3 x < C y \\ x < y
|- m aa < C b |- Int < Int (All a . Exists b . m a < C b)
------------------------------ (All a . m a < C b)
|- C b -> Int < m aa -> Int
--------------------------------------- (All a . (All b . m a < C b) =>
|- (All b . C b -> Int) < m aa -> Int
----------------------------------------------
|- All a . (All b . C b -> Int) < m a -> Int
|- C1 aa < C aa |- Int < Int C1 / m, aa / b
--------------------------------
|- C aa -> Int < C1 aa -> Int
----------------------------------------
|- (All b . C b -> Int) < C1 aa -> Int
-----------------------------------------------
|- All a . (All b . C b -> Int) < C1 a -> Int
|- C2 aa < C Y |- Int < Int C2 / m, Y / b
-------------------------------
|- C Y -> Int < C2 aa -> Int
----------------------------------------
|- (All b . C b -> Int) < C2 aa -> Int
------------------------------------------------
|- All a . (All b . C b -> Int) < C2 ab -> Int
All a . a < b |- aa < b C3 / m
-----------------------
All a . a < b |- C3 aa < C b |- Int < Int
---------------------------------------------
All a . a < b |- C b -> Int < C3 aa -> Int
-----------------------------------------------------
All a . a < b |- (All b . C b -> Int) < m aa -> Int
------------------------------------------------------------
All a . a < b |- All a . (All b . C b -> Int) < m a -> Int
-}
-- Scheme reduction -----------------------------------------------------------------------------
--
-- If red cs ps == (s,q,es,es') then q |- es :: subst s cs and q |- es' :: subst s ps
--
------------------------------------------------------------------------------------------------- | 3,543 | false | false | 3 | 14 | 1,553 | 318 | 170 | 148 | null | null |
filopodia/open | lucid-extras/lib/Lucid/Rdash.hs | mit | mkWidget :: Monad m => HtmlT m () -> HtmlT m () -> HtmlT m ()
mkWidget wIcon wContent =
widget_ $
widgetBody_ $
wIcon >> wContent >> div_ [class_ "clearfix"] (return ()) | 178 | mkWidget :: Monad m => HtmlT m () -> HtmlT m () -> HtmlT m ()
mkWidget wIcon wContent =
widget_ $
widgetBody_ $
wIcon >> wContent >> div_ [class_ "clearfix"] (return ()) | 178 | mkWidget wIcon wContent =
widget_ $
widgetBody_ $
wIcon >> wContent >> div_ [class_ "clearfix"] (return ()) | 116 | false | true | 0 | 9 | 41 | 87 | 41 | 46 | null | null |
kojiromike/Idris-dev | src/IRTS/Portable.hs | bsd-3-clause | -- Update the version when the format changes
formatVersion :: Int
formatVersion = 3 | 84 | formatVersion :: Int
formatVersion = 3 | 38 | formatVersion = 3 | 17 | true | true | 0 | 4 | 13 | 12 | 7 | 5 | null | null |
monte-language/masque | Masque/AST.hs | gpl-3.0 | getPatt :: StateT MASTContext Get Patt
getPatt = do
i <- getVarInt
gets (\(_, patts) -> patts `genericIndex` i) | 119 | getPatt :: StateT MASTContext Get Patt
getPatt = do
i <- getVarInt
gets (\(_, patts) -> patts `genericIndex` i) | 119 | getPatt = do
i <- getVarInt
gets (\(_, patts) -> patts `genericIndex` i) | 80 | false | true | 0 | 10 | 26 | 51 | 27 | 24 | null | null |
GaloisInc/feed | tests/Main.hs | bsd-3-clause | main :: IO ()
main = do
(x:_) <- getArgs
feed <- parseFeedFromFile x
putStrLn (ppTopElement $ xmlFeed feed) | 114 | main :: IO ()
main = do
(x:_) <- getArgs
feed <- parseFeedFromFile x
putStrLn (ppTopElement $ xmlFeed feed) | 114 | main = do
(x:_) <- getArgs
feed <- parseFeedFromFile x
putStrLn (ppTopElement $ xmlFeed feed) | 100 | false | true | 0 | 10 | 25 | 56 | 26 | 30 | null | null |
jaiyalas/creepy-waffle | netwire/sdl.hs | mit | --
winConfig = SDL.defaultWindow
{ SDL.windowPosition = SDL.Centered
, SDL.windowInitialSize = V2 winWidth winHeight
-- , SDL.windowMode = SDL.Fullscreen
} | 167 | winConfig = SDL.defaultWindow
{ SDL.windowPosition = SDL.Centered
, SDL.windowInitialSize = V2 winWidth winHeight
-- , SDL.windowMode = SDL.Fullscreen
} | 164 | winConfig = SDL.defaultWindow
{ SDL.windowPosition = SDL.Centered
, SDL.windowInitialSize = V2 winWidth winHeight
-- , SDL.windowMode = SDL.Fullscreen
} | 164 | true | false | 1 | 8 | 31 | 42 | 21 | 21 | null | null |
abakst/brisk-prelude | examples/Simple04.hs | bsd-3-clause | forever :: Process () -> Process ()
forever p = go
where
go = p >> go | 75 | forever :: Process () -> Process ()
forever p = go
where
go = p >> go | 75 | forever p = go
where
go = p >> go | 39 | false | true | 3 | 8 | 22 | 49 | 20 | 29 | null | null |
nandotorterolo/Tactics | src/Main.hs | bsd-3-clause | strAFicha 'e' = (Espada,Negra) | 30 | strAFicha 'e' = (Espada,Negra) | 30 | strAFicha 'e' = (Espada,Negra) | 30 | false | false | 0 | 5 | 3 | 15 | 8 | 7 | null | null |
kojiromike/Idris-dev | src/Idris/Docstrings.hs | bsd-3-clause | renderHtml :: Docstring DocTerm -> Html
renderHtml = renderDoc . fromDocstring
where
fromDocstring :: Docstring DocTerm -> CT.Doc
fromDocstring (DocString opts blocks) = CT.Doc opts (fmap fromBlock blocks)
fromBlock :: Block DocTerm -> CT.Block
fromBlock (Para inlines) = CT.Para (fmap fromInline inlines)
fromBlock (Header i inlines) = CT.Header i (fmap fromInline inlines)
fromBlock (Blockquote blocks) = CT.Blockquote (fmap fromBlock blocks)
fromBlock (List b t blocks) = CT.List b t (fmap (fmap fromBlock) blocks)
fromBlock (CodeBlock attrs text _) = CT.CodeBlock attrs text
fromBlock (HtmlBlock src) = CT.HtmlBlock src
fromBlock HRule = CT.HRule
fromInline :: Inline DocTerm -> CT.Inline
fromInline (Str t) = CT.Str t
fromInline Space = CT.Space
fromInline SoftBreak = CT.SoftBreak
fromInline LineBreak = CT.LineBreak
fromInline (Emph is) = CT.Emph (fmap fromInline is)
fromInline (Strong is) = CT.Strong (fmap fromInline is)
fromInline (Code src _) = CT.Code src
fromInline (Link is url title) = CT.Link (fmap fromInline is) url title
fromInline (Image is url title) = CT.Image (fmap fromInline is) url title
fromInline (Entity txt) = CT.Entity txt
fromInline (RawHtml src) = CT.RawHtml src
-- | Annotate the code samples in a docstring | 1,486 | renderHtml :: Docstring DocTerm -> Html
renderHtml = renderDoc . fromDocstring
where
fromDocstring :: Docstring DocTerm -> CT.Doc
fromDocstring (DocString opts blocks) = CT.Doc opts (fmap fromBlock blocks)
fromBlock :: Block DocTerm -> CT.Block
fromBlock (Para inlines) = CT.Para (fmap fromInline inlines)
fromBlock (Header i inlines) = CT.Header i (fmap fromInline inlines)
fromBlock (Blockquote blocks) = CT.Blockquote (fmap fromBlock blocks)
fromBlock (List b t blocks) = CT.List b t (fmap (fmap fromBlock) blocks)
fromBlock (CodeBlock attrs text _) = CT.CodeBlock attrs text
fromBlock (HtmlBlock src) = CT.HtmlBlock src
fromBlock HRule = CT.HRule
fromInline :: Inline DocTerm -> CT.Inline
fromInline (Str t) = CT.Str t
fromInline Space = CT.Space
fromInline SoftBreak = CT.SoftBreak
fromInline LineBreak = CT.LineBreak
fromInline (Emph is) = CT.Emph (fmap fromInline is)
fromInline (Strong is) = CT.Strong (fmap fromInline is)
fromInline (Code src _) = CT.Code src
fromInline (Link is url title) = CT.Link (fmap fromInline is) url title
fromInline (Image is url title) = CT.Image (fmap fromInline is) url title
fromInline (Entity txt) = CT.Entity txt
fromInline (RawHtml src) = CT.RawHtml src
-- | Annotate the code samples in a docstring | 1,486 | renderHtml = renderDoc . fromDocstring
where
fromDocstring :: Docstring DocTerm -> CT.Doc
fromDocstring (DocString opts blocks) = CT.Doc opts (fmap fromBlock blocks)
fromBlock :: Block DocTerm -> CT.Block
fromBlock (Para inlines) = CT.Para (fmap fromInline inlines)
fromBlock (Header i inlines) = CT.Header i (fmap fromInline inlines)
fromBlock (Blockquote blocks) = CT.Blockquote (fmap fromBlock blocks)
fromBlock (List b t blocks) = CT.List b t (fmap (fmap fromBlock) blocks)
fromBlock (CodeBlock attrs text _) = CT.CodeBlock attrs text
fromBlock (HtmlBlock src) = CT.HtmlBlock src
fromBlock HRule = CT.HRule
fromInline :: Inline DocTerm -> CT.Inline
fromInline (Str t) = CT.Str t
fromInline Space = CT.Space
fromInline SoftBreak = CT.SoftBreak
fromInline LineBreak = CT.LineBreak
fromInline (Emph is) = CT.Emph (fmap fromInline is)
fromInline (Strong is) = CT.Strong (fmap fromInline is)
fromInline (Code src _) = CT.Code src
fromInline (Link is url title) = CT.Link (fmap fromInline is) url title
fromInline (Image is url title) = CT.Image (fmap fromInline is) url title
fromInline (Entity txt) = CT.Entity txt
fromInline (RawHtml src) = CT.RawHtml src
-- | Annotate the code samples in a docstring | 1,446 | false | true | 23 | 8 | 427 | 498 | 248 | 250 | null | null |
PseudoPower/AFSM | examples/SM/HelloWorld.hs | mit | sf s Pop = popStk s | 19 | sf s Pop = popStk s | 19 | sf s Pop = popStk s | 19 | false | false | 0 | 5 | 5 | 15 | 6 | 9 | null | null |
avh4/elm-compiler | src/Compile.hs | bsd-3-clause | compile
:: String
-> String
-> Module.Interfaces
-> String
-> Either [Doc] Module.CanonicalModule
compile user projectName interfaces source =
do
-- Parse the source code
parsedModule <-
Parse.program (getOpTable interfaces) source
-- determine if default imports should be added
-- only elm-lang/core is exempt
let needsDefaults =
not (user == "elm-lang" && projectName == "core")
-- add default imports if necessary
let rawModule =
DefaultImports.add needsDefaults parsedModule
-- validate module (e.g. all variables exist)
case Check.mistakes (Module.body rawModule) of
[] -> return ()
ms -> Left ms
-- Canonicalize all variables, pinning down where they came from.
canonicalModule <- Canonical.module' interfaces rawModule
-- Run type inference on the program.
types <- TI.infer interfaces canonicalModule
-- Add the real list of tyes
let body = (Module.body canonicalModule) { Module.types = types }
return $ canonicalModule { Module.body = body } | 1,128 | compile
:: String
-> String
-> Module.Interfaces
-> String
-> Either [Doc] Module.CanonicalModule
compile user projectName interfaces source =
do
-- Parse the source code
parsedModule <-
Parse.program (getOpTable interfaces) source
-- determine if default imports should be added
-- only elm-lang/core is exempt
let needsDefaults =
not (user == "elm-lang" && projectName == "core")
-- add default imports if necessary
let rawModule =
DefaultImports.add needsDefaults parsedModule
-- validate module (e.g. all variables exist)
case Check.mistakes (Module.body rawModule) of
[] -> return ()
ms -> Left ms
-- Canonicalize all variables, pinning down where they came from.
canonicalModule <- Canonical.module' interfaces rawModule
-- Run type inference on the program.
types <- TI.infer interfaces canonicalModule
-- Add the real list of tyes
let body = (Module.body canonicalModule) { Module.types = types }
return $ canonicalModule { Module.body = body } | 1,127 | compile user projectName interfaces source =
do
-- Parse the source code
parsedModule <-
Parse.program (getOpTable interfaces) source
-- determine if default imports should be added
-- only elm-lang/core is exempt
let needsDefaults =
not (user == "elm-lang" && projectName == "core")
-- add default imports if necessary
let rawModule =
DefaultImports.add needsDefaults parsedModule
-- validate module (e.g. all variables exist)
case Check.mistakes (Module.body rawModule) of
[] -> return ()
ms -> Left ms
-- Canonicalize all variables, pinning down where they came from.
canonicalModule <- Canonical.module' interfaces rawModule
-- Run type inference on the program.
types <- TI.infer interfaces canonicalModule
-- Add the real list of tyes
let body = (Module.body canonicalModule) { Module.types = types }
return $ canonicalModule { Module.body = body } | 1,009 | false | true | 0 | 14 | 314 | 238 | 116 | 122 | null | null |
OS2World/DEV-UTIL-HUGS | oldlib/MinHeap.hs | bsd-3-clause | fromSeq = fromPrim . C.fromSeq | 30 | fromSeq = fromPrim . C.fromSeq | 30 | fromSeq = fromPrim . C.fromSeq | 30 | false | false | 2 | 6 | 4 | 17 | 6 | 11 | null | null |
comonoidial/ALFIN | ExtCore/Pretty.hs | mit | palt :: Alt -> Doc
palt (Acon c tbs vbs e) =
sep [ppQual c,
sep (map pattbind tbs),
sep (map pvbind vbs) <+> text "->"]
$$ indent (ppExp e) | 182 | palt :: Alt -> Doc
palt (Acon c tbs vbs e) =
sep [ppQual c,
sep (map pattbind tbs),
sep (map pvbind vbs) <+> text "->"]
$$ indent (ppExp e) | 182 | palt (Acon c tbs vbs e) =
sep [ppQual c,
sep (map pattbind tbs),
sep (map pvbind vbs) <+> text "->"]
$$ indent (ppExp e) | 163 | false | true | 0 | 11 | 72 | 87 | 42 | 45 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.