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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dmjio/bloodhound | tests/tests.hs | bsd-3-clause | es13 :: ServerVersion
es13 = ServerVersion 1 3 0 | 48 | es13 :: ServerVersion
es13 = ServerVersion 1 3 0 | 48 | es13 = ServerVersion 1 3 0 | 26 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
acowley/ghc | compiler/types/Type.hs | bsd-3-clause | isEmptyTvSubst :: TvSubst -> Bool
-- See Note [Extending the TvSubstEnv] in TypeRep
isEmptyTvSubst (TvSubst _ tenv) = isEmptyVarEnv tenv | 145 | isEmptyTvSubst :: TvSubst -> Bool
isEmptyTvSubst (TvSubst _ tenv) = isEmptyVarEnv tenv | 86 | isEmptyTvSubst (TvSubst _ tenv) = isEmptyVarEnv tenv | 52 | true | true | 0 | 6 | 28 | 34 | 16 | 18 | null | null |
jbearer/hspl | benchmarks/derive/lib/Derive.hs | mit | trueD (Quotient n d) x = Quotient (Difference (Product (trueD n x) d) (Product n (trueD d x))) (Power d 2) | 106 | trueD (Quotient n d) x = Quotient (Difference (Product (trueD n x) d) (Product n (trueD d x))) (Power d 2) | 106 | trueD (Quotient n d) x = Quotient (Difference (Product (trueD n x) d) (Product n (trueD d x))) (Power d 2) | 106 | false | false | 1 | 11 | 20 | 77 | 35 | 42 | null | null |
jm4games/lightstreamer | src/Lightstreamer/Http.hs | mit | readStreamedResponse :: Connection
-> Maybe ThreadId
-> (B.ByteString -> IO ())
-> Consumer [B.ByteString] IO ()
-> IO (Either B.ByteString HttpResponse)
readStreamedResponse conn tId errHandle streamSink = do
(rSrc, res) <- connectionProducer conn $$+ readHttpHeader
case find contentHeader $ resHeaders res of
Just (HttpHeader "Content-Length" val) -> do
body <- rSrc $$+- (CB.take . maybe 0 fst $ readInt val)
return $ Right res { resBody = ContentBody $ toStrict body }
Just (HttpHeader "Transfer-Encoding" _) -> do
let action = try (rSrc $=+ chunkConduit B.empty $$+- streamSink) >>=
either (errHandle . showException) return
a <- maybe (forkIO action) ((>>) action . return) tId
return $ Right res { resBody = StreamingBody a }
_ -> throwHttpException "Could not determine body type of response."
where
contentHeader (HttpHeader "Content-Length" _) = True
contentHeader (HttpHeader "Transfer-Encoding" _) = True
contentHeader _ = False | 1,172 | readStreamedResponse :: Connection
-> Maybe ThreadId
-> (B.ByteString -> IO ())
-> Consumer [B.ByteString] IO ()
-> IO (Either B.ByteString HttpResponse)
readStreamedResponse conn tId errHandle streamSink = do
(rSrc, res) <- connectionProducer conn $$+ readHttpHeader
case find contentHeader $ resHeaders res of
Just (HttpHeader "Content-Length" val) -> do
body <- rSrc $$+- (CB.take . maybe 0 fst $ readInt val)
return $ Right res { resBody = ContentBody $ toStrict body }
Just (HttpHeader "Transfer-Encoding" _) -> do
let action = try (rSrc $=+ chunkConduit B.empty $$+- streamSink) >>=
either (errHandle . showException) return
a <- maybe (forkIO action) ((>>) action . return) tId
return $ Right res { resBody = StreamingBody a }
_ -> throwHttpException "Could not determine body type of response."
where
contentHeader (HttpHeader "Content-Length" _) = True
contentHeader (HttpHeader "Transfer-Encoding" _) = True
contentHeader _ = False | 1,172 | readStreamedResponse conn tId errHandle streamSink = do
(rSrc, res) <- connectionProducer conn $$+ readHttpHeader
case find contentHeader $ resHeaders res of
Just (HttpHeader "Content-Length" val) -> do
body <- rSrc $$+- (CB.take . maybe 0 fst $ readInt val)
return $ Right res { resBody = ContentBody $ toStrict body }
Just (HttpHeader "Transfer-Encoding" _) -> do
let action = try (rSrc $=+ chunkConduit B.empty $$+- streamSink) >>=
either (errHandle . showException) return
a <- maybe (forkIO action) ((>>) action . return) tId
return $ Right res { resBody = StreamingBody a }
_ -> throwHttpException "Could not determine body type of response."
where
contentHeader (HttpHeader "Content-Length" _) = True
contentHeader (HttpHeader "Transfer-Encoding" _) = True
contentHeader _ = False | 931 | false | true | 2 | 21 | 371 | 357 | 171 | 186 | null | null |
rueshyna/gogol | gogol-sqladmin/gen/Network/Google/SQLAdmin/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'SSLCertsInsertResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'scirServerCaCert'
--
-- * 'scirOperation'
--
-- * 'scirKind'
--
-- * 'scirClientCert'
sslCertsInsertResponse
:: SSLCertsInsertResponse
sslCertsInsertResponse =
SSLCertsInsertResponse'
{ _scirServerCaCert = Nothing
, _scirOperation = Nothing
, _scirKind = "sql#sslCertsInsert"
, _scirClientCert = Nothing
} | 516 | sslCertsInsertResponse
:: SSLCertsInsertResponse
sslCertsInsertResponse =
SSLCertsInsertResponse'
{ _scirServerCaCert = Nothing
, _scirOperation = Nothing
, _scirKind = "sql#sslCertsInsert"
, _scirClientCert = Nothing
} | 247 | sslCertsInsertResponse =
SSLCertsInsertResponse'
{ _scirServerCaCert = Nothing
, _scirOperation = Nothing
, _scirKind = "sql#sslCertsInsert"
, _scirClientCert = Nothing
} | 194 | true | true | 1 | 7 | 96 | 55 | 35 | 20 | null | null |
romanb/amazonka | amazonka-swf/gen/Network/AWS/SWF/Types.hs | mpl-2.0 | -- | 'TagFilter' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'tfTag' @::@ 'Text'
--
tagFilter :: Text -- ^ 'tfTag'
-> TagFilter
tagFilter p1 = TagFilter
{ _tfTag = p1
} | 225 | tagFilter :: Text -- ^ 'tfTag'
-> TagFilter
tagFilter p1 = TagFilter
{ _tfTag = p1
} | 102 | tagFilter p1 = TagFilter
{ _tfTag = p1
} | 48 | true | true | 0 | 7 | 54 | 37 | 22 | 15 | null | null |
mwahab1/pandoc | src/Text/Pandoc/Writers/LaTeX.hs | gpl-2.0 | citeArguments :: [Inline] -> [Inline] -> String -> State WriterState Doc
citeArguments p s k = do
let s' = case s of
(Str (x:[]) : r) | isPunctuation x -> dropWhile (== Space) r
(Str (x:xs) : r) | isPunctuation x -> Str xs : r
_ -> s
pdoc <- inlineListToLaTeX p
sdoc <- inlineListToLaTeX s'
let optargs = case (isEmpty pdoc, isEmpty sdoc) of
(True, True ) -> empty
(True, False) -> brackets sdoc
(_ , _ ) -> brackets pdoc <> brackets sdoc
return $ optargs <> braces (text k) | 609 | citeArguments :: [Inline] -> [Inline] -> String -> State WriterState Doc
citeArguments p s k = do
let s' = case s of
(Str (x:[]) : r) | isPunctuation x -> dropWhile (== Space) r
(Str (x:xs) : r) | isPunctuation x -> Str xs : r
_ -> s
pdoc <- inlineListToLaTeX p
sdoc <- inlineListToLaTeX s'
let optargs = case (isEmpty pdoc, isEmpty sdoc) of
(True, True ) -> empty
(True, False) -> brackets sdoc
(_ , _ ) -> brackets pdoc <> brackets sdoc
return $ optargs <> braces (text k) | 609 | citeArguments p s k = do
let s' = case s of
(Str (x:[]) : r) | isPunctuation x -> dropWhile (== Space) r
(Str (x:xs) : r) | isPunctuation x -> Str xs : r
_ -> s
pdoc <- inlineListToLaTeX p
sdoc <- inlineListToLaTeX s'
let optargs = case (isEmpty pdoc, isEmpty sdoc) of
(True, True ) -> empty
(True, False) -> brackets sdoc
(_ , _ ) -> brackets pdoc <> brackets sdoc
return $ optargs <> braces (text k) | 536 | false | true | 2 | 18 | 228 | 253 | 124 | 129 | null | null |
LambdaHack/LambdaHack | engine-src/Game/LambdaHack/Common/Time.hs | bsd-3-clause | absoluteTimeAdd (Time t1) (Time t2) = Time (t1 + t2) | 52 | absoluteTimeAdd (Time t1) (Time t2) = Time (t1 + t2) | 52 | absoluteTimeAdd (Time t1) (Time t2) = Time (t1 + t2) | 52 | false | false | 0 | 7 | 9 | 33 | 16 | 17 | null | null |
theNerd247/ariaRacer | arweb/app/Parser.hs | bsd-3-clause | space = word8 32 | 16 | space = word8 32 | 16 | space = word8 32 | 16 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
plumlife/cabal | cabal-install/Distribution/Client/Install.hs | bsd-3-clause | -- | Make an install context given install arguments.
makeInstallContext :: Verbosity -> InstallArgs -> Maybe [UserTarget]
-> IO InstallContext
makeInstallContext verbosity
(packageDBs, repos, comp, _, conf,_,_,
globalFlags, _, _, _, _) mUserTargets = do
installedPkgIndex <- getInstalledPackages verbosity comp packageDBs conf
sourcePkgDb <- getSourcePackages verbosity repos
(userTargets, pkgSpecifiers) <- case mUserTargets of
Nothing ->
-- We want to distinguish between the case where the user has given an
-- empty list of targets on the command-line and the case where we
-- specifically want to have an empty list of targets.
return ([], [])
Just userTargets0 -> do
-- For install, if no target is given it means we use the current
-- directory as the single target.
let userTargets | null userTargets0 = [UserTargetLocalDir "."]
| otherwise = userTargets0
pkgSpecifiers <- resolveUserTargets verbosity
(fromFlag $ globalWorldFile globalFlags)
(packageIndex sourcePkgDb)
userTargets
return (userTargets, pkgSpecifiers)
return (installedPkgIndex, sourcePkgDb, userTargets, pkgSpecifiers)
-- | Make an install plan given install context and install arguments. | 1,423 | makeInstallContext :: Verbosity -> InstallArgs -> Maybe [UserTarget]
-> IO InstallContext
makeInstallContext verbosity
(packageDBs, repos, comp, _, conf,_,_,
globalFlags, _, _, _, _) mUserTargets = do
installedPkgIndex <- getInstalledPackages verbosity comp packageDBs conf
sourcePkgDb <- getSourcePackages verbosity repos
(userTargets, pkgSpecifiers) <- case mUserTargets of
Nothing ->
-- We want to distinguish between the case where the user has given an
-- empty list of targets on the command-line and the case where we
-- specifically want to have an empty list of targets.
return ([], [])
Just userTargets0 -> do
-- For install, if no target is given it means we use the current
-- directory as the single target.
let userTargets | null userTargets0 = [UserTargetLocalDir "."]
| otherwise = userTargets0
pkgSpecifiers <- resolveUserTargets verbosity
(fromFlag $ globalWorldFile globalFlags)
(packageIndex sourcePkgDb)
userTargets
return (userTargets, pkgSpecifiers)
return (installedPkgIndex, sourcePkgDb, userTargets, pkgSpecifiers)
-- | Make an install plan given install context and install arguments. | 1,369 | makeInstallContext verbosity
(packageDBs, repos, comp, _, conf,_,_,
globalFlags, _, _, _, _) mUserTargets = do
installedPkgIndex <- getInstalledPackages verbosity comp packageDBs conf
sourcePkgDb <- getSourcePackages verbosity repos
(userTargets, pkgSpecifiers) <- case mUserTargets of
Nothing ->
-- We want to distinguish between the case where the user has given an
-- empty list of targets on the command-line and the case where we
-- specifically want to have an empty list of targets.
return ([], [])
Just userTargets0 -> do
-- For install, if no target is given it means we use the current
-- directory as the single target.
let userTargets | null userTargets0 = [UserTargetLocalDir "."]
| otherwise = userTargets0
pkgSpecifiers <- resolveUserTargets verbosity
(fromFlag $ globalWorldFile globalFlags)
(packageIndex sourcePkgDb)
userTargets
return (userTargets, pkgSpecifiers)
return (installedPkgIndex, sourcePkgDb, userTargets, pkgSpecifiers)
-- | Make an install plan given install context and install arguments. | 1,257 | true | true | 0 | 19 | 419 | 250 | 130 | 120 | null | null |
guillaume-nargeot/codecov-haskell | src/Trace/Hpc/Codecov.hs | bsd-3-clause | getExprSource :: [String] -> MixEntry -> [String]
getExprSource source (hpcPos, _) = subSubSeq startCol endCol subLines
where subLines = subSeq startLine endLine source
startLine = startLine' - 1
startCol = startCol' - 1
(startLine', startCol', endLine, endCol) = fromHpcPos hpcPos | 315 | getExprSource :: [String] -> MixEntry -> [String]
getExprSource source (hpcPos, _) = subSubSeq startCol endCol subLines
where subLines = subSeq startLine endLine source
startLine = startLine' - 1
startCol = startCol' - 1
(startLine', startCol', endLine, endCol) = fromHpcPos hpcPos | 315 | getExprSource source (hpcPos, _) = subSubSeq startCol endCol subLines
where subLines = subSeq startLine endLine source
startLine = startLine' - 1
startCol = startCol' - 1
(startLine', startCol', endLine, endCol) = fromHpcPos hpcPos | 265 | false | true | 3 | 7 | 73 | 100 | 52 | 48 | null | null |
capital-match/hdo | src/Network/DO/IP/Net.hs | mit | doAction :: (ComonadEnv ToolConfiguration w, Monad m) => w a -> IP -> IPAction -> (RESTT m (Result (ActionResult IPActionType)), w a)
doAction w ip action = maybe (return $ error "no authentication token defined", w)
(\ t -> let r = postJSONWith (authorisation t) (toURI $ floatingIpsEndpoint </> show ip </> "actions") (toJSON action)
>>= return . fromResponse "action"
in (r, w))
(authToken (ask w)) | 517 | doAction :: (ComonadEnv ToolConfiguration w, Monad m) => w a -> IP -> IPAction -> (RESTT m (Result (ActionResult IPActionType)), w a)
doAction w ip action = maybe (return $ error "no authentication token defined", w)
(\ t -> let r = postJSONWith (authorisation t) (toURI $ floatingIpsEndpoint </> show ip </> "actions") (toJSON action)
>>= return . fromResponse "action"
in (r, w))
(authToken (ask w)) | 517 | doAction w ip action = maybe (return $ error "no authentication token defined", w)
(\ t -> let r = postJSONWith (authorisation t) (toURI $ floatingIpsEndpoint </> show ip </> "actions") (toJSON action)
>>= return . fromResponse "action"
in (r, w))
(authToken (ask w)) | 383 | false | true | 0 | 18 | 181 | 186 | 92 | 94 | null | null |
oldmanmike/sdl2 | src/SDL/Raw/Video.hs | bsd-3-clause | setWindowGammaRamp :: MonadIO m => Window -> Ptr Word16 -> Ptr Word16 -> Ptr Word16 -> m CInt
setWindowGammaRamp v1 v2 v3 v4 = liftIO $ setWindowGammaRampFFI v1 v2 v3 v4 | 169 | setWindowGammaRamp :: MonadIO m => Window -> Ptr Word16 -> Ptr Word16 -> Ptr Word16 -> m CInt
setWindowGammaRamp v1 v2 v3 v4 = liftIO $ setWindowGammaRampFFI v1 v2 v3 v4 | 169 | setWindowGammaRamp v1 v2 v3 v4 = liftIO $ setWindowGammaRampFFI v1 v2 v3 v4 | 75 | false | true | 0 | 10 | 30 | 68 | 31 | 37 | null | null |
msullivan/advent-of-code | 2018/A9a.hs | mit | --------
players = 470 | 23 | players = 470 | 13 | players = 470 | 13 | true | false | 1 | 5 | 4 | 11 | 4 | 7 | null | null |
meditans/hint | unit-tests/run-unit-tests.hs | bsd-3-clause | test_only_one_instance :: TestCase
test_only_one_instance = TestCase "only_one_instance" [] $ liftIO $ do
r <- newEmptyMVar
let concurrent = runInterpreter (liftIO $ putMVar r False)
`catch` \MultipleInstancesNotAllowed ->
do liftIO $ putMVar r True
return $ Right ()
_ <- forkIO $ Control.Monad.void concurrent
readMVar r @? "concurrent instance did not fail" | 494 | test_only_one_instance :: TestCase
test_only_one_instance = TestCase "only_one_instance" [] $ liftIO $ do
r <- newEmptyMVar
let concurrent = runInterpreter (liftIO $ putMVar r False)
`catch` \MultipleInstancesNotAllowed ->
do liftIO $ putMVar r True
return $ Right ()
_ <- forkIO $ Control.Monad.void concurrent
readMVar r @? "concurrent instance did not fail" | 494 | test_only_one_instance = TestCase "only_one_instance" [] $ liftIO $ do
r <- newEmptyMVar
let concurrent = runInterpreter (liftIO $ putMVar r False)
`catch` \MultipleInstancesNotAllowed ->
do liftIO $ putMVar r True
return $ Right ()
_ <- forkIO $ Control.Monad.void concurrent
readMVar r @? "concurrent instance did not fail" | 459 | false | true | 0 | 17 | 184 | 119 | 56 | 63 | null | null |
SEEK-Org/evaporate | src/StackDependency.hs | mit | getParameterDependencies :: (MonadThrow m, MonadReader StackNodeMap m)
=> AWSAccountID
-> StackNode
-> m (Set StackDependency)
getParameterDependencies accountID source@(_, StackDescription{..}) = do
params <- HashMap.elems <$> getParameters _parameters accountID
Set.fromList . catMaybes <$> traverse (parameterValueToDependency source) params | 423 | getParameterDependencies :: (MonadThrow m, MonadReader StackNodeMap m)
=> AWSAccountID
-> StackNode
-> m (Set StackDependency)
getParameterDependencies accountID source@(_, StackDescription{..}) = do
params <- HashMap.elems <$> getParameters _parameters accountID
Set.fromList . catMaybes <$> traverse (parameterValueToDependency source) params | 423 | getParameterDependencies accountID source@(_, StackDescription{..}) = do
params <- HashMap.elems <$> getParameters _parameters accountID
Set.fromList . catMaybes <$> traverse (parameterValueToDependency source) params | 221 | false | true | 8 | 7 | 114 | 92 | 51 | 41 | null | null |
ryantm/ghc | testsuite/tests/programs/galois_raytrace/Primitives.hs | bsd-3-clause | asinD :: Double -> Double
asinD x = asin x * 180 / pi | 53 | asinD :: Double -> Double
asinD x = asin x * 180 / pi | 53 | asinD x = asin x * 180 / pi | 27 | false | true | 3 | 7 | 13 | 37 | 15 | 22 | null | null |
kmate/HaRe | test/testdata/Renaming/B2.hs | bsd-3-clause | sumSquares (x:xs)= x^2 + sumSquares xs | 38 | sumSquares (x:xs)= x^2 + sumSquares xs | 38 | sumSquares (x:xs)= x^2 + sumSquares xs | 38 | false | false | 0 | 7 | 5 | 27 | 13 | 14 | null | null |
d0kt0r0/estuary | client/src/Estuary/Resources.hs | gpl-3.0 | -- audio image video
emptyResourceMaps :: ResourceMaps
emptyResourceMaps = (LocMap.empty,LocMap.empty,LocMap.empty) | 116 | emptyResourceMaps :: ResourceMaps
emptyResourceMaps = (LocMap.empty,LocMap.empty,LocMap.empty) | 94 | emptyResourceMaps = (LocMap.empty,LocMap.empty,LocMap.empty) | 60 | true | true | 0 | 7 | 10 | 34 | 17 | 17 | null | null |
matonix/pfds | src/PFDS/Sec9/Ex13.hs | bsd-3-clause | fixup :: RList a -> RList a
fixup (Zero : ds) = let (Node _ t1 t2, ds') = unconsTree ds in Two (t1, t2) : ds' | 109 | fixup :: RList a -> RList a
fixup (Zero : ds) = let (Node _ t1 t2, ds') = unconsTree ds in Two (t1, t2) : ds' | 109 | fixup (Zero : ds) = let (Node _ t1 t2, ds') = unconsTree ds in Two (t1, t2) : ds' | 81 | false | true | 0 | 10 | 26 | 77 | 36 | 41 | null | null |
mbg/system-f-with-kind-polymorphism | Inline.hs | mit | inlineTypes env (AppTy tf ta) = do
tf' <- inlineTypes env tf
ta' <- inlineTypes env ta
return $ AppTy tf' ta' | 122 | inlineTypes env (AppTy tf ta) = do
tf' <- inlineTypes env tf
ta' <- inlineTypes env ta
return $ AppTy tf' ta' | 122 | inlineTypes env (AppTy tf ta) = do
tf' <- inlineTypes env tf
ta' <- inlineTypes env ta
return $ AppTy tf' ta' | 122 | false | false | 0 | 8 | 34 | 57 | 24 | 33 | null | null |
sixears/getopt | src/Console/Getopt.hs | mit | maybeGetArg _ Nothing largs _ = (Nothing, largs, Nothing) | 78 | maybeGetArg _ Nothing largs _ = (Nothing, largs, Nothing) | 78 | maybeGetArg _ Nothing largs _ = (Nothing, largs, Nothing) | 78 | false | false | 0 | 5 | 29 | 24 | 13 | 11 | null | null |
sgillespie/ghc | compiler/cmm/CLabel.hs | bsd-3-clause | mkReturnInfoLabel uniq = CaseLabel uniq CaseReturnInfo | 63 | mkReturnInfoLabel uniq = CaseLabel uniq CaseReturnInfo | 63 | mkReturnInfoLabel uniq = CaseLabel uniq CaseReturnInfo | 63 | false | false | 0 | 5 | 14 | 14 | 6 | 8 | null | null |
robstewart57/stack | src/main/Main.hs | bsd-3-clause | targetsCmd :: Text -> GlobalOpts -> IO ()
targetsCmd target go@GlobalOpts{..} =
withBuildConfig go $
do (_realTargets,_,pkgs) <- ghciSetup Nothing [target]
pwd <- getWorkingDir
targets <-
fmap
(concat . snd . unzip)
(mapM (getPackageOptsAndTargetFiles pwd) pkgs)
forM_ targets (liftIO . putStrLn)
-- | Pull the current Docker image. | 403 | targetsCmd :: Text -> GlobalOpts -> IO ()
targetsCmd target go@GlobalOpts{..} =
withBuildConfig go $
do (_realTargets,_,pkgs) <- ghciSetup Nothing [target]
pwd <- getWorkingDir
targets <-
fmap
(concat . snd . unzip)
(mapM (getPackageOptsAndTargetFiles pwd) pkgs)
forM_ targets (liftIO . putStrLn)
-- | Pull the current Docker image. | 403 | targetsCmd target go@GlobalOpts{..} =
withBuildConfig go $
do (_realTargets,_,pkgs) <- ghciSetup Nothing [target]
pwd <- getWorkingDir
targets <-
fmap
(concat . snd . unzip)
(mapM (getPackageOptsAndTargetFiles pwd) pkgs)
forM_ targets (liftIO . putStrLn)
-- | Pull the current Docker image. | 361 | false | true | 0 | 13 | 118 | 129 | 64 | 65 | null | null |
melted/llvm-pretty | src/Text/LLVM/AST.hs | bsd-3-clause | ppFCmpOp Foeq = text "oeq" | 28 | ppFCmpOp Foeq = text "oeq" | 28 | ppFCmpOp Foeq = text "oeq" | 28 | false | false | 1 | 5 | 6 | 15 | 5 | 10 | null | null |
binarybana/grn-pathways | GRN/EM.hs | bsd-2-clause | posteriorProb :: EMData -> Theta -> U.Vector Double
posteriorProb EMData{..} new = G.convert $ G.map (*(1/normSum)) (V.generate (length emAttractors) eachAttractor)
where normSum = sum $ map (\(w,issam)-> w * msLookup issam emMeasurements ) newAgivenTheta
newAgivenTheta = generateNewAttractors emArgs emUnfilledKMS emCompNodes emUncertainLocs new
eachAttractor i = msLookup newssam emMeasurements * newAgivenO
where (newAgivenO, newssam) = newAgivenTheta !! i
{-fullEM :: EMData -> Int -> Theta -> [(Theta,EMData)]-}
{-fullEM emd 0 oldtheta = [(oldtheta,emd)]-}
{-fullEM emd maxiter oldtheta -}
{-| thetaClose = (oldtheta,emd) : [(newtheta,newemd)]-}
{-| otherwise = (oldtheta,emd) : fullEM newemd (maxiter-1) newtheta-}
{-where newemd = emd { emAttractors=newAtracs, emNormSum=newNormSum } -}
{-newAtracs = generateNewAttractors (emArgs emd) (emUnfilledKMS emd) -}
{-(emCompNodes emd) (emUncertainLocs emd) newtheta-}
{-newNormSum = normSum newAtracs (emMeasurements emd)-}
{-newtheta = optimize (expectationRun emd) oldtheta-}
{-thetaClose = (<1e-5).U.sum.U.map (**2).U.zipWith (-) newtheta $ oldtheta-}
--data EMData = EMData {
-- emAttractors :: Attractors
-- , emUnfilledKMS :: KmapSet
-- , emComps :: [ColoredStateGraph]
-- , emCompNodes :: Masks
-- , emNormSum :: Double
-- , emArgs :: Args String
-- , emMeasurements :: MeasureMap
-- , emUncertainLocs :: [UncertainSpot]
-- }
{-emRun :: Args String -> ParseData -> IO () -}
{-emRun args p = do-}
{-let-}
{-gen = gotArg args "generate"-}
{-ks = buildKmaps p -}
{-ms = measureMap p-}
{-uvals = uncertainVals ks-}
{-ng = M.size ks-}
{-n = length uvals-}
{-printList :: [U.Vector Double] -> String-}
{-printList x = concat $ intersperse "\n" (map (concatMap (printf "%7.3f").G.toList) $ x)-}
{---startTheta = U.fromList [0.379,0.5,1.0]-}
{-startTheta = U.replicate n 0.5-}
{-newks = fillKentries uvals ks startTheta-}
{-stripG = componentsOf . last . take 10.iterate stripTransNodes $ kmapToStateGraph newks-}
{-stripNodes = map (U.fromList.sort.nodes) stripG-}
{-startAtracs = runAndSplit args newks stripNodes-}
{-norms = normSum startAtracs ms-}
{-emdat = EMData startAtracs ks stripG stripNodes norms args ms uvals-}
{-mapt = map (U.fromList.map fromIntegral.dec2bin n) [0..2^n-1]-}
{---mapt = map (U.replicate n) [0,0.1,0.9,1.0]-}
{---mapt = map (U.fromList) [replicate n 0.0, replicate n 0.001]-}
{---prVal = map (expectationRun emdat) mapt-}
{-prVal = map (posteriorProb emdat) mapt -}
{-prVal2 = map (expectationRun emdat) mapt -}
{-elOpt = optimize (expectationRun emdat) (U.replicate n 0.5) -}
{-path = fullEM emdat 10 startTheta-}
{-xs = clamped [0,0.05..1]-}
{-clamped xs = map (\x-> if (x>1.0) then 1.0 else (if (x<0.0) then 0.0 else x)) xs-}
{-printSeg :: String -> String -> IO ()-}
{-printSeg title st = do-}
{-let l = 2 + length title-}
{-upperTitle = map toUpper title-}
{-width = 80-}
{-half = (width-l) `div` 2-}
{-stars = replicate half '*'-}
{-printf "\n%s %s %s\n\n%s\n\n%s\n\n" stars upperTitle stars st (replicate width '*')-}
--print n
--forM_ mapt $ \t -> do
-- let path = fullEM emdat 10 t
{-printSeg "theta path" (printList.map (\(t,e)->t) $ path)-}
{-printSeg "posterior probs" (printList.map (\(t,e)->posteriorProb e t) $ path)-}
{---printSeg "attractors" (concatMap (printf "%7s".map intToDigit.dec2bin ng.G.head) stripNodes)-}
{-printSeg "attractors" (concatMap (printf "%7d".G.head) stripNodes)-}
{-print $ M.keys ks-}
{---printf "%d Evaluations\n" ((length xs)^2)-}
{-plotFunc3d [XLabel "X", YLabel "Y", XRange (0,1), YRange (0,1)] [] xs xs -}
{-(\x y -> (-1)*(expectationRun emdat (U.fromList [0.5,x,y])))-}
{---putStrLn "Expectations:"-}
{---mapM_ (printf "%7.3f") prVal2-}
{---putStrLn ""-}
{---print elOpt-}
{---putStrLn "Posterior Probs:"-}
{---mapM_ (sequence.printList.U.fromList.sort.U.toList) prVal-}
{---putStrLn ""-}
{---mapM_ (printf "%5.2f") (map U.sum prVal)-}
{---putStrLn ""-}
{---putStrLn ""-}
{---putStrLn ""-}
{---print $ generateNewAttractors args ks stripNodes uvals (last mapt)-}
{----}
{---putStrLn ""-}
{---putStrLn "Expectations:"-}
{---mapM_ (printf "%7.3f\n") prVal2-}
{---putStrLn ""-}
{---putStrLn ""-}
{---putStrLn ""-}
{---putStrLn "**** Optimal Posterior Probs ****"-}
{---mapM_ (sequence.printList) [posteriorProb emdat elOpt]-}
{---mapM_ (printf "%7.3d".(U.head)) stripNodes-}
{---putStrLn ""-}
{---putStrLn "*********************************"-}
{----}
{---putStrLn ""-}
{---printf "Optimal Expectation: %5.2f\n" (expectationRun emdat elOpt)-}
{---putStrLn ""-}
{---putStrLn "**** Optimal Theta ****"-}
{---mapM_ (sequence.printList) [elOpt]-}
{-printSeg "uncertain locs" (show uvals)-}
{-printSeg "measurements" (show ms)-}
{-when gen $ do-}
{-let newks2 = fillKentries uvals ks (fst.last $ path)-}
{-finalGraph = simulate args $ kmapToStateGraph newks2-}
{-stripG2 = componentsOf . last . take 10.iterate stripTransNodes $ finalGraph-}
{-stripNodes2 = map (U.fromList.sort.nodes) stripG2-}
{-printSeg "final attractors" (concatMap (printf "%7d".G.head) stripNodes2)-}
{-drawStateGraph finalGraph args-}
{---let newks2 = fillKentries uvals ks (fst.head $ path)-}
{--- interGraph = kmapToStateGraph newks2-}
{--- ssd = simulateDOK args $ kmapToDOK newks2-}
{----- WATCH OUT TODO I just found a huge bug: StateTransition.simulate does-}
{----- not respect edge weights when moving probabilities around-} | 5,838 | posteriorProb :: EMData -> Theta -> U.Vector Double
posteriorProb EMData{..} new = G.convert $ G.map (*(1/normSum)) (V.generate (length emAttractors) eachAttractor)
where normSum = sum $ map (\(w,issam)-> w * msLookup issam emMeasurements ) newAgivenTheta
newAgivenTheta = generateNewAttractors emArgs emUnfilledKMS emCompNodes emUncertainLocs new
eachAttractor i = msLookup newssam emMeasurements * newAgivenO
where (newAgivenO, newssam) = newAgivenTheta !! i
{-fullEM :: EMData -> Int -> Theta -> [(Theta,EMData)]-}
{-fullEM emd 0 oldtheta = [(oldtheta,emd)]-}
{-fullEM emd maxiter oldtheta -}
{-| thetaClose = (oldtheta,emd) : [(newtheta,newemd)]-}
{-| otherwise = (oldtheta,emd) : fullEM newemd (maxiter-1) newtheta-}
{-where newemd = emd { emAttractors=newAtracs, emNormSum=newNormSum } -}
{-newAtracs = generateNewAttractors (emArgs emd) (emUnfilledKMS emd) -}
{-(emCompNodes emd) (emUncertainLocs emd) newtheta-}
{-newNormSum = normSum newAtracs (emMeasurements emd)-}
{-newtheta = optimize (expectationRun emd) oldtheta-}
{-thetaClose = (<1e-5).U.sum.U.map (**2).U.zipWith (-) newtheta $ oldtheta-}
--data EMData = EMData {
-- emAttractors :: Attractors
-- , emUnfilledKMS :: KmapSet
-- , emComps :: [ColoredStateGraph]
-- , emCompNodes :: Masks
-- , emNormSum :: Double
-- , emArgs :: Args String
-- , emMeasurements :: MeasureMap
-- , emUncertainLocs :: [UncertainSpot]
-- }
{-emRun :: Args String -> ParseData -> IO () -}
{-emRun args p = do-}
{-let-}
{-gen = gotArg args "generate"-}
{-ks = buildKmaps p -}
{-ms = measureMap p-}
{-uvals = uncertainVals ks-}
{-ng = M.size ks-}
{-n = length uvals-}
{-printList :: [U.Vector Double] -> String-}
{-printList x = concat $ intersperse "\n" (map (concatMap (printf "%7.3f").G.toList) $ x)-}
{---startTheta = U.fromList [0.379,0.5,1.0]-}
{-startTheta = U.replicate n 0.5-}
{-newks = fillKentries uvals ks startTheta-}
{-stripG = componentsOf . last . take 10.iterate stripTransNodes $ kmapToStateGraph newks-}
{-stripNodes = map (U.fromList.sort.nodes) stripG-}
{-startAtracs = runAndSplit args newks stripNodes-}
{-norms = normSum startAtracs ms-}
{-emdat = EMData startAtracs ks stripG stripNodes norms args ms uvals-}
{-mapt = map (U.fromList.map fromIntegral.dec2bin n) [0..2^n-1]-}
{---mapt = map (U.replicate n) [0,0.1,0.9,1.0]-}
{---mapt = map (U.fromList) [replicate n 0.0, replicate n 0.001]-}
{---prVal = map (expectationRun emdat) mapt-}
{-prVal = map (posteriorProb emdat) mapt -}
{-prVal2 = map (expectationRun emdat) mapt -}
{-elOpt = optimize (expectationRun emdat) (U.replicate n 0.5) -}
{-path = fullEM emdat 10 startTheta-}
{-xs = clamped [0,0.05..1]-}
{-clamped xs = map (\x-> if (x>1.0) then 1.0 else (if (x<0.0) then 0.0 else x)) xs-}
{-printSeg :: String -> String -> IO ()-}
{-printSeg title st = do-}
{-let l = 2 + length title-}
{-upperTitle = map toUpper title-}
{-width = 80-}
{-half = (width-l) `div` 2-}
{-stars = replicate half '*'-}
{-printf "\n%s %s %s\n\n%s\n\n%s\n\n" stars upperTitle stars st (replicate width '*')-}
--print n
--forM_ mapt $ \t -> do
-- let path = fullEM emdat 10 t
{-printSeg "theta path" (printList.map (\(t,e)->t) $ path)-}
{-printSeg "posterior probs" (printList.map (\(t,e)->posteriorProb e t) $ path)-}
{---printSeg "attractors" (concatMap (printf "%7s".map intToDigit.dec2bin ng.G.head) stripNodes)-}
{-printSeg "attractors" (concatMap (printf "%7d".G.head) stripNodes)-}
{-print $ M.keys ks-}
{---printf "%d Evaluations\n" ((length xs)^2)-}
{-plotFunc3d [XLabel "X", YLabel "Y", XRange (0,1), YRange (0,1)] [] xs xs -}
{-(\x y -> (-1)*(expectationRun emdat (U.fromList [0.5,x,y])))-}
{---putStrLn "Expectations:"-}
{---mapM_ (printf "%7.3f") prVal2-}
{---putStrLn ""-}
{---print elOpt-}
{---putStrLn "Posterior Probs:"-}
{---mapM_ (sequence.printList.U.fromList.sort.U.toList) prVal-}
{---putStrLn ""-}
{---mapM_ (printf "%5.2f") (map U.sum prVal)-}
{---putStrLn ""-}
{---putStrLn ""-}
{---putStrLn ""-}
{---print $ generateNewAttractors args ks stripNodes uvals (last mapt)-}
{----}
{---putStrLn ""-}
{---putStrLn "Expectations:"-}
{---mapM_ (printf "%7.3f\n") prVal2-}
{---putStrLn ""-}
{---putStrLn ""-}
{---putStrLn ""-}
{---putStrLn "**** Optimal Posterior Probs ****"-}
{---mapM_ (sequence.printList) [posteriorProb emdat elOpt]-}
{---mapM_ (printf "%7.3d".(U.head)) stripNodes-}
{---putStrLn ""-}
{---putStrLn "*********************************"-}
{----}
{---putStrLn ""-}
{---printf "Optimal Expectation: %5.2f\n" (expectationRun emdat elOpt)-}
{---putStrLn ""-}
{---putStrLn "**** Optimal Theta ****"-}
{---mapM_ (sequence.printList) [elOpt]-}
{-printSeg "uncertain locs" (show uvals)-}
{-printSeg "measurements" (show ms)-}
{-when gen $ do-}
{-let newks2 = fillKentries uvals ks (fst.last $ path)-}
{-finalGraph = simulate args $ kmapToStateGraph newks2-}
{-stripG2 = componentsOf . last . take 10.iterate stripTransNodes $ finalGraph-}
{-stripNodes2 = map (U.fromList.sort.nodes) stripG2-}
{-printSeg "final attractors" (concatMap (printf "%7d".G.head) stripNodes2)-}
{-drawStateGraph finalGraph args-}
{---let newks2 = fillKentries uvals ks (fst.head $ path)-}
{--- interGraph = kmapToStateGraph newks2-}
{--- ssd = simulateDOK args $ kmapToDOK newks2-}
{----- WATCH OUT TODO I just found a huge bug: StateTransition.simulate does-}
{----- not respect edge weights when moving probabilities around-} | 5,838 | posteriorProb EMData{..} new = G.convert $ G.map (*(1/normSum)) (V.generate (length emAttractors) eachAttractor)
where normSum = sum $ map (\(w,issam)-> w * msLookup issam emMeasurements ) newAgivenTheta
newAgivenTheta = generateNewAttractors emArgs emUnfilledKMS emCompNodes emUncertainLocs new
eachAttractor i = msLookup newssam emMeasurements * newAgivenO
where (newAgivenO, newssam) = newAgivenTheta !! i
{-fullEM :: EMData -> Int -> Theta -> [(Theta,EMData)]-}
{-fullEM emd 0 oldtheta = [(oldtheta,emd)]-}
{-fullEM emd maxiter oldtheta -}
{-| thetaClose = (oldtheta,emd) : [(newtheta,newemd)]-}
{-| otherwise = (oldtheta,emd) : fullEM newemd (maxiter-1) newtheta-}
{-where newemd = emd { emAttractors=newAtracs, emNormSum=newNormSum } -}
{-newAtracs = generateNewAttractors (emArgs emd) (emUnfilledKMS emd) -}
{-(emCompNodes emd) (emUncertainLocs emd) newtheta-}
{-newNormSum = normSum newAtracs (emMeasurements emd)-}
{-newtheta = optimize (expectationRun emd) oldtheta-}
{-thetaClose = (<1e-5).U.sum.U.map (**2).U.zipWith (-) newtheta $ oldtheta-}
--data EMData = EMData {
-- emAttractors :: Attractors
-- , emUnfilledKMS :: KmapSet
-- , emComps :: [ColoredStateGraph]
-- , emCompNodes :: Masks
-- , emNormSum :: Double
-- , emArgs :: Args String
-- , emMeasurements :: MeasureMap
-- , emUncertainLocs :: [UncertainSpot]
-- }
{-emRun :: Args String -> ParseData -> IO () -}
{-emRun args p = do-}
{-let-}
{-gen = gotArg args "generate"-}
{-ks = buildKmaps p -}
{-ms = measureMap p-}
{-uvals = uncertainVals ks-}
{-ng = M.size ks-}
{-n = length uvals-}
{-printList :: [U.Vector Double] -> String-}
{-printList x = concat $ intersperse "\n" (map (concatMap (printf "%7.3f").G.toList) $ x)-}
{---startTheta = U.fromList [0.379,0.5,1.0]-}
{-startTheta = U.replicate n 0.5-}
{-newks = fillKentries uvals ks startTheta-}
{-stripG = componentsOf . last . take 10.iterate stripTransNodes $ kmapToStateGraph newks-}
{-stripNodes = map (U.fromList.sort.nodes) stripG-}
{-startAtracs = runAndSplit args newks stripNodes-}
{-norms = normSum startAtracs ms-}
{-emdat = EMData startAtracs ks stripG stripNodes norms args ms uvals-}
{-mapt = map (U.fromList.map fromIntegral.dec2bin n) [0..2^n-1]-}
{---mapt = map (U.replicate n) [0,0.1,0.9,1.0]-}
{---mapt = map (U.fromList) [replicate n 0.0, replicate n 0.001]-}
{---prVal = map (expectationRun emdat) mapt-}
{-prVal = map (posteriorProb emdat) mapt -}
{-prVal2 = map (expectationRun emdat) mapt -}
{-elOpt = optimize (expectationRun emdat) (U.replicate n 0.5) -}
{-path = fullEM emdat 10 startTheta-}
{-xs = clamped [0,0.05..1]-}
{-clamped xs = map (\x-> if (x>1.0) then 1.0 else (if (x<0.0) then 0.0 else x)) xs-}
{-printSeg :: String -> String -> IO ()-}
{-printSeg title st = do-}
{-let l = 2 + length title-}
{-upperTitle = map toUpper title-}
{-width = 80-}
{-half = (width-l) `div` 2-}
{-stars = replicate half '*'-}
{-printf "\n%s %s %s\n\n%s\n\n%s\n\n" stars upperTitle stars st (replicate width '*')-}
--print n
--forM_ mapt $ \t -> do
-- let path = fullEM emdat 10 t
{-printSeg "theta path" (printList.map (\(t,e)->t) $ path)-}
{-printSeg "posterior probs" (printList.map (\(t,e)->posteriorProb e t) $ path)-}
{---printSeg "attractors" (concatMap (printf "%7s".map intToDigit.dec2bin ng.G.head) stripNodes)-}
{-printSeg "attractors" (concatMap (printf "%7d".G.head) stripNodes)-}
{-print $ M.keys ks-}
{---printf "%d Evaluations\n" ((length xs)^2)-}
{-plotFunc3d [XLabel "X", YLabel "Y", XRange (0,1), YRange (0,1)] [] xs xs -}
{-(\x y -> (-1)*(expectationRun emdat (U.fromList [0.5,x,y])))-}
{---putStrLn "Expectations:"-}
{---mapM_ (printf "%7.3f") prVal2-}
{---putStrLn ""-}
{---print elOpt-}
{---putStrLn "Posterior Probs:"-}
{---mapM_ (sequence.printList.U.fromList.sort.U.toList) prVal-}
{---putStrLn ""-}
{---mapM_ (printf "%5.2f") (map U.sum prVal)-}
{---putStrLn ""-}
{---putStrLn ""-}
{---putStrLn ""-}
{---print $ generateNewAttractors args ks stripNodes uvals (last mapt)-}
{----}
{---putStrLn ""-}
{---putStrLn "Expectations:"-}
{---mapM_ (printf "%7.3f\n") prVal2-}
{---putStrLn ""-}
{---putStrLn ""-}
{---putStrLn ""-}
{---putStrLn "**** Optimal Posterior Probs ****"-}
{---mapM_ (sequence.printList) [posteriorProb emdat elOpt]-}
{---mapM_ (printf "%7.3d".(U.head)) stripNodes-}
{---putStrLn ""-}
{---putStrLn "*********************************"-}
{----}
{---putStrLn ""-}
{---printf "Optimal Expectation: %5.2f\n" (expectationRun emdat elOpt)-}
{---putStrLn ""-}
{---putStrLn "**** Optimal Theta ****"-}
{---mapM_ (sequence.printList) [elOpt]-}
{-printSeg "uncertain locs" (show uvals)-}
{-printSeg "measurements" (show ms)-}
{-when gen $ do-}
{-let newks2 = fillKentries uvals ks (fst.last $ path)-}
{-finalGraph = simulate args $ kmapToStateGraph newks2-}
{-stripG2 = componentsOf . last . take 10.iterate stripTransNodes $ finalGraph-}
{-stripNodes2 = map (U.fromList.sort.nodes) stripG2-}
{-printSeg "final attractors" (concatMap (printf "%7d".G.head) stripNodes2)-}
{-drawStateGraph finalGraph args-}
{---let newks2 = fillKentries uvals ks (fst.head $ path)-}
{--- interGraph = kmapToStateGraph newks2-}
{--- ssd = simulateDOK args $ kmapToDOK newks2-}
{----- WATCH OUT TODO I just found a huge bug: StateTransition.simulate does-}
{----- not respect edge weights when moving probabilities around-} | 5,786 | false | true | 0 | 10 | 1,201 | 279 | 198 | 81 | null | null |
zinfra/khan | amazonka-limited/src/Network/AWS/Internal/Types.hs | mpl-2.0 | secretAccessKey :: Auth -> ByteString
secretAccessKey = Text.encodeUtf8 . authSecretAccessKey | 93 | secretAccessKey :: Auth -> ByteString
secretAccessKey = Text.encodeUtf8 . authSecretAccessKey | 93 | secretAccessKey = Text.encodeUtf8 . authSecretAccessKey | 55 | false | true | 0 | 7 | 9 | 28 | 12 | 16 | null | null |
tolysz/prepare-ghcjs | spec-lts8/aeson/tests/Encoders.hs | bsd-3-clause | thSomeTypeToJSONObjectWithSingleField :: SomeType Int -> Value
thSomeTypeToJSONObjectWithSingleField = $(mkToJSON optsObjectWithSingleField ''SomeType) | 151 | thSomeTypeToJSONObjectWithSingleField :: SomeType Int -> Value
thSomeTypeToJSONObjectWithSingleField = $(mkToJSON optsObjectWithSingleField ''SomeType) | 151 | thSomeTypeToJSONObjectWithSingleField = $(mkToJSON optsObjectWithSingleField ''SomeType) | 88 | false | true | 0 | 8 | 10 | 29 | 14 | 15 | null | null |
vTurbine/ghc | compiler/main/Packages.hs | bsd-3-clause | -- | Find all the link options in these and the preload packages,
-- returning (package hs lib options, extra library options, other flags)
getPackageLinkOpts :: DynFlags -> [UnitId] -> IO ([String], [String], [String])
getPackageLinkOpts dflags pkgs =
collectLinkOpts dflags `fmap` getPreloadPackagesAnd dflags pkgs | 318 | getPackageLinkOpts :: DynFlags -> [UnitId] -> IO ([String], [String], [String])
getPackageLinkOpts dflags pkgs =
collectLinkOpts dflags `fmap` getPreloadPackagesAnd dflags pkgs | 178 | getPackageLinkOpts dflags pkgs =
collectLinkOpts dflags `fmap` getPreloadPackagesAnd dflags pkgs | 98 | true | true | 0 | 9 | 45 | 64 | 36 | 28 | null | null |
CarmineM74/haskell_craft3e | ExChap7.hs | mit | -- Guard order is relevant since a subsequence has stricter requirements
-- than a sublist. A subsequence is also a sublist but not vice versa.
sublistOrSubsequence :: String -> String -> Subkind
sublistOrSubsequence s1 s2
| subsequence s1 s2 = Subsequence
| sublist s1 s2 = Sublist
| otherwise = Neither | 323 | sublistOrSubsequence :: String -> String -> Subkind
sublistOrSubsequence s1 s2
| subsequence s1 s2 = Subsequence
| sublist s1 s2 = Sublist
| otherwise = Neither | 179 | sublistOrSubsequence s1 s2
| subsequence s1 s2 = Subsequence
| sublist s1 s2 = Sublist
| otherwise = Neither | 126 | true | true | 2 | 8 | 69 | 57 | 28 | 29 | null | null |
phischu/fragnix | tests/packages/scotty/Data.Vector.Storable.Mutable.hs | bsd-3-clause | unsafeToForeignPtr0 (MVector n fp) = (fp, n) | 44 | unsafeToForeignPtr0 (MVector n fp) = (fp, n) | 44 | unsafeToForeignPtr0 (MVector n fp) = (fp, n) | 44 | false | false | 0 | 6 | 6 | 24 | 12 | 12 | null | null |
NICTA/validation | examples/src/PolymorphicEmail.hs | bsd-3-clause | -- Failure [MustContainPeriod]
failureAll :: (Applicative (f [VError]), Validate f) => f [VError] Email
failureAll = email "" | 126 | failureAll :: (Applicative (f [VError]), Validate f) => f [VError] Email
failureAll = email "" | 94 | failureAll = email "" | 21 | true | true | 0 | 9 | 18 | 47 | 25 | 22 | null | null |
haskell/haddock | haddock-library/src/Documentation/Haddock/Parser.hs | bsd-2-clause | innerList :: Text -> Parser [DocH mod Identifier]
-> Parser [DocH mod Identifier]
innerList indent item = do
c <- takeLine
(cs, items) <- more indent item
let contents = docParagraph . parseText . dropNLs . T.unlines $ c : cs
return $ case items of
Left p -> [contents `docAppend` p]
Right i -> contents : i
-- | Parses definition lists. | 364 | innerList :: Text -> Parser [DocH mod Identifier]
-> Parser [DocH mod Identifier]
innerList indent item = do
c <- takeLine
(cs, items) <- more indent item
let contents = docParagraph . parseText . dropNLs . T.unlines $ c : cs
return $ case items of
Left p -> [contents `docAppend` p]
Right i -> contents : i
-- | Parses definition lists. | 364 | innerList indent item = do
c <- takeLine
(cs, items) <- more indent item
let contents = docParagraph . parseText . dropNLs . T.unlines $ c : cs
return $ case items of
Left p -> [contents `docAppend` p]
Right i -> contents : i
-- | Parses definition lists. | 272 | false | true | 0 | 14 | 89 | 145 | 71 | 74 | null | null |
twittner/cql | test/Tests.hs | mpl-2.0 | toCqlFromCqlIdentity :: Value -> Property
toCqlFromCqlIdentity x@(CqlBoolean _) = (toCql <$> (fromCql x :: Either String Bool)) === Right x | 145 | toCqlFromCqlIdentity :: Value -> Property
toCqlFromCqlIdentity x@(CqlBoolean _) = (toCql <$> (fromCql x :: Either String Bool)) === Right x | 145 | toCqlFromCqlIdentity x@(CqlBoolean _) = (toCql <$> (fromCql x :: Either String Bool)) === Right x | 103 | false | true | 0 | 9 | 25 | 55 | 28 | 27 | null | null |
pgj/bead | src/Bead/Persistence/NoSQLDir.hs | bsd-3-clause | isCommentDir :: FilePath -> Persist Bool
isCommentDir = isCorrectDirStructure commentDirStructure | 97 | isCommentDir :: FilePath -> Persist Bool
isCommentDir = isCorrectDirStructure commentDirStructure | 97 | isCommentDir = isCorrectDirStructure commentDirStructure | 56 | false | true | 0 | 6 | 9 | 21 | 10 | 11 | null | null |
atomb/dalvik | Dalvik/Printer.hs | bsd-3-clause | constString _ (ConstWideHigh16 i) =
"#long " +++ A.int64Dec i +++
intComm16 (fromIntegral (i `shiftR` 48) :: Word16) | 120 | constString _ (ConstWideHigh16 i) =
"#long " +++ A.int64Dec i +++
intComm16 (fromIntegral (i `shiftR` 48) :: Word16) | 120 | constString _ (ConstWideHigh16 i) =
"#long " +++ A.int64Dec i +++
intComm16 (fromIntegral (i `shiftR` 48) :: Word16) | 120 | false | false | 5 | 9 | 21 | 56 | 26 | 30 | null | null |
peterokagey/haskellOEIS | src/Helpers/Table.hs | apache-2.0 | -- 0 <= k <= n
-- triangleByRows 0 = (0, 0)
-- [(0,0),(1,0),(1,1),(2,0),(2,1),(2,2),(3,0),(3,1),(3,2),(3,3),(4,0)]
-- Triangle by rows
triangleByRows :: Integral a => a -> (a, a)
triangleByRows i = (n + k, k) where
(n, k) = tableByAntidiagonals i
-- (0,0),(1,0),(0,1),(2,0),(1,1),(0,2),(3,0),(2,1),(1,2),(0,3)
--------------------------------------------------------------
-- (0,0),(0,1),(0,2),(0,3)
-- (1,0),(1,1),(1,2)
-- (2,0),(2,1)
-- (3,0) | 447 | triangleByRows :: Integral a => a -> (a, a)
triangleByRows i = (n + k, k) where
(n, k) = tableByAntidiagonals i
-- (0,0),(1,0),(0,1),(2,0),(1,1),(0,2),(3,0),(2,1),(1,2),(0,3)
--------------------------------------------------------------
-- (0,0),(0,1),(0,2),(0,3)
-- (1,0),(1,1),(1,2)
-- (2,0),(2,1)
-- (3,0) | 312 | triangleByRows i = (n + k, k) where
(n, k) = tableByAntidiagonals i
-- (0,0),(1,0),(0,1),(2,0),(1,1),(0,2),(3,0),(2,1),(1,2),(0,3)
--------------------------------------------------------------
-- (0,0),(0,1),(0,2),(0,3)
-- (1,0),(1,1),(1,2)
-- (2,0),(2,1)
-- (3,0) | 268 | true | true | 0 | 9 | 53 | 73 | 42 | 31 | null | null |
5outh/graphql-hs | src/GraphQL/Language/Parser.hs | mit | condense (CV_EscapedChar c:xs) = '\\':c:condense xs | 51 | condense (CV_EscapedChar c:xs) = '\\':c:condense xs | 51 | condense (CV_EscapedChar c:xs) = '\\':c:condense xs | 51 | false | false | 0 | 7 | 5 | 31 | 14 | 17 | null | null |
green-haskell/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | -- other GHC.Float functions
rationalToFloatName, rationalToDoubleName :: Name
rationalToFloatName = varQual gHC_FLOAT (fsLit "rationalToFloat") rationalToFloatIdKey | 166 | rationalToFloatName, rationalToDoubleName :: Name
rationalToFloatName = varQual gHC_FLOAT (fsLit "rationalToFloat") rationalToFloatIdKey | 137 | rationalToFloatName = varQual gHC_FLOAT (fsLit "rationalToFloat") rationalToFloatIdKey | 87 | true | true | 0 | 7 | 15 | 27 | 15 | 12 | null | null |
zarazek/concurrency-simulator | Concurrency/Simulator.hs | bsd-3-clause | newFullWMVar :: IORef Int -> a -> IO (WMVar a)
newFullWMVar next val = WMVar <$> newMVar val <*> getNextIdx next | 112 | newFullWMVar :: IORef Int -> a -> IO (WMVar a)
newFullWMVar next val = WMVar <$> newMVar val <*> getNextIdx next | 112 | newFullWMVar next val = WMVar <$> newMVar val <*> getNextIdx next | 65 | false | true | 0 | 9 | 20 | 50 | 23 | 27 | null | null |
siddhanathan/ghc | compiler/utils/Encoding.hs | bsd-3-clause | unPtr :: Ptr a -> Addr#
unPtr (Ptr a) = a | 41 | unPtr :: Ptr a -> Addr#
unPtr (Ptr a) = a | 41 | unPtr (Ptr a) = a | 17 | false | true | 0 | 9 | 10 | 33 | 14 | 19 | null | null |
rvion/lamdu | bottlelib/Graphics/UI/Bottle/Widgets/Layout.hs | gpl-3.0 | internalToAlignedWidget :: LayoutInternal f -> AlignedWidget f
internalToAlignedWidget (LayoutSingleton widget) = widget | 120 | internalToAlignedWidget :: LayoutInternal f -> AlignedWidget f
internalToAlignedWidget (LayoutSingleton widget) = widget | 120 | internalToAlignedWidget (LayoutSingleton widget) = widget | 57 | false | true | 0 | 7 | 11 | 30 | 14 | 16 | null | null |
DaMSL/K3 | src/Language/K3/Transform/Simplification.hs | apache-2.0 | inferAccumulation :: Identifier -> K3 Expression -> Bool
inferAccumulation i expr = fst $ mapAccumulation annotationAccumE id i expr
where annotationAccumE e = e @+ (inferredEProp "Accumulation" Nothing) | 205 | inferAccumulation :: Identifier -> K3 Expression -> Bool
inferAccumulation i expr = fst $ mapAccumulation annotationAccumE id i expr
where annotationAccumE e = e @+ (inferredEProp "Accumulation" Nothing) | 205 | inferAccumulation i expr = fst $ mapAccumulation annotationAccumE id i expr
where annotationAccumE e = e @+ (inferredEProp "Accumulation" Nothing) | 148 | false | true | 0 | 7 | 29 | 62 | 30 | 32 | null | null |
jaspervdj/what-morphism | src/WhatMorphism/Build.hs | bsd-3-clause | --------------------------------------------------------------------------------
emptyBuildState :: BuildState
emptyBuildState = BuildState Nothing | 147 | emptyBuildState :: BuildState
emptyBuildState = BuildState Nothing | 66 | emptyBuildState = BuildState Nothing | 36 | true | true | 0 | 5 | 7 | 15 | 8 | 7 | null | null |
DimaSamoz/mezzo | examples/src/Other/Bach.hs | mit | concV3 = c__ wn :|: c__ wn | 26 | concV3 = c__ wn :|: c__ wn | 26 | concV3 = c__ wn :|: c__ wn | 26 | false | false | 4 | 5 | 6 | 23 | 9 | 14 | null | null |
Zoetermeer/latro | src/Latro/Ast.hs | mit | fieldAccessorFunId :: RawId -> RawId -> RawId
fieldAccessorFunId tyId accId = "@" ++ tyId ++ "_" ++ accId | 105 | fieldAccessorFunId :: RawId -> RawId -> RawId
fieldAccessorFunId tyId accId = "@" ++ tyId ++ "_" ++ accId | 105 | fieldAccessorFunId tyId accId = "@" ++ tyId ++ "_" ++ accId | 59 | false | true | 0 | 7 | 17 | 36 | 18 | 18 | null | null |
jraygauthier/jrg-gitit-plugins | src/Network/Gitit/Plugins/ImgTex.hs | gpl-2.0 | templateFooter =
"\n"
++ "\\]\n"
++ "\\end{document}\n" | 73 | templateFooter =
"\n"
++ "\\]\n"
++ "\\end{document}\n" | 73 | templateFooter =
"\n"
++ "\\]\n"
++ "\\end{document}\n" | 73 | false | false | 0 | 6 | 24 | 14 | 7 | 7 | null | null |
torrlane/haskell_learning | test/Hl/Csv/ModelSpec.hs | bsd-3-clause | shareHoldingTests :: Test
shareHoldingTests = testGroup "ShareHoldingTests" [
testCase "testParseShareHoldingRecord" testParseShareHoldingRecord
, testCase "parseShareHolding2" testParseShareHolding2
, testCase "test_getShareName_from_csvLine" test_getShareName_from_csvLine
, testCase "testParseShareHolding3" testParseShareHolding3
] | 361 | shareHoldingTests :: Test
shareHoldingTests = testGroup "ShareHoldingTests" [
testCase "testParseShareHoldingRecord" testParseShareHoldingRecord
, testCase "parseShareHolding2" testParseShareHolding2
, testCase "test_getShareName_from_csvLine" test_getShareName_from_csvLine
, testCase "testParseShareHolding3" testParseShareHolding3
] | 361 | shareHoldingTests = testGroup "ShareHoldingTests" [
testCase "testParseShareHoldingRecord" testParseShareHoldingRecord
, testCase "parseShareHolding2" testParseShareHolding2
, testCase "test_getShareName_from_csvLine" test_getShareName_from_csvLine
, testCase "testParseShareHolding3" testParseShareHolding3
] | 335 | false | true | 0 | 7 | 49 | 54 | 25 | 29 | null | null |
Ginto8/Pong-Haskell | src/Game/Pong/Core.hs | bsd-3-clause | randBallVel :: (Random a,Floating a) =>
Vec2 a -> StdGen -> (Vec2 a,StdGen)
randBallVel v r = (v .*. (x,y),r3)
where
x = if flip then negate x' else x'
(x',y) = polarVec mag theta
(flip,r3) = random r2
(theta,r2) = randomR (-pi/4,pi/4) r1
(mag,r1) = randomR (0.2,0.4) r -- (0.2,0.4) r | 344 | randBallVel :: (Random a,Floating a) =>
Vec2 a -> StdGen -> (Vec2 a,StdGen)
randBallVel v r = (v .*. (x,y),r3)
where
x = if flip then negate x' else x'
(x',y) = polarVec mag theta
(flip,r3) = random r2
(theta,r2) = randomR (-pi/4,pi/4) r1
(mag,r1) = randomR (0.2,0.4) r -- (0.2,0.4) r | 344 | randBallVel v r = (v .*. (x,y),r3)
where
x = if flip then negate x' else x'
(x',y) = polarVec mag theta
(flip,r3) = random r2
(theta,r2) = randomR (-pi/4,pi/4) r1
(mag,r1) = randomR (0.2,0.4) r -- (0.2,0.4) r | 253 | false | true | 1 | 11 | 111 | 183 | 96 | 87 | null | null |
jdreaver/quantities | library/Data/Quantities/ExprParser.hs | bsd-3-clause | prefixParser' :: Definitions -> Parser String
prefixParser' d = do
pr <- choice $ map (try . string) (prefixes d)
_ <- choice $ map (try . string) (unitsList d)
return pr
-- | Converts string to a Quantity using an expression grammar parser. This
-- parser does not parser addition or subtraction, and is used for unit
-- definitions. | 342 | prefixParser' :: Definitions -> Parser String
prefixParser' d = do
pr <- choice $ map (try . string) (prefixes d)
_ <- choice $ map (try . string) (unitsList d)
return pr
-- | Converts string to a Quantity using an expression grammar parser. This
-- parser does not parser addition or subtraction, and is used for unit
-- definitions. | 342 | prefixParser' d = do
pr <- choice $ map (try . string) (prefixes d)
_ <- choice $ map (try . string) (unitsList d)
return pr
-- | Converts string to a Quantity using an expression grammar parser. This
-- parser does not parser addition or subtraction, and is used for unit
-- definitions. | 296 | false | true | 0 | 12 | 67 | 93 | 44 | 49 | null | null |
uduki/hsQt | Qtc/Enums/Gui/QAbstractItemView.hs | bsd-2-clause | fEditKeyPressed :: EditTriggers
fEditKeyPressed
= ifEditTriggers $ 8 | 70 | fEditKeyPressed :: EditTriggers
fEditKeyPressed
= ifEditTriggers $ 8 | 70 | fEditKeyPressed
= ifEditTriggers $ 8 | 38 | false | true | 0 | 6 | 9 | 18 | 8 | 10 | null | null |
innovimax/bond | compiler/Bond/Template/Cs/Util.hs | mit | defaultValue :: MappingContext -> Field -> Maybe Text
defaultValue cs Field {fieldDefault = Nothing, ..} = implicitDefault fieldType
where
newInstance t = Just [lt|new #{getInstanceTypeName cs t}()|]
implicitDefault BT_String = Just "string.Empty"
implicitDefault BT_WString = Just "string.Empty"
implicitDefault (BT_Bonded t) = Just [lt|global::Bond.Bonded<#{getTypeName cs t}>.Empty|]
implicitDefault t@(BT_TypeParam _) = Just [lt|global::Bond.GenericFactory.Create<#{getInstanceTypeName cs t}>()|]
implicitDefault t@(BT_List _) = newInstance t
implicitDefault t@(BT_Vector _) = newInstance t
implicitDefault t@(BT_Set _) = newInstance t
implicitDefault t@(BT_Map _ _) = newInstance t
implicitDefault t@BT_Blob = newInstance t
implicitDefault t@(BT_UserDefined a@Alias {..} args) =
case findAliasMapping cs a of
Nothing -> implicitDefault $ resolveAlias a args
Just _ -> newInstance t
implicitDefault t@(BT_UserDefined _ _) = newInstance t
implicitDefault _ = Nothing | 1,122 | defaultValue :: MappingContext -> Field -> Maybe Text
defaultValue cs Field {fieldDefault = Nothing, ..} = implicitDefault fieldType
where
newInstance t = Just [lt|new #{getInstanceTypeName cs t}()|]
implicitDefault BT_String = Just "string.Empty"
implicitDefault BT_WString = Just "string.Empty"
implicitDefault (BT_Bonded t) = Just [lt|global::Bond.Bonded<#{getTypeName cs t}>.Empty|]
implicitDefault t@(BT_TypeParam _) = Just [lt|global::Bond.GenericFactory.Create<#{getInstanceTypeName cs t}>()|]
implicitDefault t@(BT_List _) = newInstance t
implicitDefault t@(BT_Vector _) = newInstance t
implicitDefault t@(BT_Set _) = newInstance t
implicitDefault t@(BT_Map _ _) = newInstance t
implicitDefault t@BT_Blob = newInstance t
implicitDefault t@(BT_UserDefined a@Alias {..} args) =
case findAliasMapping cs a of
Nothing -> implicitDefault $ resolveAlias a args
Just _ -> newInstance t
implicitDefault t@(BT_UserDefined _ _) = newInstance t
implicitDefault _ = Nothing | 1,122 | defaultValue cs Field {fieldDefault = Nothing, ..} = implicitDefault fieldType
where
newInstance t = Just [lt|new #{getInstanceTypeName cs t}()|]
implicitDefault BT_String = Just "string.Empty"
implicitDefault BT_WString = Just "string.Empty"
implicitDefault (BT_Bonded t) = Just [lt|global::Bond.Bonded<#{getTypeName cs t}>.Empty|]
implicitDefault t@(BT_TypeParam _) = Just [lt|global::Bond.GenericFactory.Create<#{getInstanceTypeName cs t}>()|]
implicitDefault t@(BT_List _) = newInstance t
implicitDefault t@(BT_Vector _) = newInstance t
implicitDefault t@(BT_Set _) = newInstance t
implicitDefault t@(BT_Map _ _) = newInstance t
implicitDefault t@BT_Blob = newInstance t
implicitDefault t@(BT_UserDefined a@Alias {..} args) =
case findAliasMapping cs a of
Nothing -> implicitDefault $ resolveAlias a args
Just _ -> newInstance t
implicitDefault t@(BT_UserDefined _ _) = newInstance t
implicitDefault _ = Nothing | 1,068 | false | true | 0 | 13 | 269 | 316 | 161 | 155 | null | null |
dpwright/z80 | src/Z80/Operands/LowerCase.hs | mit | nz = NZ | 8 | nz = NZ | 8 | nz = NZ | 8 | false | false | 1 | 5 | 3 | 10 | 3 | 7 | null | null |
goldfirere/singletons | singletons-base/src/Data/Bool/Singletons.hs | bsd-3-clause | sIf :: Sing a -> Sing b -> Sing c -> Sing (If a b c)
sIf STrue b _ = b | 70 | sIf :: Sing a -> Sing b -> Sing c -> Sing (If a b c)
sIf STrue b _ = b | 70 | sIf STrue b _ = b | 17 | false | true | 0 | 11 | 21 | 57 | 25 | 32 | null | null |
mrakgr/futhark | src/Futhark/Internalise.hs | bsd-3-clause | internaliseExp desc (E.LetWith name src idxs ve body loc) = do
idxs' <- mapM (internaliseExp1 "idx") idxs
srcs <- internaliseExpToVars "src" $ E.Var src
ves <- internaliseExp "lw_val" ve
idxcs' <- boundsChecks loc srcs idxs'
let comb sname ve' = do
rowtype <- I.stripArray (length idxs) <$> lookupType sname
ve'' <- ensureShape asserting loc rowtype "lw_val_correct_shape" ve'
letInPlace "letwith_dst" idxcs' sname idxs' $
PrimOp $ SubExp ve''
dsts <- zipWithM comb srcs ves
dstt <- I.staticShapes <$> mapM lookupType dsts
bindingPattern (E.Id name) dstt $ \pat' -> do
forM_ (zip (patternIdents pat') dsts) $ \(p,dst) ->
letBind (basicPattern' [] [p]) $ I.PrimOp $ I.SubExp $ I.Var dst
internaliseExp desc body | 774 | internaliseExp desc (E.LetWith name src idxs ve body loc) = do
idxs' <- mapM (internaliseExp1 "idx") idxs
srcs <- internaliseExpToVars "src" $ E.Var src
ves <- internaliseExp "lw_val" ve
idxcs' <- boundsChecks loc srcs idxs'
let comb sname ve' = do
rowtype <- I.stripArray (length idxs) <$> lookupType sname
ve'' <- ensureShape asserting loc rowtype "lw_val_correct_shape" ve'
letInPlace "letwith_dst" idxcs' sname idxs' $
PrimOp $ SubExp ve''
dsts <- zipWithM comb srcs ves
dstt <- I.staticShapes <$> mapM lookupType dsts
bindingPattern (E.Id name) dstt $ \pat' -> do
forM_ (zip (patternIdents pat') dsts) $ \(p,dst) ->
letBind (basicPattern' [] [p]) $ I.PrimOp $ I.SubExp $ I.Var dst
internaliseExp desc body | 774 | internaliseExp desc (E.LetWith name src idxs ve body loc) = do
idxs' <- mapM (internaliseExp1 "idx") idxs
srcs <- internaliseExpToVars "src" $ E.Var src
ves <- internaliseExp "lw_val" ve
idxcs' <- boundsChecks loc srcs idxs'
let comb sname ve' = do
rowtype <- I.stripArray (length idxs) <$> lookupType sname
ve'' <- ensureShape asserting loc rowtype "lw_val_correct_shape" ve'
letInPlace "letwith_dst" idxcs' sname idxs' $
PrimOp $ SubExp ve''
dsts <- zipWithM comb srcs ves
dstt <- I.staticShapes <$> mapM lookupType dsts
bindingPattern (E.Id name) dstt $ \pat' -> do
forM_ (zip (patternIdents pat') dsts) $ \(p,dst) ->
letBind (basicPattern' [] [p]) $ I.PrimOp $ I.SubExp $ I.Var dst
internaliseExp desc body | 774 | false | false | 0 | 19 | 173 | 309 | 141 | 168 | null | null |
dorchard/camfort | src/Camfort/Output.hs | apache-2.0 | refactorBlocks v inp (F.BlStatement _ _ _ s@F.StEquivalence{}) =
refactorStatements v inp s | 95 | refactorBlocks v inp (F.BlStatement _ _ _ s@F.StEquivalence{}) =
refactorStatements v inp s | 95 | refactorBlocks v inp (F.BlStatement _ _ _ s@F.StEquivalence{}) =
refactorStatements v inp s | 95 | false | false | 0 | 10 | 16 | 43 | 21 | 22 | null | null |
michaeljklein/CPlug | test/Scratch.hs | bsd-3-clause | t1 :: Int -> Wrapped (Int -> Int) Int
t1 x = defWrap $ u x | 58 | t1 :: Int -> Wrapped (Int -> Int) Int
t1 x = defWrap $ u x | 58 | t1 x = defWrap $ u x | 20 | false | true | 0 | 8 | 15 | 37 | 18 | 19 | null | null |
GaloisInc/saw-script | rme/src/Data/RME/Base.hs | bsd-3-clause | allsat (Node n a b) =
map ((n, False) :) (allsat a) ++ map ((n, True) :) (allsat (xor a b)) | 93 | allsat (Node n a b) =
map ((n, False) :) (allsat a) ++ map ((n, True) :) (allsat (xor a b)) | 93 | allsat (Node n a b) =
map ((n, False) :) (allsat a) ++ map ((n, True) :) (allsat (xor a b)) | 93 | false | false | 2 | 9 | 22 | 76 | 39 | 37 | null | null |
emaphis/Haskell-Practice | basebull/src/Basebull.hs | bsd-3-clause | fourth :: (a, b, c, d) -> d
fourth (_, _, _, d) = d | 51 | fourth :: (a, b, c, d) -> d
fourth (_, _, _, d) = d | 51 | fourth (_, _, _, d) = d | 23 | false | true | 0 | 6 | 14 | 46 | 26 | 20 | null | null |
izgzhen/RuScript | rusc/src/MultiplateDerive.hs | mit | lowerHead :: String -> String
lowerHead "" = "" | 47 | lowerHead :: String -> String
lowerHead "" = "" | 47 | lowerHead "" = "" | 17 | false | true | 0 | 7 | 8 | 24 | 10 | 14 | null | null |
plaimi/tempuhs-server | src/Tempuhs/Server/Requests/Permissionset.hs | agpl-3.0 | patchPermissionset :: ConnectionPool -> ActionE ()
-- | 'patchPermissionset' modifies a 'Permissionset'.
patchPermissionset p = do
ps <- paramE "permissionset"
o <- maybeParam "own"
r <- maybeParam "read"
w <- maybeParam "write"
runDatabase p $ let k = mkKey ps in liftAE . jsonKey =<< do
update k (concat [PermissionsetOwn =.. o
,PermissionsetRead =.. r
,PermissionsetWrite =.. w
])
return k | 483 | patchPermissionset :: ConnectionPool -> ActionE ()
patchPermissionset p = do
ps <- paramE "permissionset"
o <- maybeParam "own"
r <- maybeParam "read"
w <- maybeParam "write"
runDatabase p $ let k = mkKey ps in liftAE . jsonKey =<< do
update k (concat [PermissionsetOwn =.. o
,PermissionsetRead =.. r
,PermissionsetWrite =.. w
])
return k | 429 | patchPermissionset p = do
ps <- paramE "permissionset"
o <- maybeParam "own"
r <- maybeParam "read"
w <- maybeParam "write"
runDatabase p $ let k = mkKey ps in liftAE . jsonKey =<< do
update k (concat [PermissionsetOwn =.. o
,PermissionsetRead =.. r
,PermissionsetWrite =.. w
])
return k | 378 | true | true | 0 | 17 | 151 | 137 | 62 | 75 | null | null |
chengzh2008/hpffp | src/ch08-Recursion/recursionAndComposition.hs | bsd-3-clause | -- control the number of recursions explicitly
incTimes :: (Eq a, Num a) => a -> a -> a
incTimes 0 n = n | 104 | incTimes :: (Eq a, Num a) => a -> a -> a
incTimes 0 n = n | 57 | incTimes 0 n = n | 16 | true | true | 0 | 7 | 23 | 40 | 21 | 19 | null | null |
kojiromike/Idris-dev | src/Idris/REPL.hs | bsd-3-clause | process fn (SetConsoleWidth w) = setWidth w | 43 | process fn (SetConsoleWidth w) = setWidth w | 43 | process fn (SetConsoleWidth w) = setWidth w | 43 | false | false | 0 | 7 | 6 | 20 | 9 | 11 | null | null |
eugenkiss/loopgotowhile | src/Language/LoopGotoWhile/Shared/Extended.hs | bsd-3-clause | reservedOp :: forall st. String -> CharParser st ()
reservedOp = P.reservedOp lexer | 83 | reservedOp :: forall st. String -> CharParser st ()
reservedOp = P.reservedOp lexer | 83 | reservedOp = P.reservedOp lexer | 31 | false | true | 0 | 9 | 12 | 37 | 17 | 20 | null | null |
tjakway/ghcjvm | ghc/Main.hs | bsd-3-clause | isShowVersionMode _ = False | 27 | isShowVersionMode _ = False | 27 | isShowVersionMode _ = False | 27 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
KommuSoft/dep-software | Test.Dep.Ui.Schematics.hs | gpl-3.0 | prop_ticks_even :: Bool
prop_ticks_even = even schematicsTick | 61 | prop_ticks_even :: Bool
prop_ticks_even = even schematicsTick | 61 | prop_ticks_even = even schematicsTick | 37 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
dysinger/amazonka | amazonka-rds/gen/Network/AWS/RDS/Types.hs | mpl-2.0 | -- | Specifies the pending port for the DB instance.
pmvPort :: Lens' PendingModifiedValues (Maybe Int)
pmvPort = lens _pmvPort (\s a -> s { _pmvPort = a }) | 156 | pmvPort :: Lens' PendingModifiedValues (Maybe Int)
pmvPort = lens _pmvPort (\s a -> s { _pmvPort = a }) | 103 | pmvPort = lens _pmvPort (\s a -> s { _pmvPort = a }) | 52 | true | true | 0 | 9 | 28 | 46 | 25 | 21 | null | null |
haslab/SecreC | src/Language/SecreC/TypeChecker/Expression.hs | gpl-3.0 | tcMultisetLiteral :: (ProverK loc m) => loc -> Maybe Type -> [Expression Identifier loc] -> TcM m (Expression GIdentifier (Typed loc))
tcMultisetLiteral l ret es = do
ct@(ComplexT bt) <- newTyVar False False Nothing
let t = BaseT (MSet bt)
unifiesRet l ret t
es' <- mapM (tcExpr $ Just ct) es
let es'' = fmap (fmap typed) es'
xs <- tcCoercesN l True es'' ct
return $ MultisetConstructorPExpr (Typed l t) $ map (fmap (Typed l)) xs | 462 | tcMultisetLiteral :: (ProverK loc m) => loc -> Maybe Type -> [Expression Identifier loc] -> TcM m (Expression GIdentifier (Typed loc))
tcMultisetLiteral l ret es = do
ct@(ComplexT bt) <- newTyVar False False Nothing
let t = BaseT (MSet bt)
unifiesRet l ret t
es' <- mapM (tcExpr $ Just ct) es
let es'' = fmap (fmap typed) es'
xs <- tcCoercesN l True es'' ct
return $ MultisetConstructorPExpr (Typed l t) $ map (fmap (Typed l)) xs | 462 | tcMultisetLiteral l ret es = do
ct@(ComplexT bt) <- newTyVar False False Nothing
let t = BaseT (MSet bt)
unifiesRet l ret t
es' <- mapM (tcExpr $ Just ct) es
let es'' = fmap (fmap typed) es'
xs <- tcCoercesN l True es'' ct
return $ MultisetConstructorPExpr (Typed l t) $ map (fmap (Typed l)) xs | 327 | false | true | 0 | 13 | 110 | 225 | 103 | 122 | null | null |
phischu/fragnix | tests/packages/scotty/System.Directory.hs | bsd-3-clause | findFile :: [FilePath] -> String -> IO (Maybe FilePath)
findFile = findFileWith (\_ -> return True) | 99 | findFile :: [FilePath] -> String -> IO (Maybe FilePath)
findFile = findFileWith (\_ -> return True) | 99 | findFile = findFileWith (\_ -> return True) | 43 | false | true | 0 | 9 | 15 | 45 | 23 | 22 | null | null |
rueshyna/gogol | gogol-containerbuilder/gen/Network/Google/Resource/Cloudbuild/Projects/Triggers/Delete.hs | mpl-2.0 | -- | Creates a value of 'ProjectsTriggersDelete' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ptdXgafv'
--
-- * 'ptdUploadProtocol'
--
-- * 'ptdTriggerId'
--
-- * 'ptdPp'
--
-- * 'ptdAccessToken'
--
-- * 'ptdUploadType'
--
-- * 'ptdBearerToken'
--
-- * 'ptdProjectId'
--
-- * 'ptdCallback'
projectsTriggersDelete
:: Text -- ^ 'ptdTriggerId'
-> Text -- ^ 'ptdProjectId'
-> ProjectsTriggersDelete
projectsTriggersDelete pPtdTriggerId_ pPtdProjectId_ =
ProjectsTriggersDelete'
{ _ptdXgafv = Nothing
, _ptdUploadProtocol = Nothing
, _ptdTriggerId = pPtdTriggerId_
, _ptdPp = True
, _ptdAccessToken = Nothing
, _ptdUploadType = Nothing
, _ptdBearerToken = Nothing
, _ptdProjectId = pPtdProjectId_
, _ptdCallback = Nothing
} | 863 | projectsTriggersDelete
:: Text -- ^ 'ptdTriggerId'
-> Text -- ^ 'ptdProjectId'
-> ProjectsTriggersDelete
projectsTriggersDelete pPtdTriggerId_ pPtdProjectId_ =
ProjectsTriggersDelete'
{ _ptdXgafv = Nothing
, _ptdUploadProtocol = Nothing
, _ptdTriggerId = pPtdTriggerId_
, _ptdPp = True
, _ptdAccessToken = Nothing
, _ptdUploadType = Nothing
, _ptdBearerToken = Nothing
, _ptdProjectId = pPtdProjectId_
, _ptdCallback = Nothing
} | 484 | projectsTriggersDelete pPtdTriggerId_ pPtdProjectId_ =
ProjectsTriggersDelete'
{ _ptdXgafv = Nothing
, _ptdUploadProtocol = Nothing
, _ptdTriggerId = pPtdTriggerId_
, _ptdPp = True
, _ptdAccessToken = Nothing
, _ptdUploadType = Nothing
, _ptdBearerToken = Nothing
, _ptdProjectId = pPtdProjectId_
, _ptdCallback = Nothing
} | 367 | true | true | 0 | 8 | 176 | 112 | 74 | 38 | null | null |
sdiehl/ghc | compiler/main/HscTypes.hs | bsd-3-clause | mkCompleteMatchMap :: [CompleteMatch] -> CompleteMatchMap
mkCompleteMatchMap = extendCompleteMatchMap emptyUFM | 110 | mkCompleteMatchMap :: [CompleteMatch] -> CompleteMatchMap
mkCompleteMatchMap = extendCompleteMatchMap emptyUFM | 110 | mkCompleteMatchMap = extendCompleteMatchMap emptyUFM | 52 | false | true | 0 | 7 | 8 | 27 | 12 | 15 | null | null |
haskellbr/missingh | missingh-all/src/Data/MIME/Types.hs | mit | setStrict mtd False func = mtd{commonTypesMap = func (commonTypesMap mtd)} | 74 | setStrict mtd False func = mtd{commonTypesMap = func (commonTypesMap mtd)} | 74 | setStrict mtd False func = mtd{commonTypesMap = func (commonTypesMap mtd)} | 74 | false | false | 0 | 9 | 9 | 30 | 15 | 15 | null | null |
j5b/ps-pc | ModelChecker_test.hs | gpl-3.0 | test315 = testequality "Failed to show forall R top is true" result target $ printModel gammaModel
where result = snd $ checkInputModel gammaModel [forall_r_top] []
target = True | 189 | test315 = testequality "Failed to show forall R top is true" result target $ printModel gammaModel
where result = snd $ checkInputModel gammaModel [forall_r_top] []
target = True | 189 | test315 = testequality "Failed to show forall R top is true" result target $ printModel gammaModel
where result = snd $ checkInputModel gammaModel [forall_r_top] []
target = True | 189 | false | false | 4 | 6 | 38 | 57 | 24 | 33 | null | null |
adinapoli/memento | main/Memento/CLI.hs | mit | cli :: Parser CLI
cli = foldr1 (<|>) [mem, hangout, interactive] | 64 | cli :: Parser CLI
cli = foldr1 (<|>) [mem, hangout, interactive] | 64 | cli = foldr1 (<|>) [mem, hangout, interactive] | 46 | false | true | 0 | 6 | 10 | 30 | 17 | 13 | null | null |
mjansen/log-parser | LogParser.hs | mit | -- We assume that there was no timezone change for the log duration.
-- If there was we will get an error. As we would like to stream the
-- data, we will not know until the end.
convertLog :: Integer -> FilePath -> FilePath -> IO ()
convertLog year fileName fixedName = do
tzs <- getTimeZoneSeriesFromOlsonFile "/etc/localtime"
hIn <- openFile fileName ReadMode
hOut <- openFile fixedName WriteMode
let p = parseLocalTimeStamp tzs year
loop = do
ok <- not <$> hIsEOF hIn
when ok $ do
l <- BC.hGetLine hIn
case P.parseOnly (parseLine p) l of
Left msg -> print msg
Right (ts, machine, Nothing) -> return ()
Right (ts, machine, Just (program, pid, message)) -> do
let str = encode $ LogEntry ts machine program pid message
str' = (encode :: Int64 -> ByteString) (toEnum . fromEnum . B.length $ str)
B.hPut hOut $ B.append str' str
loop
loop
hClose hOut
hClose hIn | 1,015 | convertLog :: Integer -> FilePath -> FilePath -> IO ()
convertLog year fileName fixedName = do
tzs <- getTimeZoneSeriesFromOlsonFile "/etc/localtime"
hIn <- openFile fileName ReadMode
hOut <- openFile fixedName WriteMode
let p = parseLocalTimeStamp tzs year
loop = do
ok <- not <$> hIsEOF hIn
when ok $ do
l <- BC.hGetLine hIn
case P.parseOnly (parseLine p) l of
Left msg -> print msg
Right (ts, machine, Nothing) -> return ()
Right (ts, machine, Just (program, pid, message)) -> do
let str = encode $ LogEntry ts machine program pid message
str' = (encode :: Int64 -> ByteString) (toEnum . fromEnum . B.length $ str)
B.hPut hOut $ B.append str' str
loop
loop
hClose hOut
hClose hIn | 834 | convertLog year fileName fixedName = do
tzs <- getTimeZoneSeriesFromOlsonFile "/etc/localtime"
hIn <- openFile fileName ReadMode
hOut <- openFile fixedName WriteMode
let p = parseLocalTimeStamp tzs year
loop = do
ok <- not <$> hIsEOF hIn
when ok $ do
l <- BC.hGetLine hIn
case P.parseOnly (parseLine p) l of
Left msg -> print msg
Right (ts, machine, Nothing) -> return ()
Right (ts, machine, Just (program, pid, message)) -> do
let str = encode $ LogEntry ts machine program pid message
str' = (encode :: Int64 -> ByteString) (toEnum . fromEnum . B.length $ str)
B.hPut hOut $ B.append str' str
loop
loop
hClose hOut
hClose hIn | 779 | true | true | 0 | 27 | 308 | 308 | 145 | 163 | null | null |
bkoropoff/Idris-dev | src/Idris/Core/Elaborate.hs | bsd-3-clause | unifyGoal :: Raw -> Elab' aux ()
unifyGoal t = processTactic' (UnifyGoal t) | 75 | unifyGoal :: Raw -> Elab' aux ()
unifyGoal t = processTactic' (UnifyGoal t) | 75 | unifyGoal t = processTactic' (UnifyGoal t) | 42 | false | true | 0 | 8 | 12 | 38 | 17 | 21 | null | null |
dec9ue/jhc_copygc | src/Grin/Show.hs | gpl-2.0 | prettyExp vl (e1 :>>= v :-> e2) = align (prettyExp (pVar v) e1 <$> prettyExp vl e2) | 83 | prettyExp vl (e1 :>>= v :-> e2) = align (prettyExp (pVar v) e1 <$> prettyExp vl e2) | 83 | prettyExp vl (e1 :>>= v :-> e2) = align (prettyExp (pVar v) e1 <$> prettyExp vl e2) | 83 | false | false | 0 | 10 | 16 | 50 | 23 | 27 | null | null |
isomorphism/webgl | src/Graphics/Rendering/WebGL/Constants.hs | mit | gl_PIXEL_UNPACK_BUFFER :: GLenum
gl_PIXEL_UNPACK_BUFFER = 0x88EC | 64 | gl_PIXEL_UNPACK_BUFFER :: GLenum
gl_PIXEL_UNPACK_BUFFER = 0x88EC | 64 | gl_PIXEL_UNPACK_BUFFER = 0x88EC | 31 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
raimohanska/reactive-bacon | src/Reactive/Bacon/EventStream/Timed.hs | bsd-3-clause | sequentiallyE :: TimeDiff -> [a] -> IO (EventStream a)
sequentiallyE delay xs = timedE (map (delay,) xs) >>= return . fst | 121 | sequentiallyE :: TimeDiff -> [a] -> IO (EventStream a)
sequentiallyE delay xs = timedE (map (delay,) xs) >>= return . fst | 121 | sequentiallyE delay xs = timedE (map (delay,) xs) >>= return . fst | 66 | false | true | 0 | 10 | 20 | 59 | 30 | 29 | null | null |
mzini/TcT | source/Tct/Method/Matrix/ArcticMI.hs | gpl-3.0 | orientDirect :: P.SolverM m => Prob.Strategy -> Prob.StartTerms -> Trs.Trs -> F.Signature -> S.TheProcessor ArcticMI -> m (S.ProofOf ArcticMI)
orientDirect strat st trs sig mp = orientMatrix relativeConstraints ua st trs Trs.empty sig mp
where ua = usableArgsWhereApplicable True sig st (isUargsOn mp) strat trs | 313 | orientDirect :: P.SolverM m => Prob.Strategy -> Prob.StartTerms -> Trs.Trs -> F.Signature -> S.TheProcessor ArcticMI -> m (S.ProofOf ArcticMI)
orientDirect strat st trs sig mp = orientMatrix relativeConstraints ua st trs Trs.empty sig mp
where ua = usableArgsWhereApplicable True sig st (isUargsOn mp) strat trs | 313 | orientDirect strat st trs sig mp = orientMatrix relativeConstraints ua st trs Trs.empty sig mp
where ua = usableArgsWhereApplicable True sig st (isUargsOn mp) strat trs | 170 | false | true | 1 | 14 | 46 | 126 | 58 | 68 | null | null |
urbanslug/ghc | compiler/main/HscMain.hs | bsd-3-clause | hscParseStmt :: String -> Hsc (Maybe (GhciLStmt RdrName))
hscParseStmt = hscParseThing parseStmt | 96 | hscParseStmt :: String -> Hsc (Maybe (GhciLStmt RdrName))
hscParseStmt = hscParseThing parseStmt | 96 | hscParseStmt = hscParseThing parseStmt | 38 | false | true | 0 | 11 | 11 | 38 | 17 | 21 | null | null |
yu-i9/thih | src/Thih/TI/Pat.hs | bsd-3-clause | tiPat (PCon (i:>:sc) pats) = do (ps,as,ts) <- tiPats pats
t' <- newTVar Star
(qs :=> t) <- freshInst sc
unify t (foldr fn t' ts)
return (ps++qs, as, t') | 288 | tiPat (PCon (i:>:sc) pats) = do (ps,as,ts) <- tiPats pats
t' <- newTVar Star
(qs :=> t) <- freshInst sc
unify t (foldr fn t' ts)
return (ps++qs, as, t') | 288 | tiPat (PCon (i:>:sc) pats) = do (ps,as,ts) <- tiPats pats
t' <- newTVar Star
(qs :=> t) <- freshInst sc
unify t (foldr fn t' ts)
return (ps++qs, as, t') | 288 | false | false | 0 | 9 | 165 | 108 | 52 | 56 | null | null |
fmapfmapfmap/amazonka | amazonka-glacier/gen/Network/AWS/Glacier/CreateVault.hs | mpl-2.0 | -- | Creates a value of 'CreateVaultResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'cvrsLocation'
--
-- * 'cvrsResponseStatus'
createVaultResponse
:: Int -- ^ 'cvrsResponseStatus'
-> CreateVaultResponse
createVaultResponse pResponseStatus_ =
CreateVaultResponse'
{ _cvrsLocation = Nothing
, _cvrsResponseStatus = pResponseStatus_
} | 451 | createVaultResponse
:: Int -- ^ 'cvrsResponseStatus'
-> CreateVaultResponse
createVaultResponse pResponseStatus_ =
CreateVaultResponse'
{ _cvrsLocation = Nothing
, _cvrsResponseStatus = pResponseStatus_
} | 228 | createVaultResponse pResponseStatus_ =
CreateVaultResponse'
{ _cvrsLocation = Nothing
, _cvrsResponseStatus = pResponseStatus_
} | 144 | true | true | 0 | 7 | 82 | 49 | 28 | 21 | null | null |
byorgey/stackage | Stackage/ServerFiles.hs | mit | createHackageFile :: Bool -- ^ inclusive?
-> InstallInfo
-> String -- ^ GHC version
-> String -- ^ date
-> Handle -- ^ hackage
-> Handle -- ^ tarballs
-> IO ()
createHackageFile isInc ii ghcVer date hackageH tarballH = do
let stackageFP = concat
[ "../ghc-"
, ghcVer
, "-"
, date
, if isInc then "-inclusive" else "-exclusive"
, ".stackage"
]
hPutStr tarballH $ concat
[ "#!/bin/bash -ex\n\ntar czfv "
, stackageFP
, " hackage desc"
]
indextargz <- getTarballName
indexLBS <- L.readFile indextargz
loop $ Tar.read indexLBS
hPutStrLn tarballH ""
hPutStrLn tarballH $ concat
[ "runghc ../stackage-upload.hs "
, stackageFP
, " unstable-ghc"
, filter (/= '.') ghcVer
, if isInc then "-inclusive" else "-exclusive"
]
where
selected = Map.fromList . map toStrs . Map.toList $
fmap spiVersion (iiPackages ii)
`Map.union` iiOptionalCore ii
`Map.union` Map.mapMaybe id (iiCore ii)
toStrs (PackageName name, version) = (name, display version)
loop Tar.Done = return ()
loop (Tar.Fail e) = throwIO e
loop (Tar.Next e es) = go e >> loop es
go e =
case parsePair $ Tar.entryPath e of
Nothing -> return ()
Just (name, version) ->
case Map.lookup name selected of
Just version'
| version == version' -> emit True name version
| otherwise -> return ()
Nothing
| isInc -> emit False name version
| otherwise -> return ()
emit usePatch name version = do
exists <- if usePatch then doesFileExist tarball else return False
if exists
then hPutStr tarballH $ ' ' : ".." </> tarball
else hPutStrLn hackageH base
where
base = concat [name, "-", version]
tarball = "patching" </> "tarballs" </> base <.> "tar" <.> "gz" | 2,232 | createHackageFile :: Bool -- ^ inclusive?
-> InstallInfo
-> String -- ^ GHC version
-> String -- ^ date
-> Handle -- ^ hackage
-> Handle -- ^ tarballs
-> IO ()
createHackageFile isInc ii ghcVer date hackageH tarballH = do
let stackageFP = concat
[ "../ghc-"
, ghcVer
, "-"
, date
, if isInc then "-inclusive" else "-exclusive"
, ".stackage"
]
hPutStr tarballH $ concat
[ "#!/bin/bash -ex\n\ntar czfv "
, stackageFP
, " hackage desc"
]
indextargz <- getTarballName
indexLBS <- L.readFile indextargz
loop $ Tar.read indexLBS
hPutStrLn tarballH ""
hPutStrLn tarballH $ concat
[ "runghc ../stackage-upload.hs "
, stackageFP
, " unstable-ghc"
, filter (/= '.') ghcVer
, if isInc then "-inclusive" else "-exclusive"
]
where
selected = Map.fromList . map toStrs . Map.toList $
fmap spiVersion (iiPackages ii)
`Map.union` iiOptionalCore ii
`Map.union` Map.mapMaybe id (iiCore ii)
toStrs (PackageName name, version) = (name, display version)
loop Tar.Done = return ()
loop (Tar.Fail e) = throwIO e
loop (Tar.Next e es) = go e >> loop es
go e =
case parsePair $ Tar.entryPath e of
Nothing -> return ()
Just (name, version) ->
case Map.lookup name selected of
Just version'
| version == version' -> emit True name version
| otherwise -> return ()
Nothing
| isInc -> emit False name version
| otherwise -> return ()
emit usePatch name version = do
exists <- if usePatch then doesFileExist tarball else return False
if exists
then hPutStr tarballH $ ' ' : ".." </> tarball
else hPutStrLn hackageH base
where
base = concat [name, "-", version]
tarball = "patching" </> "tarballs" </> base <.> "tar" <.> "gz" | 2,232 | createHackageFile isInc ii ghcVer date hackageH tarballH = do
let stackageFP = concat
[ "../ghc-"
, ghcVer
, "-"
, date
, if isInc then "-inclusive" else "-exclusive"
, ".stackage"
]
hPutStr tarballH $ concat
[ "#!/bin/bash -ex\n\ntar czfv "
, stackageFP
, " hackage desc"
]
indextargz <- getTarballName
indexLBS <- L.readFile indextargz
loop $ Tar.read indexLBS
hPutStrLn tarballH ""
hPutStrLn tarballH $ concat
[ "runghc ../stackage-upload.hs "
, stackageFP
, " unstable-ghc"
, filter (/= '.') ghcVer
, if isInc then "-inclusive" else "-exclusive"
]
where
selected = Map.fromList . map toStrs . Map.toList $
fmap spiVersion (iiPackages ii)
`Map.union` iiOptionalCore ii
`Map.union` Map.mapMaybe id (iiCore ii)
toStrs (PackageName name, version) = (name, display version)
loop Tar.Done = return ()
loop (Tar.Fail e) = throwIO e
loop (Tar.Next e es) = go e >> loop es
go e =
case parsePair $ Tar.entryPath e of
Nothing -> return ()
Just (name, version) ->
case Map.lookup name selected of
Just version'
| version == version' -> emit True name version
| otherwise -> return ()
Nothing
| isInc -> emit False name version
| otherwise -> return ()
emit usePatch name version = do
exists <- if usePatch then doesFileExist tarball else return False
if exists
then hPutStr tarballH $ ' ' : ".." </> tarball
else hPutStrLn hackageH base
where
base = concat [name, "-", version]
tarball = "patching" </> "tarballs" </> base <.> "tar" <.> "gz" | 1,964 | false | true | 0 | 14 | 909 | 595 | 295 | 300 | null | null |
eamsden/time-flies | src/FRP/TimeFlies/Types.hs | bsd-3-clause | sampleDelta SVSampleEvent = SVDeltaNothing | 42 | sampleDelta SVSampleEvent = SVDeltaNothing | 42 | sampleDelta SVSampleEvent = SVDeltaNothing | 42 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
Zoetermeer/latro | src/Latro/Typecheck.hs | mit | addBindingsForPat (ILPatChar _ _) _ = return () | 47 | addBindingsForPat (ILPatChar _ _) _ = return () | 47 | addBindingsForPat (ILPatChar _ _) _ = return () | 47 | false | false | 1 | 6 | 7 | 24 | 11 | 13 | null | null |
GU-CLASP/TypedFlow | TypedFlow/Learn.hs | lgpl-3.0 | genPlaceholders (ph :* names) = PHT (T (ExternalVar (Ref (placeholderName ph) typeSShape typeSTyp))) :* genPlaceholders names | 125 | genPlaceholders (ph :* names) = PHT (T (ExternalVar (Ref (placeholderName ph) typeSShape typeSTyp))) :* genPlaceholders names | 125 | genPlaceholders (ph :* names) = PHT (T (ExternalVar (Ref (placeholderName ph) typeSShape typeSTyp))) :* genPlaceholders names | 125 | false | false | 0 | 14 | 15 | 54 | 26 | 28 | null | null |
tmcdonell/hfx | src/haskell/Util/Time.hs | bsd-3-clause | microsecond n = n `div` 1000000 | 31 | microsecond n = n `div` 1000000 | 31 | microsecond n = n `div` 1000000 | 31 | false | false | 0 | 5 | 5 | 15 | 8 | 7 | null | null |
sdiehl/ghc | compiler/ghci/ByteCodeAsm.hs | bsd-3-clause | assembleI :: DynFlags
-> BCInstr
-> Assembler ()
assembleI dflags i = case i of
STKCHECK n -> emit bci_STKCHECK [Op n]
PUSH_L o1 -> emit bci_PUSH_L [SmallOp o1]
PUSH_LL o1 o2 -> emit bci_PUSH_LL [SmallOp o1, SmallOp o2]
PUSH_LLL o1 o2 o3 -> emit bci_PUSH_LLL [SmallOp o1, SmallOp o2, SmallOp o3]
PUSH8 o1 -> emit bci_PUSH8 [SmallOp o1]
PUSH16 o1 -> emit bci_PUSH16 [SmallOp o1]
PUSH32 o1 -> emit bci_PUSH32 [SmallOp o1]
PUSH8_W o1 -> emit bci_PUSH8_W [SmallOp o1]
PUSH16_W o1 -> emit bci_PUSH16_W [SmallOp o1]
PUSH32_W o1 -> emit bci_PUSH32_W [SmallOp o1]
PUSH_G nm -> do p <- ptr (BCOPtrName nm)
emit bci_PUSH_G [Op p]
PUSH_PRIMOP op -> do p <- ptr (BCOPtrPrimOp op)
emit bci_PUSH_G [Op p]
PUSH_BCO proto -> do let ul_bco = assembleBCO dflags proto
p <- ioptr (liftM BCOPtrBCO ul_bco)
emit bci_PUSH_G [Op p]
PUSH_ALTS proto -> do let ul_bco = assembleBCO dflags proto
p <- ioptr (liftM BCOPtrBCO ul_bco)
emit bci_PUSH_ALTS [Op p]
PUSH_ALTS_UNLIFTED proto pk
-> do let ul_bco = assembleBCO dflags proto
p <- ioptr (liftM BCOPtrBCO ul_bco)
emit (push_alts pk) [Op p]
PUSH_PAD8 -> emit bci_PUSH_PAD8 []
PUSH_PAD16 -> emit bci_PUSH_PAD16 []
PUSH_PAD32 -> emit bci_PUSH_PAD32 []
PUSH_UBX8 lit -> do np <- literal lit
emit bci_PUSH_UBX8 [Op np]
PUSH_UBX16 lit -> do np <- literal lit
emit bci_PUSH_UBX16 [Op np]
PUSH_UBX32 lit -> do np <- literal lit
emit bci_PUSH_UBX32 [Op np]
PUSH_UBX lit nws -> do np <- literal lit
emit bci_PUSH_UBX [Op np, SmallOp nws]
PUSH_APPLY_N -> emit bci_PUSH_APPLY_N []
PUSH_APPLY_V -> emit bci_PUSH_APPLY_V []
PUSH_APPLY_F -> emit bci_PUSH_APPLY_F []
PUSH_APPLY_D -> emit bci_PUSH_APPLY_D []
PUSH_APPLY_L -> emit bci_PUSH_APPLY_L []
PUSH_APPLY_P -> emit bci_PUSH_APPLY_P []
PUSH_APPLY_PP -> emit bci_PUSH_APPLY_PP []
PUSH_APPLY_PPP -> emit bci_PUSH_APPLY_PPP []
PUSH_APPLY_PPPP -> emit bci_PUSH_APPLY_PPPP []
PUSH_APPLY_PPPPP -> emit bci_PUSH_APPLY_PPPPP []
PUSH_APPLY_PPPPPP -> emit bci_PUSH_APPLY_PPPPPP []
SLIDE n by -> emit bci_SLIDE [SmallOp n, SmallOp by]
ALLOC_AP n -> emit bci_ALLOC_AP [SmallOp n]
ALLOC_AP_NOUPD n -> emit bci_ALLOC_AP_NOUPD [SmallOp n]
ALLOC_PAP arity n -> emit bci_ALLOC_PAP [SmallOp arity, SmallOp n]
MKAP off sz -> emit bci_MKAP [SmallOp off, SmallOp sz]
MKPAP off sz -> emit bci_MKPAP [SmallOp off, SmallOp sz]
UNPACK n -> emit bci_UNPACK [SmallOp n]
PACK dcon sz -> do itbl_no <- lit [BCONPtrItbl (getName dcon)]
emit bci_PACK [Op itbl_no, SmallOp sz]
LABEL lbl -> label lbl
TESTLT_I i l -> do np <- int i
emit bci_TESTLT_I [Op np, LabelOp l]
TESTEQ_I i l -> do np <- int i
emit bci_TESTEQ_I [Op np, LabelOp l]
TESTLT_W w l -> do np <- word w
emit bci_TESTLT_W [Op np, LabelOp l]
TESTEQ_W w l -> do np <- word w
emit bci_TESTEQ_W [Op np, LabelOp l]
TESTLT_F f l -> do np <- float f
emit bci_TESTLT_F [Op np, LabelOp l]
TESTEQ_F f l -> do np <- float f
emit bci_TESTEQ_F [Op np, LabelOp l]
TESTLT_D d l -> do np <- double d
emit bci_TESTLT_D [Op np, LabelOp l]
TESTEQ_D d l -> do np <- double d
emit bci_TESTEQ_D [Op np, LabelOp l]
TESTLT_P i l -> emit bci_TESTLT_P [SmallOp i, LabelOp l]
TESTEQ_P i l -> emit bci_TESTEQ_P [SmallOp i, LabelOp l]
CASEFAIL -> emit bci_CASEFAIL []
SWIZZLE stkoff n -> emit bci_SWIZZLE [SmallOp stkoff, SmallOp n]
JMP l -> emit bci_JMP [LabelOp l]
ENTER -> emit bci_ENTER []
RETURN -> emit bci_RETURN []
RETURN_UBX rep -> emit (return_ubx rep) []
CCALL off m_addr i -> do np <- addr m_addr
emit bci_CCALL [SmallOp off, Op np, SmallOp i]
BRK_FUN index uniq cc -> do p1 <- ptr BCOPtrBreakArray
q <- int (getKey uniq)
np <- addr cc
emit bci_BRK_FUN [Op p1, SmallOp index,
Op q, Op np]
where
literal (LitLabel fs (Just sz) _)
| platformOS (targetPlatform dflags) == OSMinGW32
= litlabel (appendFS fs (mkFastString ('@':show sz)))
-- On Windows, stdcall labels have a suffix indicating the no. of
-- arg words, e.g. foo@8. testcase: ffi012(ghci)
literal (LitLabel fs _ _) = litlabel fs
literal LitNullAddr = int 0
literal (LitFloat r) = float (fromRational r)
literal (LitDouble r) = double (fromRational r)
literal (LitChar c) = int (ord c)
literal (LitString bs) = lit [BCONPtrStr bs]
-- LitString requires a zero-terminator when emitted
literal (LitNumber nt i _) = case nt of
LitNumInt -> int (fromIntegral i)
LitNumWord -> int (fromIntegral i)
LitNumInt64 -> int64 (fromIntegral i)
LitNumWord64 -> int64 (fromIntegral i)
LitNumInteger -> panic "ByteCodeAsm.literal: LitNumInteger"
LitNumNatural -> panic "ByteCodeAsm.literal: LitNumNatural"
-- We can lower 'LitRubbish' to an arbitrary constant, but @NULL@ is most
-- likely to elicit a crash (rather than corrupt memory) in case absence
-- analysis messed up.
literal LitRubbish = int 0
litlabel fs = lit [BCONPtrLbl fs]
addr (RemotePtr a) = words [fromIntegral a]
float = words . mkLitF
double = words . mkLitD dflags
int = words . mkLitI
int64 = words . mkLitI64 dflags
words ws = lit (map BCONPtrWord ws)
word w = words [w] | 6,808 | assembleI :: DynFlags
-> BCInstr
-> Assembler ()
assembleI dflags i = case i of
STKCHECK n -> emit bci_STKCHECK [Op n]
PUSH_L o1 -> emit bci_PUSH_L [SmallOp o1]
PUSH_LL o1 o2 -> emit bci_PUSH_LL [SmallOp o1, SmallOp o2]
PUSH_LLL o1 o2 o3 -> emit bci_PUSH_LLL [SmallOp o1, SmallOp o2, SmallOp o3]
PUSH8 o1 -> emit bci_PUSH8 [SmallOp o1]
PUSH16 o1 -> emit bci_PUSH16 [SmallOp o1]
PUSH32 o1 -> emit bci_PUSH32 [SmallOp o1]
PUSH8_W o1 -> emit bci_PUSH8_W [SmallOp o1]
PUSH16_W o1 -> emit bci_PUSH16_W [SmallOp o1]
PUSH32_W o1 -> emit bci_PUSH32_W [SmallOp o1]
PUSH_G nm -> do p <- ptr (BCOPtrName nm)
emit bci_PUSH_G [Op p]
PUSH_PRIMOP op -> do p <- ptr (BCOPtrPrimOp op)
emit bci_PUSH_G [Op p]
PUSH_BCO proto -> do let ul_bco = assembleBCO dflags proto
p <- ioptr (liftM BCOPtrBCO ul_bco)
emit bci_PUSH_G [Op p]
PUSH_ALTS proto -> do let ul_bco = assembleBCO dflags proto
p <- ioptr (liftM BCOPtrBCO ul_bco)
emit bci_PUSH_ALTS [Op p]
PUSH_ALTS_UNLIFTED proto pk
-> do let ul_bco = assembleBCO dflags proto
p <- ioptr (liftM BCOPtrBCO ul_bco)
emit (push_alts pk) [Op p]
PUSH_PAD8 -> emit bci_PUSH_PAD8 []
PUSH_PAD16 -> emit bci_PUSH_PAD16 []
PUSH_PAD32 -> emit bci_PUSH_PAD32 []
PUSH_UBX8 lit -> do np <- literal lit
emit bci_PUSH_UBX8 [Op np]
PUSH_UBX16 lit -> do np <- literal lit
emit bci_PUSH_UBX16 [Op np]
PUSH_UBX32 lit -> do np <- literal lit
emit bci_PUSH_UBX32 [Op np]
PUSH_UBX lit nws -> do np <- literal lit
emit bci_PUSH_UBX [Op np, SmallOp nws]
PUSH_APPLY_N -> emit bci_PUSH_APPLY_N []
PUSH_APPLY_V -> emit bci_PUSH_APPLY_V []
PUSH_APPLY_F -> emit bci_PUSH_APPLY_F []
PUSH_APPLY_D -> emit bci_PUSH_APPLY_D []
PUSH_APPLY_L -> emit bci_PUSH_APPLY_L []
PUSH_APPLY_P -> emit bci_PUSH_APPLY_P []
PUSH_APPLY_PP -> emit bci_PUSH_APPLY_PP []
PUSH_APPLY_PPP -> emit bci_PUSH_APPLY_PPP []
PUSH_APPLY_PPPP -> emit bci_PUSH_APPLY_PPPP []
PUSH_APPLY_PPPPP -> emit bci_PUSH_APPLY_PPPPP []
PUSH_APPLY_PPPPPP -> emit bci_PUSH_APPLY_PPPPPP []
SLIDE n by -> emit bci_SLIDE [SmallOp n, SmallOp by]
ALLOC_AP n -> emit bci_ALLOC_AP [SmallOp n]
ALLOC_AP_NOUPD n -> emit bci_ALLOC_AP_NOUPD [SmallOp n]
ALLOC_PAP arity n -> emit bci_ALLOC_PAP [SmallOp arity, SmallOp n]
MKAP off sz -> emit bci_MKAP [SmallOp off, SmallOp sz]
MKPAP off sz -> emit bci_MKPAP [SmallOp off, SmallOp sz]
UNPACK n -> emit bci_UNPACK [SmallOp n]
PACK dcon sz -> do itbl_no <- lit [BCONPtrItbl (getName dcon)]
emit bci_PACK [Op itbl_no, SmallOp sz]
LABEL lbl -> label lbl
TESTLT_I i l -> do np <- int i
emit bci_TESTLT_I [Op np, LabelOp l]
TESTEQ_I i l -> do np <- int i
emit bci_TESTEQ_I [Op np, LabelOp l]
TESTLT_W w l -> do np <- word w
emit bci_TESTLT_W [Op np, LabelOp l]
TESTEQ_W w l -> do np <- word w
emit bci_TESTEQ_W [Op np, LabelOp l]
TESTLT_F f l -> do np <- float f
emit bci_TESTLT_F [Op np, LabelOp l]
TESTEQ_F f l -> do np <- float f
emit bci_TESTEQ_F [Op np, LabelOp l]
TESTLT_D d l -> do np <- double d
emit bci_TESTLT_D [Op np, LabelOp l]
TESTEQ_D d l -> do np <- double d
emit bci_TESTEQ_D [Op np, LabelOp l]
TESTLT_P i l -> emit bci_TESTLT_P [SmallOp i, LabelOp l]
TESTEQ_P i l -> emit bci_TESTEQ_P [SmallOp i, LabelOp l]
CASEFAIL -> emit bci_CASEFAIL []
SWIZZLE stkoff n -> emit bci_SWIZZLE [SmallOp stkoff, SmallOp n]
JMP l -> emit bci_JMP [LabelOp l]
ENTER -> emit bci_ENTER []
RETURN -> emit bci_RETURN []
RETURN_UBX rep -> emit (return_ubx rep) []
CCALL off m_addr i -> do np <- addr m_addr
emit bci_CCALL [SmallOp off, Op np, SmallOp i]
BRK_FUN index uniq cc -> do p1 <- ptr BCOPtrBreakArray
q <- int (getKey uniq)
np <- addr cc
emit bci_BRK_FUN [Op p1, SmallOp index,
Op q, Op np]
where
literal (LitLabel fs (Just sz) _)
| platformOS (targetPlatform dflags) == OSMinGW32
= litlabel (appendFS fs (mkFastString ('@':show sz)))
-- On Windows, stdcall labels have a suffix indicating the no. of
-- arg words, e.g. foo@8. testcase: ffi012(ghci)
literal (LitLabel fs _ _) = litlabel fs
literal LitNullAddr = int 0
literal (LitFloat r) = float (fromRational r)
literal (LitDouble r) = double (fromRational r)
literal (LitChar c) = int (ord c)
literal (LitString bs) = lit [BCONPtrStr bs]
-- LitString requires a zero-terminator when emitted
literal (LitNumber nt i _) = case nt of
LitNumInt -> int (fromIntegral i)
LitNumWord -> int (fromIntegral i)
LitNumInt64 -> int64 (fromIntegral i)
LitNumWord64 -> int64 (fromIntegral i)
LitNumInteger -> panic "ByteCodeAsm.literal: LitNumInteger"
LitNumNatural -> panic "ByteCodeAsm.literal: LitNumNatural"
-- We can lower 'LitRubbish' to an arbitrary constant, but @NULL@ is most
-- likely to elicit a crash (rather than corrupt memory) in case absence
-- analysis messed up.
literal LitRubbish = int 0
litlabel fs = lit [BCONPtrLbl fs]
addr (RemotePtr a) = words [fromIntegral a]
float = words . mkLitF
double = words . mkLitD dflags
int = words . mkLitI
int64 = words . mkLitI64 dflags
words ws = lit (map BCONPtrWord ws)
word w = words [w] | 6,808 | assembleI dflags i = case i of
STKCHECK n -> emit bci_STKCHECK [Op n]
PUSH_L o1 -> emit bci_PUSH_L [SmallOp o1]
PUSH_LL o1 o2 -> emit bci_PUSH_LL [SmallOp o1, SmallOp o2]
PUSH_LLL o1 o2 o3 -> emit bci_PUSH_LLL [SmallOp o1, SmallOp o2, SmallOp o3]
PUSH8 o1 -> emit bci_PUSH8 [SmallOp o1]
PUSH16 o1 -> emit bci_PUSH16 [SmallOp o1]
PUSH32 o1 -> emit bci_PUSH32 [SmallOp o1]
PUSH8_W o1 -> emit bci_PUSH8_W [SmallOp o1]
PUSH16_W o1 -> emit bci_PUSH16_W [SmallOp o1]
PUSH32_W o1 -> emit bci_PUSH32_W [SmallOp o1]
PUSH_G nm -> do p <- ptr (BCOPtrName nm)
emit bci_PUSH_G [Op p]
PUSH_PRIMOP op -> do p <- ptr (BCOPtrPrimOp op)
emit bci_PUSH_G [Op p]
PUSH_BCO proto -> do let ul_bco = assembleBCO dflags proto
p <- ioptr (liftM BCOPtrBCO ul_bco)
emit bci_PUSH_G [Op p]
PUSH_ALTS proto -> do let ul_bco = assembleBCO dflags proto
p <- ioptr (liftM BCOPtrBCO ul_bco)
emit bci_PUSH_ALTS [Op p]
PUSH_ALTS_UNLIFTED proto pk
-> do let ul_bco = assembleBCO dflags proto
p <- ioptr (liftM BCOPtrBCO ul_bco)
emit (push_alts pk) [Op p]
PUSH_PAD8 -> emit bci_PUSH_PAD8 []
PUSH_PAD16 -> emit bci_PUSH_PAD16 []
PUSH_PAD32 -> emit bci_PUSH_PAD32 []
PUSH_UBX8 lit -> do np <- literal lit
emit bci_PUSH_UBX8 [Op np]
PUSH_UBX16 lit -> do np <- literal lit
emit bci_PUSH_UBX16 [Op np]
PUSH_UBX32 lit -> do np <- literal lit
emit bci_PUSH_UBX32 [Op np]
PUSH_UBX lit nws -> do np <- literal lit
emit bci_PUSH_UBX [Op np, SmallOp nws]
PUSH_APPLY_N -> emit bci_PUSH_APPLY_N []
PUSH_APPLY_V -> emit bci_PUSH_APPLY_V []
PUSH_APPLY_F -> emit bci_PUSH_APPLY_F []
PUSH_APPLY_D -> emit bci_PUSH_APPLY_D []
PUSH_APPLY_L -> emit bci_PUSH_APPLY_L []
PUSH_APPLY_P -> emit bci_PUSH_APPLY_P []
PUSH_APPLY_PP -> emit bci_PUSH_APPLY_PP []
PUSH_APPLY_PPP -> emit bci_PUSH_APPLY_PPP []
PUSH_APPLY_PPPP -> emit bci_PUSH_APPLY_PPPP []
PUSH_APPLY_PPPPP -> emit bci_PUSH_APPLY_PPPPP []
PUSH_APPLY_PPPPPP -> emit bci_PUSH_APPLY_PPPPPP []
SLIDE n by -> emit bci_SLIDE [SmallOp n, SmallOp by]
ALLOC_AP n -> emit bci_ALLOC_AP [SmallOp n]
ALLOC_AP_NOUPD n -> emit bci_ALLOC_AP_NOUPD [SmallOp n]
ALLOC_PAP arity n -> emit bci_ALLOC_PAP [SmallOp arity, SmallOp n]
MKAP off sz -> emit bci_MKAP [SmallOp off, SmallOp sz]
MKPAP off sz -> emit bci_MKPAP [SmallOp off, SmallOp sz]
UNPACK n -> emit bci_UNPACK [SmallOp n]
PACK dcon sz -> do itbl_no <- lit [BCONPtrItbl (getName dcon)]
emit bci_PACK [Op itbl_no, SmallOp sz]
LABEL lbl -> label lbl
TESTLT_I i l -> do np <- int i
emit bci_TESTLT_I [Op np, LabelOp l]
TESTEQ_I i l -> do np <- int i
emit bci_TESTEQ_I [Op np, LabelOp l]
TESTLT_W w l -> do np <- word w
emit bci_TESTLT_W [Op np, LabelOp l]
TESTEQ_W w l -> do np <- word w
emit bci_TESTEQ_W [Op np, LabelOp l]
TESTLT_F f l -> do np <- float f
emit bci_TESTLT_F [Op np, LabelOp l]
TESTEQ_F f l -> do np <- float f
emit bci_TESTEQ_F [Op np, LabelOp l]
TESTLT_D d l -> do np <- double d
emit bci_TESTLT_D [Op np, LabelOp l]
TESTEQ_D d l -> do np <- double d
emit bci_TESTEQ_D [Op np, LabelOp l]
TESTLT_P i l -> emit bci_TESTLT_P [SmallOp i, LabelOp l]
TESTEQ_P i l -> emit bci_TESTEQ_P [SmallOp i, LabelOp l]
CASEFAIL -> emit bci_CASEFAIL []
SWIZZLE stkoff n -> emit bci_SWIZZLE [SmallOp stkoff, SmallOp n]
JMP l -> emit bci_JMP [LabelOp l]
ENTER -> emit bci_ENTER []
RETURN -> emit bci_RETURN []
RETURN_UBX rep -> emit (return_ubx rep) []
CCALL off m_addr i -> do np <- addr m_addr
emit bci_CCALL [SmallOp off, Op np, SmallOp i]
BRK_FUN index uniq cc -> do p1 <- ptr BCOPtrBreakArray
q <- int (getKey uniq)
np <- addr cc
emit bci_BRK_FUN [Op p1, SmallOp index,
Op q, Op np]
where
literal (LitLabel fs (Just sz) _)
| platformOS (targetPlatform dflags) == OSMinGW32
= litlabel (appendFS fs (mkFastString ('@':show sz)))
-- On Windows, stdcall labels have a suffix indicating the no. of
-- arg words, e.g. foo@8. testcase: ffi012(ghci)
literal (LitLabel fs _ _) = litlabel fs
literal LitNullAddr = int 0
literal (LitFloat r) = float (fromRational r)
literal (LitDouble r) = double (fromRational r)
literal (LitChar c) = int (ord c)
literal (LitString bs) = lit [BCONPtrStr bs]
-- LitString requires a zero-terminator when emitted
literal (LitNumber nt i _) = case nt of
LitNumInt -> int (fromIntegral i)
LitNumWord -> int (fromIntegral i)
LitNumInt64 -> int64 (fromIntegral i)
LitNumWord64 -> int64 (fromIntegral i)
LitNumInteger -> panic "ByteCodeAsm.literal: LitNumInteger"
LitNumNatural -> panic "ByteCodeAsm.literal: LitNumNatural"
-- We can lower 'LitRubbish' to an arbitrary constant, but @NULL@ is most
-- likely to elicit a crash (rather than corrupt memory) in case absence
-- analysis messed up.
literal LitRubbish = int 0
litlabel fs = lit [BCONPtrLbl fs]
addr (RemotePtr a) = words [fromIntegral a]
float = words . mkLitF
double = words . mkLitD dflags
int = words . mkLitI
int64 = words . mkLitI64 dflags
words ws = lit (map BCONPtrWord ws)
word w = words [w] | 6,739 | false | true | 8 | 15 | 2,764 | 2,014 | 931 | 1,083 | null | null |
fffej/HS-Poker | LookupPatternMatch.hs | bsd-3-clause | getValueFromProduct 4405999 = 2866 | 34 | getValueFromProduct 4405999 = 2866 | 34 | getValueFromProduct 4405999 = 2866 | 34 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
lordi/haskell-terminal | tests/terminal/Main.hs | gpl-2.0 | -- |Apply a list of `TerminalAction`s to the default terminal
applyDef actions = handleActions actions defaultTerm | 114 | applyDef actions = handleActions actions defaultTerm | 52 | applyDef actions = handleActions actions defaultTerm | 52 | true | false | 0 | 5 | 15 | 15 | 7 | 8 | null | null |
spechub/Hets | Common/MathLink.hs | gpl-2.0 | -- * C to Haskell utilities
withStringArray :: MonadIO m => [String] -> (Ptr CString -> IO b) -> m b
withStringArray l f = liftIO $ mapM newCString l >>= flip withArray f | 171 | withStringArray :: MonadIO m => [String] -> (Ptr CString -> IO b) -> m b
withStringArray l f = liftIO $ mapM newCString l >>= flip withArray f | 142 | withStringArray l f = liftIO $ mapM newCString l >>= flip withArray f | 69 | true | true | 0 | 10 | 34 | 69 | 33 | 36 | null | null |
cbaatz/hamu8080 | src/Hamu8080/Compute.hs | mit | -- MOV C, D
doOp 0x4B = setReg C =<< getReg E | 45 | doOp 0x4B = setReg C =<< getReg E | 33 | doOp 0x4B = setReg C =<< getReg E | 33 | true | false | 0 | 6 | 11 | 20 | 9 | 11 | null | null |
dylex/range-set | tests/List.hs | mit | elementsProp :: SetAction Int -> Property
elementsProp seta = Set.elems (toSet seta) === RSet.elems (toRSet seta) | 113 | elementsProp :: SetAction Int -> Property
elementsProp seta = Set.elems (toSet seta) === RSet.elems (toRSet seta) | 113 | elementsProp seta = Set.elems (toSet seta) === RSet.elems (toRSet seta) | 71 | false | true | 0 | 8 | 15 | 52 | 23 | 29 | null | null |
ulricha/dsh | src/Database/DSH/Translate/SL2Algebra.hs | bsd-3-clause | translateTerOp :: SegmentAlgebra a
=> SL.TerOp
-> Res (SLDVec a) (SLRVec a) (SLKVec a) (SLFVec a) (SLSVec a)
-> Res (SLDVec a) (SLRVec a) (SLKVec a) (SLFVec a) (SLSVec a)
-> Res (SLDVec a) (SLRVec a) (SLKVec a) (SLFVec a) (SLSVec a)
-> B.Build a (Res (SLDVec a) (SLRVec a) (SLKVec a) (SLFVec a) (SLSVec a))
translateTerOp t c1 c2 c3 =
case t of
SL.Combine -> do
(d, r1, r2) <- vecCombine (toDVec c1) (toDVec c2) (toDVec c3)
return $ RTriple (fromDVec d) (fromKVec r1) (fromKVec r2) | 592 | translateTerOp :: SegmentAlgebra a
=> SL.TerOp
-> Res (SLDVec a) (SLRVec a) (SLKVec a) (SLFVec a) (SLSVec a)
-> Res (SLDVec a) (SLRVec a) (SLKVec a) (SLFVec a) (SLSVec a)
-> Res (SLDVec a) (SLRVec a) (SLKVec a) (SLFVec a) (SLSVec a)
-> B.Build a (Res (SLDVec a) (SLRVec a) (SLKVec a) (SLFVec a) (SLSVec a))
translateTerOp t c1 c2 c3 =
case t of
SL.Combine -> do
(d, r1, r2) <- vecCombine (toDVec c1) (toDVec c2) (toDVec c3)
return $ RTriple (fromDVec d) (fromKVec r1) (fromKVec r2) | 592 | translateTerOp t c1 c2 c3 =
case t of
SL.Combine -> do
(d, r1, r2) <- vecCombine (toDVec c1) (toDVec c2) (toDVec c3)
return $ RTriple (fromDVec d) (fromKVec r1) (fromKVec r2) | 210 | false | true | 0 | 14 | 198 | 304 | 149 | 155 | null | null |
kawu/skladnica-with-walenty | src/NLP/Skladnica/Walenty/Search.hs | bsd-2-clause | --------------------------------------------------------------------------------
-- Conversion to Query
--------------------------------------------------------------------------------
-- | Convert the given verbal entry from Walenty to a query.
--
-- TODO: The following are ignored for the moment:
--
-- * Negativity
-- * Predicativity
-- * ...
--
querify :: W.Verb -> Expr SklTree
querify verb = andQ
[ trunk . hasBase . W.base $ verb
, frameQ (W.frame verb) ] | 475 | querify :: W.Verb -> Expr SklTree
querify verb = andQ
[ trunk . hasBase . W.base $ verb
, frameQ (W.frame verb) ] | 117 | querify verb = andQ
[ trunk . hasBase . W.base $ verb
, frameQ (W.frame verb) ] | 83 | true | true | 0 | 9 | 73 | 68 | 39 | 29 | null | null |
AlexanderPankiv/ghc | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | coerceFP2Int :: Width -> Width -> CmmExpr -> NatM Register
coerceFP2Int from to x = if_sse2 coerceFP2Int_sse2 coerceFP2Int_x87
where
coerceFP2Int_x87 = do
(x_reg, x_code) <- getSomeReg x
let
opc = case from of W32 -> GFTOI; W64 -> GDTOI
n -> panic $ "coerceFP2Int.x87: unhandled width ("
++ show n ++ ")"
code dst = x_code `snocOL` opc x_reg dst
-- ToDo: works for non-II32 reps?
return (Any (intFormat to) code)
coerceFP2Int_sse2 = do
(x_op, x_code) <- getOperand x -- ToDo: could be a safe operand
let
opc = case from of W32 -> CVTTSS2SIQ; W64 -> CVTTSD2SIQ;
n -> panic $ "coerceFP2Init.sse: unhandled width ("
++ show n ++ ")"
code dst = x_code `snocOL` opc (intFormat to) x_op dst
return (Any (intFormat to) code)
-- works even if the destination rep is <II32
-------------------------------------------------------------------------------- | 1,096 | coerceFP2Int :: Width -> Width -> CmmExpr -> NatM Register
coerceFP2Int from to x = if_sse2 coerceFP2Int_sse2 coerceFP2Int_x87
where
coerceFP2Int_x87 = do
(x_reg, x_code) <- getSomeReg x
let
opc = case from of W32 -> GFTOI; W64 -> GDTOI
n -> panic $ "coerceFP2Int.x87: unhandled width ("
++ show n ++ ")"
code dst = x_code `snocOL` opc x_reg dst
-- ToDo: works for non-II32 reps?
return (Any (intFormat to) code)
coerceFP2Int_sse2 = do
(x_op, x_code) <- getOperand x -- ToDo: could be a safe operand
let
opc = case from of W32 -> CVTTSS2SIQ; W64 -> CVTTSD2SIQ;
n -> panic $ "coerceFP2Init.sse: unhandled width ("
++ show n ++ ")"
code dst = x_code `snocOL` opc (intFormat to) x_op dst
return (Any (intFormat to) code)
-- works even if the destination rep is <II32
-------------------------------------------------------------------------------- | 1,096 | coerceFP2Int from to x = if_sse2 coerceFP2Int_sse2 coerceFP2Int_x87
where
coerceFP2Int_x87 = do
(x_reg, x_code) <- getSomeReg x
let
opc = case from of W32 -> GFTOI; W64 -> GDTOI
n -> panic $ "coerceFP2Int.x87: unhandled width ("
++ show n ++ ")"
code dst = x_code `snocOL` opc x_reg dst
-- ToDo: works for non-II32 reps?
return (Any (intFormat to) code)
coerceFP2Int_sse2 = do
(x_op, x_code) <- getOperand x -- ToDo: could be a safe operand
let
opc = case from of W32 -> CVTTSS2SIQ; W64 -> CVTTSD2SIQ;
n -> panic $ "coerceFP2Init.sse: unhandled width ("
++ show n ++ ")"
code dst = x_code `snocOL` opc (intFormat to) x_op dst
return (Any (intFormat to) code)
-- works even if the destination rep is <II32
-------------------------------------------------------------------------------- | 1,037 | false | true | 2 | 16 | 387 | 279 | 135 | 144 | null | null |
xaverdh/hfish-parser | HFish/QuickCheck/Arbitrary.hs | mit | genVarIdent = mkNText . T.pack
<$> ( listOf1
( arbitrary `suchThat` f)
`suchThat` ( C.isLetter . head ) )
where
f c = C.isAlphaNum c || (=='_') c | 169 | genVarIdent = mkNText . T.pack
<$> ( listOf1
( arbitrary `suchThat` f)
`suchThat` ( C.isLetter . head ) )
where
f c = C.isAlphaNum c || (=='_') c | 169 | genVarIdent = mkNText . T.pack
<$> ( listOf1
( arbitrary `suchThat` f)
`suchThat` ( C.isLetter . head ) )
where
f c = C.isAlphaNum c || (=='_') c | 169 | false | false | 2 | 9 | 51 | 74 | 39 | 35 | null | null |
seckcoder/vector | Data/Vector/Fusion/Bundle/Monadic.hs | bsd-3-clause | flatten mk istep sz Bundle{sElems = s} = fromStream (S.flatten mk istep s) sz | 77 | flatten mk istep sz Bundle{sElems = s} = fromStream (S.flatten mk istep s) sz | 77 | flatten mk istep sz Bundle{sElems = s} = fromStream (S.flatten mk istep s) sz | 77 | false | false | 1 | 8 | 13 | 50 | 21 | 29 | null | null |
GRACeFUL-project/GRACe | RestAPI/Main.hs | bsd-3-clause | -- tells the static path where to look (location of the editor (index.html and java scripts))
hdr :: Handler a -> Handler (Resp a)
hdr h = h >>= return . addHeader "*" | 168 | hdr :: Handler a -> Handler (Resp a)
hdr h = h >>= return . addHeader "*" | 73 | hdr h = h >>= return . addHeader "*" | 36 | true | true | 0 | 8 | 33 | 42 | 20 | 22 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.