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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bjpop/blip | blipinterpreter/src/Blip/Interpreter/HashTable/Utils.hs | bsd-3-clause | cacheLineSize :: Int
cacheLineSize = 64 | 39 | cacheLineSize :: Int
cacheLineSize = 64 | 39 | cacheLineSize = 64 | 18 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
portnov/yaledger | YaLedger/Types/Attributes.hs | bsd-3-clause | getString (Regexp s) = s | 24 | getString (Regexp s) = s | 24 | getString (Regexp s) = s | 24 | false | false | 0 | 7 | 4 | 15 | 7 | 8 | null | null |
authchir/mini-ml | src/TypeInference2.hs | isc | unify (TFun b t1 t2) (TFun b' t1' t2') = do
let app = Subst.applyTy
let o = Subst.comp
s0 <- return (Subst.singletonAn b' b)
s1 <- unify (app s0 t1) (app s0 t1')
s2 <- unify (app s1 (app s0 t2)) (app s1 (app s0 t2'))
return (s2 `o` s1 `o` s0) | 254 | unify (TFun b t1 t2) (TFun b' t1' t2') = do
let app = Subst.applyTy
let o = Subst.comp
s0 <- return (Subst.singletonAn b' b)
s1 <- unify (app s0 t1) (app s0 t1')
s2 <- unify (app s1 (app s0 t2)) (app s1 (app s0 t2'))
return (s2 `o` s1 `o` s0) | 254 | unify (TFun b t1 t2) (TFun b' t1' t2') = do
let app = Subst.applyTy
let o = Subst.comp
s0 <- return (Subst.singletonAn b' b)
s1 <- unify (app s0 t1) (app s0 t1')
s2 <- unify (app s1 (app s0 t2)) (app s1 (app s0 t2'))
return (s2 `o` s1 `o` s0) | 254 | false | false | 1 | 13 | 64 | 169 | 80 | 89 | null | null |
imalsogreg/tetrode-ephys | utils/drawSpline.hs | gpl-3.0 | defaultState :: GameState
defaultState = GameState False False False False False (0,0)
(SpecEdge { pointA = Location 0 0 0
, ctrlA = Location 0 30 0
, pointB = Location 30 0 0
, ctrlB = Location 30 30 0
}) | 326 | defaultState :: GameState
defaultState = GameState False False False False False (0,0)
(SpecEdge { pointA = Location 0 0 0
, ctrlA = Location 0 30 0
, pointB = Location 30 0 0
, ctrlB = Location 30 30 0
}) | 326 | defaultState = GameState False False False False False (0,0)
(SpecEdge { pointA = Location 0 0 0
, ctrlA = Location 0 30 0
, pointB = Location 30 0 0
, ctrlB = Location 30 30 0
}) | 300 | false | true | 0 | 8 | 162 | 98 | 49 | 49 | null | null |
molysgaard/OsmXmlTool | GenXml.hs | bsd-3-clause | genTag :: (String, String) -> Content String
genTag (k,v) = CElem (Elem (N "tag") [genAttr "k" k, genAttr "v" v] []) "" | 119 | genTag :: (String, String) -> Content String
genTag (k,v) = CElem (Elem (N "tag") [genAttr "k" k, genAttr "v" v] []) "" | 119 | genTag (k,v) = CElem (Elem (N "tag") [genAttr "k" k, genAttr "v" v] []) "" | 74 | false | true | 0 | 9 | 21 | 72 | 37 | 35 | null | null |
liyanchang/scheme-in-haskell | src/chp3.hs | mit | parseQuoted :: Parser LispVal
parseQuoted = do
char '\''
x <- parseExpr
return $ List [Atom "quote", x] | 115 | parseQuoted :: Parser LispVal
parseQuoted = do
char '\''
x <- parseExpr
return $ List [Atom "quote", x] | 115 | parseQuoted = do
char '\''
x <- parseExpr
return $ List [Atom "quote", x] | 85 | false | true | 0 | 11 | 29 | 52 | 22 | 30 | null | null |
ulricha/dsh | src/Database/DSH/CL/Kure.hs | bsd-3-clause | binopR :: Monad m => Rewrite CompCtx m Expr -> Rewrite CompCtx m Expr -> Rewrite CompCtx m Expr
binopR t1 t2 = binopT t1 t2 BinOp | 129 | binopR :: Monad m => Rewrite CompCtx m Expr -> Rewrite CompCtx m Expr -> Rewrite CompCtx m Expr
binopR t1 t2 = binopT t1 t2 BinOp | 129 | binopR t1 t2 = binopT t1 t2 BinOp | 33 | false | true | 0 | 8 | 26 | 59 | 27 | 32 | null | null |
urbanslug/ghc | compiler/cmm/CmmCommonBlockElim.hs | bsd-3-clause | eqMaybeWith _ _ _ = False | 25 | eqMaybeWith _ _ _ = False | 25 | eqMaybeWith _ _ _ = False | 25 | false | false | 1 | 5 | 5 | 14 | 5 | 9 | null | null |
bgamari/pandoc | src/Text/Pandoc/Writers/FB2.hs | gpl-2.0 | -- FIXME: can lead to malformed FB2
blockToXml (Para [Math DisplayMath formula]) = insertMath NormalImage formula | 113 | blockToXml (Para [Math DisplayMath formula]) = insertMath NormalImage formula | 77 | blockToXml (Para [Math DisplayMath formula]) = insertMath NormalImage formula | 77 | true | false | 0 | 9 | 15 | 29 | 14 | 15 | null | null |
ndmitchell/extra | src/Control/Monad/Extra.hs | bsd-3-clause | -- Data.List for Monad
-- | A version of 'partition' that works with a monadic predicate.
--
-- > partitionM (Just . even) [1,2,3] == Just ([2], [1,3])
-- > partitionM (const Nothing) [1,2,3] == Nothing
partitionM :: Monad m => (a -> m Bool) -> [a] -> m ([a], [a])
partitionM f [] = pure ([], []) | 297 | partitionM :: Monad m => (a -> m Bool) -> [a] -> m ([a], [a])
partitionM f [] = pure ([], []) | 93 | partitionM f [] = pure ([], []) | 31 | true | true | 0 | 10 | 58 | 79 | 44 | 35 | null | null |
tensor5/posix-acl | System/Posix/ACL/C.hs | bsd-3-clause | -- | Calculate and set the permissions associated with the @'Mask'@ ACL entry of
-- the ACL. The value of the new permissions is the union of the permissions
-- granted by all entries of tag type @'Group'@, @'GroupObj'@, or @'User'@. If
-- the ACL already contains a @'Mask'@ entry, its permissions are overwritten;
-- if it does not contain a @'Mask'@ entry, one is added.
--
-- Call to @acl_calc_mask()@.
calcMask :: MonadBase IO m => AclT m ()
calcMask =
AclT $ ReaderT $
liftBase . mask_ . throwErrnoIfMinus1_ "acl_calc_mask" . acl_calc_mask | 560 | calcMask :: MonadBase IO m => AclT m ()
calcMask =
AclT $ ReaderT $
liftBase . mask_ . throwErrnoIfMinus1_ "acl_calc_mask" . acl_calc_mask | 151 | calcMask =
AclT $ ReaderT $
liftBase . mask_ . throwErrnoIfMinus1_ "acl_calc_mask" . acl_calc_mask | 111 | true | true | 5 | 8 | 108 | 66 | 32 | 34 | null | null |
JohnLato/iteratee | src/Data/Iteratee/Base.hs | bsd-3-clause | -- | identical to icont, left in for compatibility-ish reasons
liftI :: Monad m => (Stream s -> ContReturn s m a) -> Iteratee s m a
liftI = icontP | 146 | liftI :: Monad m => (Stream s -> ContReturn s m a) -> Iteratee s m a
liftI = icontP | 83 | liftI = icontP | 14 | true | true | 0 | 9 | 29 | 47 | 23 | 24 | null | null |
cutsea110/aop | src/DualityOfSorts.hs | bsd-3-clause | naiveInsert (Cons a (In SNil)) = SCons a Nil | 44 | naiveInsert (Cons a (In SNil)) = SCons a Nil | 44 | naiveInsert (Cons a (In SNil)) = SCons a Nil | 44 | false | false | 0 | 9 | 8 | 28 | 13 | 15 | null | null |
atomb/dalvik | Dalvik/Printer.hs | bsd-3-clause | ifOpStr Lt = "lt" | 17 | ifOpStr Lt = "lt" | 17 | ifOpStr Lt = "lt" | 17 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
chrisbarrett/itunes.hs | src/Itunes/Media.hs | bsd-3-clause | importTasks _ dest (ZipFile f) = withArchive f $ do
entries <- liftM (filter hasMediaExt) entryNames
forM entries $ \x ->
return ImportTask { taskName = x
, runTask = withArchive f $ extractFiles [x] dest }
-- | True if the given file can be imported by iTunes. | 292 | importTasks _ dest (ZipFile f) = withArchive f $ do
entries <- liftM (filter hasMediaExt) entryNames
forM entries $ \x ->
return ImportTask { taskName = x
, runTask = withArchive f $ extractFiles [x] dest }
-- | True if the given file can be imported by iTunes. | 292 | importTasks _ dest (ZipFile f) = withArchive f $ do
entries <- liftM (filter hasMediaExt) entryNames
forM entries $ \x ->
return ImportTask { taskName = x
, runTask = withArchive f $ extractFiles [x] dest }
-- | True if the given file can be imported by iTunes. | 292 | false | false | 0 | 15 | 79 | 92 | 45 | 47 | null | null |
beni55/cryptol | src/Cryptol/Prims/Eval.hs | bsd-3-clause | fromThenToV :: Value
fromThenToV =
tlamN $ \ first ->
tlamN $ \ next ->
tlamN $ \ lst ->
tlamN $ \ bits ->
tlamN $ \ len ->
case (first, next, lst, len, bits) of
(_ , _ , _ , _ , Nat bits')
| bits' >= Arch.maxBigIntWidth -> wordTooWide bits'
(Nat first', Nat next', Nat lst', Nat len', Nat bits') ->
let nums = enumFromThenTo first' next' lst'
in VSeq False (genericTake len' (map (VWord . BV bits') nums))
_ -> evalPanic "fromThenV" ["invalid arguments"]
-- Random Values ---------------------------------------------------------------
-- | Produce a random value with the given seed. If we do not support
-- making values of the given type, return zero of that type.
-- TODO: do better than returning zero | 801 | fromThenToV :: Value
fromThenToV =
tlamN $ \ first ->
tlamN $ \ next ->
tlamN $ \ lst ->
tlamN $ \ bits ->
tlamN $ \ len ->
case (first, next, lst, len, bits) of
(_ , _ , _ , _ , Nat bits')
| bits' >= Arch.maxBigIntWidth -> wordTooWide bits'
(Nat first', Nat next', Nat lst', Nat len', Nat bits') ->
let nums = enumFromThenTo first' next' lst'
in VSeq False (genericTake len' (map (VWord . BV bits') nums))
_ -> evalPanic "fromThenV" ["invalid arguments"]
-- Random Values ---------------------------------------------------------------
-- | Produce a random value with the given seed. If we do not support
-- making values of the given type, return zero of that type.
-- TODO: do better than returning zero | 801 | fromThenToV =
tlamN $ \ first ->
tlamN $ \ next ->
tlamN $ \ lst ->
tlamN $ \ bits ->
tlamN $ \ len ->
case (first, next, lst, len, bits) of
(_ , _ , _ , _ , Nat bits')
| bits' >= Arch.maxBigIntWidth -> wordTooWide bits'
(Nat first', Nat next', Nat lst', Nat len', Nat bits') ->
let nums = enumFromThenTo first' next' lst'
in VSeq False (genericTake len' (map (VWord . BV bits') nums))
_ -> evalPanic "fromThenV" ["invalid arguments"]
-- Random Values ---------------------------------------------------------------
-- | Produce a random value with the given seed. If we do not support
-- making values of the given type, return zero of that type.
-- TODO: do better than returning zero | 780 | false | true | 10 | 18 | 220 | 228 | 116 | 112 | null | null |
gbataille/pandoc | src/Text/Pandoc/Writers/FB2.hs | gpl-2.0 | -- FIXME
plain (Code _ s) = s | 29 | plain (Code _ s) = s | 20 | plain (Code _ s) = s | 20 | true | false | 0 | 7 | 7 | 18 | 9 | 9 | null | null |
Kyly/liquidhaskell | tests/test.hs | bsd-3-clause | -- this is largely based on ocharles' test runner at
-- https://github.com/ocharles/tasty-ant-xml/blob/master/Test/Tasty/Runners/AntXML.hs#L65
loggingTestReporter = TestReporter [] $ \opts tree -> Just $ \smap -> do
let
runTest _ testName _ = Traversal $ Functor.Compose $ do
i <- State.get
summary <- lift $ STM.atomically $ do
status <- STM.readTVar $
fromMaybe (error "Attempted to lookup test by index outside bounds") $
IntMap.lookup i smap
let mkSuccess time = [(testName, time, True)]
mkFailure time = [(testName, time, False)]
case status of
-- If the test is done, generate a summary for it
Done result
| resultSuccessful result
-> pure (mkSuccess (resultTime result))
| otherwise
-> pure (mkFailure (resultTime result))
-- Otherwise the test has either not been started or is currently
-- executing
_ -> STM.retry
Const summary <$ State.modify (+ 1)
runGroup group children = Traversal $ Functor.Compose $ do
Const soFar <- Functor.getCompose $ getTraversal children
pure $ Const $ map (\(n,t,s) -> (group</>n,t,s)) soFar
computeFailures :: StatusMap -> IO Int
computeFailures = fmap getSum . getApp . foldMap (\var -> Ap $
(\r -> Sum $ if resultSuccessful r then 0 else 1) <$> getResultFromTVar var)
getResultFromTVar :: STM.TVar Status -> IO Result
getResultFromTVar var =
STM.atomically $ do
status <- STM.readTVar var
case status of
Done r -> return r
_ -> STM.retry
(Const summary, _tests) <-
flip State.runStateT 0 $ Functor.getCompose $ getTraversal $
foldTestTree
trivialFold { foldSingle = runTest, foldGroup = runGroup }
opts
tree
return $ \_elapsedTime -> do
-- get some semblance of a hostname
host <- takeWhile (/='.') <$> readProcess "hostname" [] []
-- don't use the `time` package, major api differences between ghc 708 and 710
time <- head . lines <$> readProcess "date" ["+%Y-%m-%dT%H-%M-%S"] []
let dir = "tests" </> "logs" </> host ++ "-" ++ time
let path = dir </> "summary.csv"
renameDirectory "tests/logs/cur" dir
writeFile path $ unlines
$ "test, time(s), result"
: map (\(n, t, r) -> printf "%s, %0.4f, %s" n t (show r)) summary
(==0) <$> computeFailures smap | 2,520 | loggingTestReporter = TestReporter [] $ \opts tree -> Just $ \smap -> do
let
runTest _ testName _ = Traversal $ Functor.Compose $ do
i <- State.get
summary <- lift $ STM.atomically $ do
status <- STM.readTVar $
fromMaybe (error "Attempted to lookup test by index outside bounds") $
IntMap.lookup i smap
let mkSuccess time = [(testName, time, True)]
mkFailure time = [(testName, time, False)]
case status of
-- If the test is done, generate a summary for it
Done result
| resultSuccessful result
-> pure (mkSuccess (resultTime result))
| otherwise
-> pure (mkFailure (resultTime result))
-- Otherwise the test has either not been started or is currently
-- executing
_ -> STM.retry
Const summary <$ State.modify (+ 1)
runGroup group children = Traversal $ Functor.Compose $ do
Const soFar <- Functor.getCompose $ getTraversal children
pure $ Const $ map (\(n,t,s) -> (group</>n,t,s)) soFar
computeFailures :: StatusMap -> IO Int
computeFailures = fmap getSum . getApp . foldMap (\var -> Ap $
(\r -> Sum $ if resultSuccessful r then 0 else 1) <$> getResultFromTVar var)
getResultFromTVar :: STM.TVar Status -> IO Result
getResultFromTVar var =
STM.atomically $ do
status <- STM.readTVar var
case status of
Done r -> return r
_ -> STM.retry
(Const summary, _tests) <-
flip State.runStateT 0 $ Functor.getCompose $ getTraversal $
foldTestTree
trivialFold { foldSingle = runTest, foldGroup = runGroup }
opts
tree
return $ \_elapsedTime -> do
-- get some semblance of a hostname
host <- takeWhile (/='.') <$> readProcess "hostname" [] []
-- don't use the `time` package, major api differences between ghc 708 and 710
time <- head . lines <$> readProcess "date" ["+%Y-%m-%dT%H-%M-%S"] []
let dir = "tests" </> "logs" </> host ++ "-" ++ time
let path = dir </> "summary.csv"
renameDirectory "tests/logs/cur" dir
writeFile path $ unlines
$ "test, time(s), result"
: map (\(n, t, r) -> printf "%s, %0.4f, %s" n t (show r)) summary
(==0) <$> computeFailures smap | 2,377 | loggingTestReporter = TestReporter [] $ \opts tree -> Just $ \smap -> do
let
runTest _ testName _ = Traversal $ Functor.Compose $ do
i <- State.get
summary <- lift $ STM.atomically $ do
status <- STM.readTVar $
fromMaybe (error "Attempted to lookup test by index outside bounds") $
IntMap.lookup i smap
let mkSuccess time = [(testName, time, True)]
mkFailure time = [(testName, time, False)]
case status of
-- If the test is done, generate a summary for it
Done result
| resultSuccessful result
-> pure (mkSuccess (resultTime result))
| otherwise
-> pure (mkFailure (resultTime result))
-- Otherwise the test has either not been started or is currently
-- executing
_ -> STM.retry
Const summary <$ State.modify (+ 1)
runGroup group children = Traversal $ Functor.Compose $ do
Const soFar <- Functor.getCompose $ getTraversal children
pure $ Const $ map (\(n,t,s) -> (group</>n,t,s)) soFar
computeFailures :: StatusMap -> IO Int
computeFailures = fmap getSum . getApp . foldMap (\var -> Ap $
(\r -> Sum $ if resultSuccessful r then 0 else 1) <$> getResultFromTVar var)
getResultFromTVar :: STM.TVar Status -> IO Result
getResultFromTVar var =
STM.atomically $ do
status <- STM.readTVar var
case status of
Done r -> return r
_ -> STM.retry
(Const summary, _tests) <-
flip State.runStateT 0 $ Functor.getCompose $ getTraversal $
foldTestTree
trivialFold { foldSingle = runTest, foldGroup = runGroup }
opts
tree
return $ \_elapsedTime -> do
-- get some semblance of a hostname
host <- takeWhile (/='.') <$> readProcess "hostname" [] []
-- don't use the `time` package, major api differences between ghc 708 and 710
time <- head . lines <$> readProcess "date" ["+%Y-%m-%dT%H-%M-%S"] []
let dir = "tests" </> "logs" </> host ++ "-" ++ time
let path = dir </> "summary.csv"
renameDirectory "tests/logs/cur" dir
writeFile path $ unlines
$ "test, time(s), result"
: map (\(n, t, r) -> printf "%s, %0.4f, %s" n t (show r)) summary
(==0) <$> computeFailures smap | 2,377 | true | false | 1 | 29 | 758 | 731 | 361 | 370 | null | null |
bjpop/berp | libs/src/Berp/Base/TopLevel.hs | bsd-3-clause | run :: (HashTable -> Eval Object) -> Prelude.IO ()
run comp = do
globals <- HashTable.empty
runWithGlobals globals comp
{-
builtins <- HashTable.empty
_ <- runEval (initState builtins) (initBuiltins builtins >> comp globalScope)
return ()
-} | 257 | run :: (HashTable -> Eval Object) -> Prelude.IO ()
run comp = do
globals <- HashTable.empty
runWithGlobals globals comp
{-
builtins <- HashTable.empty
_ <- runEval (initState builtins) (initBuiltins builtins >> comp globalScope)
return ()
-} | 257 | run comp = do
globals <- HashTable.empty
runWithGlobals globals comp
{-
builtins <- HashTable.empty
_ <- runEval (initState builtins) (initBuiltins builtins >> comp globalScope)
return ()
-} | 206 | false | true | 0 | 9 | 51 | 57 | 26 | 31 | null | null |
fmapfmapfmap/amazonka | amazonka-iam/gen/Network/AWS/IAM/RemoveClientIdFromOpenIdConnectProvider.hs | mpl-2.0 | -- | Creates a value of 'RemoveClientIdFromOpenIdConnectProvider' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'rcifoicpOpenIdConnectProviderARN'
--
-- * 'rcifoicpClientId'
removeClientIdFromOpenIdConnectProvider
:: Text -- ^ 'rcifoicpOpenIdConnectProviderARN'
-> Text -- ^ 'rcifoicpClientId'
-> RemoveClientIdFromOpenIdConnectProvider
removeClientIdFromOpenIdConnectProvider pOpenIdConnectProviderARN_ pClientId_ =
RemoveClientIdFromOpenIdConnectProvider'
{ _rcifoicpOpenIdConnectProviderARN = pOpenIdConnectProviderARN_
, _rcifoicpClientId = pClientId_
} | 672 | removeClientIdFromOpenIdConnectProvider
:: Text -- ^ 'rcifoicpOpenIdConnectProviderARN'
-> Text -- ^ 'rcifoicpClientId'
-> RemoveClientIdFromOpenIdConnectProvider
removeClientIdFromOpenIdConnectProvider pOpenIdConnectProviderARN_ pClientId_ =
RemoveClientIdFromOpenIdConnectProvider'
{ _rcifoicpOpenIdConnectProviderARN = pOpenIdConnectProviderARN_
, _rcifoicpClientId = pClientId_
} | 411 | removeClientIdFromOpenIdConnectProvider pOpenIdConnectProviderARN_ pClientId_ =
RemoveClientIdFromOpenIdConnectProvider'
{ _rcifoicpOpenIdConnectProviderARN = pOpenIdConnectProviderARN_
, _rcifoicpClientId = pClientId_
} | 236 | true | true | 0 | 8 | 92 | 56 | 32 | 24 | null | null |
beni55/ghcjs | src/Compiler/Program.hs | mit | -- isInterpretiveMode: byte-code compiler involved
isInterpretiveMode :: PostLoadMode -> Bool
isInterpretiveMode DoInteractive = True | 133 | isInterpretiveMode :: PostLoadMode -> Bool
isInterpretiveMode DoInteractive = True | 82 | isInterpretiveMode DoInteractive = True | 39 | true | true | 0 | 5 | 13 | 19 | 10 | 9 | null | null |
briansteffens/basm | src/Shared.hs | gpl-2.0 | fromRight :: Either a b -> b
fromRight (Right r) = r | 52 | fromRight :: Either a b -> b
fromRight (Right r) = r | 52 | fromRight (Right r) = r | 23 | false | true | 0 | 7 | 11 | 29 | 14 | 15 | null | null |
EdisonAlgorithms/HackerRank | practice/fp/recursion/super-digit/super-digit.hs | mit | superDigit :: String -> String
superDigit x = if length x == 1 then x
else superDigit $ digitSum x | 113 | superDigit :: String -> String
superDigit x = if length x == 1 then x
else superDigit $ digitSum x | 113 | superDigit x = if length x == 1 then x
else superDigit $ digitSum x | 82 | false | true | 2 | 7 | 34 | 47 | 21 | 26 | null | null |
uuhan/Idris-dev | src/Idris/Core/WHNF.hs | bsd-3-clause | -- | Reduce a type so that all arguments are expanded
whnfArgs :: Context -> Env -> Term -> Term
whnfArgs ctxt env tm = inlineSmall ctxt env $ finalise (whnfArgs' ctxt env tm) | 175 | whnfArgs :: Context -> Env -> Term -> Term
whnfArgs ctxt env tm = inlineSmall ctxt env $ finalise (whnfArgs' ctxt env tm) | 121 | whnfArgs ctxt env tm = inlineSmall ctxt env $ finalise (whnfArgs' ctxt env tm) | 78 | true | true | 0 | 8 | 33 | 57 | 27 | 30 | null | null |
green-haskell/ghc | compiler/simplCore/OccurAnal.hs | bsd-3-clause | -- do not do binder swap
occurAnalyseExpr' :: Bool -> CoreExpr -> CoreExpr
occurAnalyseExpr' enable_binder_swap expr
= snd (occAnal env expr)
where
env = (initOccEnv all_active_rules) {occ_binder_swap = enable_binder_swap}
-- To be conservative, we say that all inlines and rules are active
all_active_rules = \_ -> True
{-
************************************************************************
* *
\subsection[OccurAnal-main]{Counting occurrences: main function}
* *
************************************************************************
Bindings
~~~~~~~~
-} | 720 | occurAnalyseExpr' :: Bool -> CoreExpr -> CoreExpr
occurAnalyseExpr' enable_binder_swap expr
= snd (occAnal env expr)
where
env = (initOccEnv all_active_rules) {occ_binder_swap = enable_binder_swap}
-- To be conservative, we say that all inlines and rules are active
all_active_rules = \_ -> True
{-
************************************************************************
* *
\subsection[OccurAnal-main]{Counting occurrences: main function}
* *
************************************************************************
Bindings
~~~~~~~~
-} | 694 | occurAnalyseExpr' enable_binder_swap expr
= snd (occAnal env expr)
where
env = (initOccEnv all_active_rules) {occ_binder_swap = enable_binder_swap}
-- To be conservative, we say that all inlines and rules are active
all_active_rules = \_ -> True
{-
************************************************************************
* *
\subsection[OccurAnal-main]{Counting occurrences: main function}
* *
************************************************************************
Bindings
~~~~~~~~
-} | 644 | true | true | 0 | 7 | 217 | 70 | 38 | 32 | null | null |
ezyang/ghc | compiler/main/GhcMake.hs | bsd-3-clause | -- | Tests if an 'HscSource' is a boot file, primarily for constructing
-- elements of 'BuildModule'.
hscSourceToIsBoot :: HscSource -> IsBoot
hscSourceToIsBoot HsBootFile = IsBoot | 180 | hscSourceToIsBoot :: HscSource -> IsBoot
hscSourceToIsBoot HsBootFile = IsBoot | 78 | hscSourceToIsBoot HsBootFile = IsBoot | 37 | true | true | 0 | 5 | 25 | 20 | 11 | 9 | null | null |
aaronc/Idris-dev | src/Idris/CaseSplit.hs | bsd-3-clause | -- mapPT tidyVar tm
-- where tidyVar (PRef _ _) = Placeholder
-- tidyVar t = t
elabNewPat :: PTerm -> Idris (Bool, PTerm)
elabNewPat t = idrisCatch (do (tm, ty) <- elabVal recinfo ELHS t
i <- getIState
return (True, delab i tm))
(\e -> do i <- getIState
logElab 5 $ "Not a valid split:\n" ++ pshow i e
return (False, t)) | 489 | elabNewPat :: PTerm -> Idris (Bool, PTerm)
elabNewPat t = idrisCatch (do (tm, ty) <- elabVal recinfo ELHS t
i <- getIState
return (True, delab i tm))
(\e -> do i <- getIState
logElab 5 $ "Not a valid split:\n" ++ pshow i e
return (False, t)) | 399 | elabNewPat t = idrisCatch (do (tm, ty) <- elabVal recinfo ELHS t
i <- getIState
return (True, delab i tm))
(\e -> do i <- getIState
logElab 5 $ "Not a valid split:\n" ++ pshow i e
return (False, t)) | 356 | true | true | 0 | 12 | 232 | 131 | 65 | 66 | null | null |
JustinUnger/haskell-book | ch9/Cipher.hs | mit | caeser :: Int -> String -> String
caeser _ [] = [] | 50 | caeser :: Int -> String -> String
caeser _ [] = [] | 50 | caeser _ [] = [] | 16 | false | true | 0 | 6 | 11 | 28 | 14 | 14 | null | null |
unisonweb/platform | parser-typechecker/src/Unison/Typechecker/Context.hs | mit | _logContext :: (Ord loc, Var v) => String -> M v loc ()
_logContext msg = when debugEnabled $ do
ctx <- getContext
let !_ = trace ("\n"++msg ++ ": " ++ show ctx) ()
setContext ctx | 185 | _logContext :: (Ord loc, Var v) => String -> M v loc ()
_logContext msg = when debugEnabled $ do
ctx <- getContext
let !_ = trace ("\n"++msg ++ ": " ++ show ctx) ()
setContext ctx | 185 | _logContext msg = when debugEnabled $ do
ctx <- getContext
let !_ = trace ("\n"++msg ++ ": " ++ show ctx) ()
setContext ctx | 129 | false | true | 0 | 15 | 42 | 98 | 45 | 53 | null | null |
danr/hipspec | testsuite/prod/Properties.hs | gpl-3.0 | prop_T30 :: [a] -> Prop [a]
prop_T30 x = rev (rev x ++ []) =:= x | 64 | prop_T30 :: [a] -> Prop [a]
prop_T30 x = rev (rev x ++ []) =:= x | 64 | prop_T30 x = rev (rev x ++ []) =:= x | 36 | false | true | 1 | 8 | 15 | 54 | 25 | 29 | null | null |
tjunier/mlgsc | test/TestAlign.hs | mit | input13 = "ELVTLLDEYISNQSDMEVIGTAYNGQDCLHMLEEKQPDILILDIIMPHLDGLAVLEKVRTSFEHQPNVIMLTAFGQEDVTKKAVELGASYFILKPFDMENLVHHIRQIYG" | 122 | input13 = "ELVTLLDEYISNQSDMEVIGTAYNGQDCLHMLEEKQPDILILDIIMPHLDGLAVLEKVRTSFEHQPNVIMLTAFGQEDVTKKAVELGASYFILKPFDMENLVHHIRQIYG" | 122 | input13 = "ELVTLLDEYISNQSDMEVIGTAYNGQDCLHMLEEKQPDILILDIIMPHLDGLAVLEKVRTSFEHQPNVIMLTAFGQEDVTKKAVELGASYFILKPFDMENLVHHIRQIYG" | 122 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
clojj/hsedit | src/EditRope.hs | bsd-3-clause | -- charAtCursor :: (Int, Int) -> Y.YiString -> Maybe String
-- charAtCursor (column, line) s =
-- let toRight = snd $ Y.splitAt column (snd $ Y.splitAtLine line s)
-- in fmap (replicate 1) (Y.head toRight)
mkLocatedToken :: Int -> Int -> Int -> Int -> GHC.Token -> GHC.Located GHC.Token
mkLocatedToken lin1 col1 lin2 col2 =
GHC.L (GHC.mkSrcSpan
(GHC.mkSrcLoc (GHC.fsLit "") lin1 col1)
(GHC.mkSrcLoc (GHC.fsLit "") lin2 col2)) | 442 | mkLocatedToken :: Int -> Int -> Int -> Int -> GHC.Token -> GHC.Located GHC.Token
mkLocatedToken lin1 col1 lin2 col2 =
GHC.L (GHC.mkSrcSpan
(GHC.mkSrcLoc (GHC.fsLit "") lin1 col1)
(GHC.mkSrcLoc (GHC.fsLit "") lin2 col2)) | 231 | mkLocatedToken lin1 col1 lin2 col2 =
GHC.L (GHC.mkSrcSpan
(GHC.mkSrcLoc (GHC.fsLit "") lin1 col1)
(GHC.mkSrcLoc (GHC.fsLit "") lin2 col2)) | 150 | true | true | 0 | 12 | 84 | 108 | 55 | 53 | null | null |
thSoft/elm-lang.org | server/Server.hs | bsd-3-clause | precompile :: IO ()
precompile =
do setCurrentDirectory "public"
files <- getFiles True ".elm" "."
forM_ files $ \file -> do
rawSystem "elm" ["--make","--runtime=/elm-runtime.js?v0.10",file]
htmls <- getFiles False ".html" "build"
mapM_ adjustHtmlFile htmls
setCurrentDirectory ".."
where
getFiles :: Bool -> String -> FilePath -> IO [FilePath]
getFiles skip ext dir = do
case skip && "build" `elem` map dropTrailingPathSeparator (splitPath dir) of
True -> return []
False -> do
contents <- map (dir </>) `fmap` getDirectoryContents dir
let files = filter ((ext==) . takeExtension) contents
dirs = filter (not . hasExtension) contents
filess <- mapM (getFiles skip ext) dirs
return (files ++ concat filess) | 843 | precompile :: IO ()
precompile =
do setCurrentDirectory "public"
files <- getFiles True ".elm" "."
forM_ files $ \file -> do
rawSystem "elm" ["--make","--runtime=/elm-runtime.js?v0.10",file]
htmls <- getFiles False ".html" "build"
mapM_ adjustHtmlFile htmls
setCurrentDirectory ".."
where
getFiles :: Bool -> String -> FilePath -> IO [FilePath]
getFiles skip ext dir = do
case skip && "build" `elem` map dropTrailingPathSeparator (splitPath dir) of
True -> return []
False -> do
contents <- map (dir </>) `fmap` getDirectoryContents dir
let files = filter ((ext==) . takeExtension) contents
dirs = filter (not . hasExtension) contents
filess <- mapM (getFiles skip ext) dirs
return (files ++ concat filess) | 843 | precompile =
do setCurrentDirectory "public"
files <- getFiles True ".elm" "."
forM_ files $ \file -> do
rawSystem "elm" ["--make","--runtime=/elm-runtime.js?v0.10",file]
htmls <- getFiles False ".html" "build"
mapM_ adjustHtmlFile htmls
setCurrentDirectory ".."
where
getFiles :: Bool -> String -> FilePath -> IO [FilePath]
getFiles skip ext dir = do
case skip && "build" `elem` map dropTrailingPathSeparator (splitPath dir) of
True -> return []
False -> do
contents <- map (dir </>) `fmap` getDirectoryContents dir
let files = filter ((ext==) . takeExtension) contents
dirs = filter (not . hasExtension) contents
filess <- mapM (getFiles skip ext) dirs
return (files ++ concat filess) | 823 | false | true | 0 | 20 | 240 | 291 | 136 | 155 | null | null |
sdiehl/ghc | compiler/GHC/Stg/Lift/Monad.hs | bsd-3-clause | -- | Whether the given binding was decided to be lambda lifted.
isLifted :: InId -> LiftM Bool
isLifted bndr = LiftM (RWS.asks (elemVarEnv bndr . e_expansions)) | 160 | isLifted :: InId -> LiftM Bool
isLifted bndr = LiftM (RWS.asks (elemVarEnv bndr . e_expansions)) | 96 | isLifted bndr = LiftM (RWS.asks (elemVarEnv bndr . e_expansions)) | 65 | true | true | 0 | 10 | 26 | 43 | 21 | 22 | null | null |
llvm-hs/llvm-hs-pretty | Example.hs | mit | block :: BasicBlock
block = BasicBlock
(Name "entry")
[ Name "result" :=
Add False
False
(LocalReference int (Name "a"))
(LocalReference int (Name "b"))
[] ]
(Do $ Ret (Just (LocalReference int (Name "result"))) []) | 283 | block :: BasicBlock
block = BasicBlock
(Name "entry")
[ Name "result" :=
Add False
False
(LocalReference int (Name "a"))
(LocalReference int (Name "b"))
[] ]
(Do $ Ret (Just (LocalReference int (Name "result"))) []) | 283 | block = BasicBlock
(Name "entry")
[ Name "result" :=
Add False
False
(LocalReference int (Name "a"))
(LocalReference int (Name "b"))
[] ]
(Do $ Ret (Just (LocalReference int (Name "result"))) []) | 263 | false | true | 0 | 14 | 101 | 109 | 54 | 55 | null | null |
Mortomes/wyah | src/peanogrammar.hs | gpl-3.0 | langDef :: Tok.LanguageDef ()
langDef = Tok.LanguageDef
{ Tok.commentStart = "{-"
, Tok.commentEnd = "-}"
, Tok.commentLine = "--"
, Tok.nestedComments = True
, Tok.identStart = letter
, Tok.identLetter = alphaNum <|> oneOf "_'"
, Tok.opStart = oneOf ":!#$%&*+./<=>?@\\^|-~"
, Tok.opLetter = oneOf ":!#$%&*+./<=>?@\\^|-~"
, Tok.reservedNames = reservedNames
, Tok.reservedOpNames = reservedOps
, Tok.caseSensitive = True
} | 446 | langDef :: Tok.LanguageDef ()
langDef = Tok.LanguageDef
{ Tok.commentStart = "{-"
, Tok.commentEnd = "-}"
, Tok.commentLine = "--"
, Tok.nestedComments = True
, Tok.identStart = letter
, Tok.identLetter = alphaNum <|> oneOf "_'"
, Tok.opStart = oneOf ":!#$%&*+./<=>?@\\^|-~"
, Tok.opLetter = oneOf ":!#$%&*+./<=>?@\\^|-~"
, Tok.reservedNames = reservedNames
, Tok.reservedOpNames = reservedOps
, Tok.caseSensitive = True
} | 446 | langDef = Tok.LanguageDef
{ Tok.commentStart = "{-"
, Tok.commentEnd = "-}"
, Tok.commentLine = "--"
, Tok.nestedComments = True
, Tok.identStart = letter
, Tok.identLetter = alphaNum <|> oneOf "_'"
, Tok.opStart = oneOf ":!#$%&*+./<=>?@\\^|-~"
, Tok.opLetter = oneOf ":!#$%&*+./<=>?@\\^|-~"
, Tok.reservedNames = reservedNames
, Tok.reservedOpNames = reservedOps
, Tok.caseSensitive = True
} | 416 | false | true | 0 | 9 | 80 | 127 | 72 | 55 | null | null |
DaMSL/K3 | test/Language/K3/Runtime/Dataspace/Test.hs | apache-2.0 | testEmptyFold :: (Dataspace Interpretation ds Value) => ds -> () -> Interpretation Bool
testEmptyFold dataspace _ = do
d <- emptyDS (Just dataspace)
counter <- foldDS innerFold 0 d
return (counter == 0 )
where
innerFold :: Int -> Value -> Interpretation Int
innerFold cnt _ = return $ cnt + 1 | 308 | testEmptyFold :: (Dataspace Interpretation ds Value) => ds -> () -> Interpretation Bool
testEmptyFold dataspace _ = do
d <- emptyDS (Just dataspace)
counter <- foldDS innerFold 0 d
return (counter == 0 )
where
innerFold :: Int -> Value -> Interpretation Int
innerFold cnt _ = return $ cnt + 1 | 308 | testEmptyFold dataspace _ = do
d <- emptyDS (Just dataspace)
counter <- foldDS innerFold 0 d
return (counter == 0 )
where
innerFold :: Int -> Value -> Interpretation Int
innerFold cnt _ = return $ cnt + 1 | 220 | false | true | 3 | 10 | 67 | 121 | 58 | 63 | null | null |
nikivazou/hscolour | Language/Haskell/HsColour/InlineCSS.hs | gpl-2.0 | style Bold = "font-weight: bold;" | 43 | style Bold = "font-weight: bold;" | 43 | style Bold = "font-weight: bold;" | 43 | false | false | 0 | 4 | 14 | 10 | 4 | 6 | null | null |
peterokagey/haskellOEIS | src/Sandbox/OEIS/FigurateSums.hs | apache-2.0 | a287960_list :: [Integer]
a287960_list = sumOfTwo centeredTriangles where
centeredTriangles = map (\n -> 3*n*(n-1) `div` 2 + 1) [1..] | 135 | a287960_list :: [Integer]
a287960_list = sumOfTwo centeredTriangles where
centeredTriangles = map (\n -> 3*n*(n-1) `div` 2 + 1) [1..] | 135 | a287960_list = sumOfTwo centeredTriangles where
centeredTriangles = map (\n -> 3*n*(n-1) `div` 2 + 1) [1..] | 109 | false | true | 0 | 14 | 20 | 71 | 37 | 34 | null | null |
abakst/liquidhaskell | benchmarks/base-4.5.1.0/Control/Exception/Base.hs | bsd-3-clause | handle :: Exception e => (e -> IO a) -> IO a -> IO a
handle = flip catch | 81 | handle :: Exception e => (e -> IO a) -> IO a -> IO a
handle = flip catch | 81 | handle = flip catch | 24 | false | true | 0 | 10 | 27 | 51 | 22 | 29 | null | null |
sapek/pandoc | src/Text/Pandoc/Readers/LaTeX.hs | gpl-2.0 | rawLaTeXBlock :: Parser [Char] ParserState String
rawLaTeXBlock = snd <$> try (withRaw (environment <|> blockCommand)) | 118 | rawLaTeXBlock :: Parser [Char] ParserState String
rawLaTeXBlock = snd <$> try (withRaw (environment <|> blockCommand)) | 118 | rawLaTeXBlock = snd <$> try (withRaw (environment <|> blockCommand)) | 68 | false | true | 0 | 10 | 14 | 41 | 21 | 20 | null | null |
julienschmaltz/madl | src/Parser/MadlTypeChecker.hs | mit | typecheckIntegerExpression :: Context -> WithSourceInfo IntegerExpression -> Checked IntegerExpression
typecheckIntegerExpression context integerexpression = case removeSourceInfo integerexpression of
i@IntegerNumber{} -> Right i
i@(IntegerVariable name) -> case isIntegerVariableDeclared context name of
True -> Right i
False -> Left . setSource $ UndeclaredIntegerParameterError name
IntegerBinary op left right -> liftM2 (IntegerBinary op) checkedLeft checkedRight where
checkedLeft = typecheckIntegerExpression context $ setSource left
checkedRight = typecheckIntegerExpression context $ setSource right
where
setSource = flip setSourceInfo integerexpression
-- | Checks if the given @IntegerExpression@ is a valid expression that evaluates to a constant | 816 | typecheckIntegerExpression :: Context -> WithSourceInfo IntegerExpression -> Checked IntegerExpression
typecheckIntegerExpression context integerexpression = case removeSourceInfo integerexpression of
i@IntegerNumber{} -> Right i
i@(IntegerVariable name) -> case isIntegerVariableDeclared context name of
True -> Right i
False -> Left . setSource $ UndeclaredIntegerParameterError name
IntegerBinary op left right -> liftM2 (IntegerBinary op) checkedLeft checkedRight where
checkedLeft = typecheckIntegerExpression context $ setSource left
checkedRight = typecheckIntegerExpression context $ setSource right
where
setSource = flip setSourceInfo integerexpression
-- | Checks if the given @IntegerExpression@ is a valid expression that evaluates to a constant | 816 | typecheckIntegerExpression context integerexpression = case removeSourceInfo integerexpression of
i@IntegerNumber{} -> Right i
i@(IntegerVariable name) -> case isIntegerVariableDeclared context name of
True -> Right i
False -> Left . setSource $ UndeclaredIntegerParameterError name
IntegerBinary op left right -> liftM2 (IntegerBinary op) checkedLeft checkedRight where
checkedLeft = typecheckIntegerExpression context $ setSource left
checkedRight = typecheckIntegerExpression context $ setSource right
where
setSource = flip setSourceInfo integerexpression
-- | Checks if the given @IntegerExpression@ is a valid expression that evaluates to a constant | 713 | false | true | 0 | 12 | 145 | 174 | 83 | 91 | null | null |
vdweegen/UvA-Software_Testing | Lab1/Cas/Exercises.hs | gpl-3.0 | result8 = do
print "Guilty"
print guilty
print "Honest"
print honest | 76 | result8 = do
print "Guilty"
print guilty
print "Honest"
print honest | 76 | result8 = do
print "Guilty"
print guilty
print "Honest"
print honest | 76 | false | false | 1 | 8 | 18 | 34 | 11 | 23 | null | null |
brendanhay/gogol | gogol-tracing/gen/Network/Google/Tracing/Types/Product.hs | mpl-2.0 | -- | Description of the operation in the span. It is sanitized and displayed
-- in the Stackdriver Trace tool in the {% dynamic print
-- site_values.console_name %}. The display_name may be a method name or
-- some other per-call site name. For the same executable and the same call
-- point, a best practice is to use a consistent operation name, which
-- makes it easier to correlate cross-trace spans. The maximum length for
-- the display_name is 128 bytes.
sDisplayName :: Lens' Span (Maybe TruncatableString)
sDisplayName
= lens _sDisplayName (\ s a -> s{_sDisplayName = a}) | 582 | sDisplayName :: Lens' Span (Maybe TruncatableString)
sDisplayName
= lens _sDisplayName (\ s a -> s{_sDisplayName = a}) | 120 | sDisplayName
= lens _sDisplayName (\ s a -> s{_sDisplayName = a}) | 67 | true | true | 1 | 9 | 99 | 58 | 31 | 27 | null | null |
AlexanderPankiv/ghc | compiler/simplCore/CoreMonad.hs | bsd-3-clause | tickToTag (CaseOfCase _) = 8 | 43 | tickToTag (CaseOfCase _) = 8 | 43 | tickToTag (CaseOfCase _) = 8 | 43 | false | false | 0 | 7 | 19 | 15 | 7 | 8 | null | null |
yesodweb/shakespeare | Text/Shakespeare/Base.hs | mit | parseDeref :: UserParser a Deref
parseDeref = do
skipMany (oneOf " \t")
derefList <|> derefTuple <|> derefOther
where
derefOther = do
x <- derefSingle
derefInfix x <|> derefPrefix x
delim = (many1 (char ' ') >> return())
<|> lookAhead (oneOf "(\"" >> return ())
derefOp = try $ do
_ <- char '('
x <- many1 $ noneOf " \t\n\r()"
_ <- char ')'
return $ DerefIdent $ Ident x
-- See: http://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-160002.2
isOperatorChar c
| isAscii c = c `elem` "!#$%&*+./<=>?@\\^|-~:"
| otherwise = isSymbol c || isPunctuation c
derefPrefix x = do
res <- deref' $ (:) x
skipMany $ oneOf " \t"
return res
derefInfix x = try $ do
_ <- delim
xs <- many $ try $ derefSingle >>= \x' -> delim >> return x'
op <- many1 (satisfy isOperatorChar) <?> "operator"
-- special handling for $, which we don't deal with
when (op == "$") $ fail "don't handle $"
let op' = DerefIdent $ Ident op
ys <- many1 $ try $ delim >> derefSingle
skipMany $ oneOf " \t"
return $ DerefBranch (DerefBranch op' $ foldl1 DerefBranch $ x : xs) (foldl1 DerefBranch ys)
derefSingle = derefTuple <|> derefList <|> derefOp <|> derefParens <|> numeric <|> strLit <|> ident
deref' lhs =
dollar <|> derefSingle'
<|> return (foldl1 DerefBranch $ lhs [])
where
dollar = do
_ <- try $ delim >> char '$'
rhs <- parseDeref
let lhs' = foldl1 DerefBranch $ lhs []
return $ DerefBranch lhs' rhs
derefSingle' = do
x <- try $ delim >> derefSingle
deref' $ lhs . (:) x
numeric = do
n <- (char '-' >> return "-") <|> return ""
x <- many1 digit
y <- (char '.' >> fmap Just (many1 digit)) <|> return Nothing
return $ case y of
Nothing -> DerefIntegral $ read' "Integral" $ n ++ x
Just z -> DerefRational $ toRational
(read' "Rational" $ n ++ x ++ '.' : z :: Double)
strLit = do
_ <- char '"'
chars <- many quotedChar
_ <- char '"'
return $ DerefString chars
quotedChar = (char '\\' >> escapedChar) <|> noneOf "\""
escapedChar =
let cecs = [('n', '\n'), ('r', '\r'), ('b', '\b'), ('t', '\t')
,('\\', '\\'), ('"', '"'), ('\'', '\'')]
in choice [ char c >> return ec | (c, ec) <- cecs]
ident = do
mods <- many modul
func <- many1 (alphaNum <|> char '_' <|> char '\'')
let func' = Ident func
return $
if null mods
then DerefIdent func'
else DerefModulesIdent mods func'
modul = try $ do
c <- upper
cs <- many (alphaNum <|> char '_')
_ <- char '.'
return $ c : cs | 2,970 | parseDeref :: UserParser a Deref
parseDeref = do
skipMany (oneOf " \t")
derefList <|> derefTuple <|> derefOther
where
derefOther = do
x <- derefSingle
derefInfix x <|> derefPrefix x
delim = (many1 (char ' ') >> return())
<|> lookAhead (oneOf "(\"" >> return ())
derefOp = try $ do
_ <- char '('
x <- many1 $ noneOf " \t\n\r()"
_ <- char ')'
return $ DerefIdent $ Ident x
-- See: http://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-160002.2
isOperatorChar c
| isAscii c = c `elem` "!#$%&*+./<=>?@\\^|-~:"
| otherwise = isSymbol c || isPunctuation c
derefPrefix x = do
res <- deref' $ (:) x
skipMany $ oneOf " \t"
return res
derefInfix x = try $ do
_ <- delim
xs <- many $ try $ derefSingle >>= \x' -> delim >> return x'
op <- many1 (satisfy isOperatorChar) <?> "operator"
-- special handling for $, which we don't deal with
when (op == "$") $ fail "don't handle $"
let op' = DerefIdent $ Ident op
ys <- many1 $ try $ delim >> derefSingle
skipMany $ oneOf " \t"
return $ DerefBranch (DerefBranch op' $ foldl1 DerefBranch $ x : xs) (foldl1 DerefBranch ys)
derefSingle = derefTuple <|> derefList <|> derefOp <|> derefParens <|> numeric <|> strLit <|> ident
deref' lhs =
dollar <|> derefSingle'
<|> return (foldl1 DerefBranch $ lhs [])
where
dollar = do
_ <- try $ delim >> char '$'
rhs <- parseDeref
let lhs' = foldl1 DerefBranch $ lhs []
return $ DerefBranch lhs' rhs
derefSingle' = do
x <- try $ delim >> derefSingle
deref' $ lhs . (:) x
numeric = do
n <- (char '-' >> return "-") <|> return ""
x <- many1 digit
y <- (char '.' >> fmap Just (many1 digit)) <|> return Nothing
return $ case y of
Nothing -> DerefIntegral $ read' "Integral" $ n ++ x
Just z -> DerefRational $ toRational
(read' "Rational" $ n ++ x ++ '.' : z :: Double)
strLit = do
_ <- char '"'
chars <- many quotedChar
_ <- char '"'
return $ DerefString chars
quotedChar = (char '\\' >> escapedChar) <|> noneOf "\""
escapedChar =
let cecs = [('n', '\n'), ('r', '\r'), ('b', '\b'), ('t', '\t')
,('\\', '\\'), ('"', '"'), ('\'', '\'')]
in choice [ char c >> return ec | (c, ec) <- cecs]
ident = do
mods <- many modul
func <- many1 (alphaNum <|> char '_' <|> char '\'')
let func' = Ident func
return $
if null mods
then DerefIdent func'
else DerefModulesIdent mods func'
modul = try $ do
c <- upper
cs <- many (alphaNum <|> char '_')
_ <- char '.'
return $ c : cs | 2,970 | parseDeref = do
skipMany (oneOf " \t")
derefList <|> derefTuple <|> derefOther
where
derefOther = do
x <- derefSingle
derefInfix x <|> derefPrefix x
delim = (many1 (char ' ') >> return())
<|> lookAhead (oneOf "(\"" >> return ())
derefOp = try $ do
_ <- char '('
x <- many1 $ noneOf " \t\n\r()"
_ <- char ')'
return $ DerefIdent $ Ident x
-- See: http://www.haskell.org/onlinereport/haskell2010/haskellch2.html#x7-160002.2
isOperatorChar c
| isAscii c = c `elem` "!#$%&*+./<=>?@\\^|-~:"
| otherwise = isSymbol c || isPunctuation c
derefPrefix x = do
res <- deref' $ (:) x
skipMany $ oneOf " \t"
return res
derefInfix x = try $ do
_ <- delim
xs <- many $ try $ derefSingle >>= \x' -> delim >> return x'
op <- many1 (satisfy isOperatorChar) <?> "operator"
-- special handling for $, which we don't deal with
when (op == "$") $ fail "don't handle $"
let op' = DerefIdent $ Ident op
ys <- many1 $ try $ delim >> derefSingle
skipMany $ oneOf " \t"
return $ DerefBranch (DerefBranch op' $ foldl1 DerefBranch $ x : xs) (foldl1 DerefBranch ys)
derefSingle = derefTuple <|> derefList <|> derefOp <|> derefParens <|> numeric <|> strLit <|> ident
deref' lhs =
dollar <|> derefSingle'
<|> return (foldl1 DerefBranch $ lhs [])
where
dollar = do
_ <- try $ delim >> char '$'
rhs <- parseDeref
let lhs' = foldl1 DerefBranch $ lhs []
return $ DerefBranch lhs' rhs
derefSingle' = do
x <- try $ delim >> derefSingle
deref' $ lhs . (:) x
numeric = do
n <- (char '-' >> return "-") <|> return ""
x <- many1 digit
y <- (char '.' >> fmap Just (many1 digit)) <|> return Nothing
return $ case y of
Nothing -> DerefIntegral $ read' "Integral" $ n ++ x
Just z -> DerefRational $ toRational
(read' "Rational" $ n ++ x ++ '.' : z :: Double)
strLit = do
_ <- char '"'
chars <- many quotedChar
_ <- char '"'
return $ DerefString chars
quotedChar = (char '\\' >> escapedChar) <|> noneOf "\""
escapedChar =
let cecs = [('n', '\n'), ('r', '\r'), ('b', '\b'), ('t', '\t')
,('\\', '\\'), ('"', '"'), ('\'', '\'')]
in choice [ char c >> return ec | (c, ec) <- cecs]
ident = do
mods <- many modul
func <- many1 (alphaNum <|> char '_' <|> char '\'')
let func' = Ident func
return $
if null mods
then DerefIdent func'
else DerefModulesIdent mods func'
modul = try $ do
c <- upper
cs <- many (alphaNum <|> char '_')
_ <- char '.'
return $ c : cs | 2,937 | false | true | 0 | 18 | 1,076 | 1,059 | 503 | 556 | null | null |
sebastiaanvisser/ghc-goals | src/GhcGoals.hs | bsd-3-clause | defaultConfig :: Config
defaultConfig = Config
{ goalnames = []
, showVersion = False
} | 141 | defaultConfig :: Config
defaultConfig = Config
{ goalnames = []
, showVersion = False
} | 141 | defaultConfig = Config
{ goalnames = []
, showVersion = False
} | 117 | false | true | 0 | 8 | 68 | 37 | 18 | 19 | null | null |
arjunguha/haskell-couchdb | src/Database/CouchDB/Unsafe.hs | bsd-3-clause | queryView :: (JSON a)
=> String -- ^database
-> String -- ^design
-> String -- ^view
-> [(String, JSValue)] -- ^query parameters
-- |Returns a list of rows. Each row is a key, value pair.
-> CouchMonad [(JSString, a)]
queryView db viewSet view args = do
let args' = map (\(k,v) -> (k,encode v)) args
let url' = concat [db, "/_design/", viewSet, "/_view/", view]
r <- request url' args' GET [] ""
case rspCode r of
(2,0,0) -> do
let result = couchResponse (rspBody r)
let (JSArray rows) = fromJust $ lookup "rows" result
return $ map toRow rows
otherwise -> error (show r)
-- |Like 'queryView', but only returns the keys. Use this for key-only
-- views where the value is completely ignored. | 790 | queryView :: (JSON a)
=> String -- ^database
-> String -- ^design
-> String -- ^view
-> [(String, JSValue)] -- ^query parameters
-- |Returns a list of rows. Each row is a key, value pair.
-> CouchMonad [(JSString, a)]
queryView db viewSet view args = do
let args' = map (\(k,v) -> (k,encode v)) args
let url' = concat [db, "/_design/", viewSet, "/_view/", view]
r <- request url' args' GET [] ""
case rspCode r of
(2,0,0) -> do
let result = couchResponse (rspBody r)
let (JSArray rows) = fromJust $ lookup "rows" result
return $ map toRow rows
otherwise -> error (show r)
-- |Like 'queryView', but only returns the keys. Use this for key-only
-- views where the value is completely ignored. | 790 | queryView db viewSet view args = do
let args' = map (\(k,v) -> (k,encode v)) args
let url' = concat [db, "/_design/", viewSet, "/_view/", view]
r <- request url' args' GET [] ""
case rspCode r of
(2,0,0) -> do
let result = couchResponse (rspBody r)
let (JSArray rows) = fromJust $ lookup "rows" result
return $ map toRow rows
otherwise -> error (show r)
-- |Like 'queryView', but only returns the keys. Use this for key-only
-- views where the value is completely ignored. | 508 | false | true | 0 | 17 | 223 | 252 | 131 | 121 | null | null |
gridaphobe/ghc | compiler/types/Type.hs | bsd-3-clause | isPredTy :: Type -> Bool
-- NB: isPredTy is used when printing types, which can happen in debug printing
-- during type checking of not-fully-zonked types. So it's not cool to say
-- isConstraintKind (typeKind ty) because absent zonking the type might
-- be ill-kinded, and typeKind crashes
-- Hence the rather tiresome story here
--
-- NB: This must return "True" to *unlifted* coercions, which are not
-- of kind Constraint!
isPredTy ty = go ty []
where
go :: Type -> [KindOrType] -> Bool
go (AppTy ty1 ty2) args = go ty1 (ty2 : args)
go (TyConApp tc tys) args
| tc `hasKey` eqPrimTyConKey || tc `hasKey` eqReprPrimTyConKey
, [_,_,_,_] <- all_args
= True
| otherwise
= go_k (tyConKind tc) all_args
where
all_args = tys ++ args
go (TyVarTy tv) args = go_k (tyVarKind tv) args
go _ _ = False
go_k :: Kind -> [KindOrType] -> Bool
-- True <=> kind is k1 -> .. -> kn -> Constraint
go_k k [] = isConstraintKind k
go_k (ForAllTy bndr k1) (arg:args)
= go_k (substTyWithBinders [bndr] [arg] k1) args
go_k _ _ = False -- Typeable * Int :: Constraint | 1,215 | isPredTy :: Type -> Bool
isPredTy ty = go ty []
where
go :: Type -> [KindOrType] -> Bool
go (AppTy ty1 ty2) args = go ty1 (ty2 : args)
go (TyConApp tc tys) args
| tc `hasKey` eqPrimTyConKey || tc `hasKey` eqReprPrimTyConKey
, [_,_,_,_] <- all_args
= True
| otherwise
= go_k (tyConKind tc) all_args
where
all_args = tys ++ args
go (TyVarTy tv) args = go_k (tyVarKind tv) args
go _ _ = False
go_k :: Kind -> [KindOrType] -> Bool
-- True <=> kind is k1 -> .. -> kn -> Constraint
go_k k [] = isConstraintKind k
go_k (ForAllTy bndr k1) (arg:args)
= go_k (substTyWithBinders [bndr] [arg] k1) args
go_k _ _ = False -- Typeable * Int :: Constraint | 776 | isPredTy ty = go ty []
where
go :: Type -> [KindOrType] -> Bool
go (AppTy ty1 ty2) args = go ty1 (ty2 : args)
go (TyConApp tc tys) args
| tc `hasKey` eqPrimTyConKey || tc `hasKey` eqReprPrimTyConKey
, [_,_,_,_] <- all_args
= True
| otherwise
= go_k (tyConKind tc) all_args
where
all_args = tys ++ args
go (TyVarTy tv) args = go_k (tyVarKind tv) args
go _ _ = False
go_k :: Kind -> [KindOrType] -> Bool
-- True <=> kind is k1 -> .. -> kn -> Constraint
go_k k [] = isConstraintKind k
go_k (ForAllTy bndr k1) (arg:args)
= go_k (substTyWithBinders [bndr] [arg] k1) args
go_k _ _ = False -- Typeable * Int :: Constraint | 751 | true | true | 13 | 11 | 364 | 274 | 149 | 125 | null | null |
thinkpad20/rowling | test/Language/Rowling/EvaluatorSpec.hs | mit | main :: IO ()
main = hspec spec | 31 | main :: IO ()
main = hspec spec | 31 | main = hspec spec | 17 | false | true | 0 | 6 | 7 | 19 | 9 | 10 | null | null |
brendanhay/gogol | gogol-dataproc/gen/Network/Google/Resource/Dataproc/Projects/Regions/WorkflowTemplates/List.hs | mpl-2.0 | -- | JSONP
prwtlCallback :: Lens' ProjectsRegionsWorkflowTemplatesList (Maybe Text)
prwtlCallback
= lens _prwtlCallback
(\ s a -> s{_prwtlCallback = a}) | 160 | prwtlCallback :: Lens' ProjectsRegionsWorkflowTemplatesList (Maybe Text)
prwtlCallback
= lens _prwtlCallback
(\ s a -> s{_prwtlCallback = a}) | 149 | prwtlCallback
= lens _prwtlCallback
(\ s a -> s{_prwtlCallback = a}) | 76 | true | true | 1 | 9 | 27 | 51 | 25 | 26 | null | null |
abailly/hsgames | game-server/src/GameServer/Game.hs | apache-2.0 | lookupPlayerState :: Id -> Game -> Maybe PlayerState
lookupPlayerState pKey Game {gamePlayers} = Map.lookup pKey gamePlayers | 124 | lookupPlayerState :: Id -> Game -> Maybe PlayerState
lookupPlayerState pKey Game {gamePlayers} = Map.lookup pKey gamePlayers | 124 | lookupPlayerState pKey Game {gamePlayers} = Map.lookup pKey gamePlayers | 71 | false | true | 0 | 7 | 15 | 40 | 19 | 21 | null | null |
li-zhirui/EoplLangs | src/LetRecLang/Evaluator.hs | bsd-3-clause | evalLetRecExpr :: [(String, [String], Expression)] -> Expression -> Environment
-> EvaluateResult
evalLetRecExpr procsSubUnits recBody env =
valueOf recBody $ extendRecMany procsSubUnits env | 207 | evalLetRecExpr :: [(String, [String], Expression)] -> Expression -> Environment
-> EvaluateResult
evalLetRecExpr procsSubUnits recBody env =
valueOf recBody $ extendRecMany procsSubUnits env | 207 | evalLetRecExpr procsSubUnits recBody env =
valueOf recBody $ extendRecMany procsSubUnits env | 94 | false | true | 0 | 8 | 38 | 57 | 30 | 27 | null | null |
atwupack/LearnOpenGL | app/2_Lighting/5_Light-casters/Light-casters-directional.hs | bsd-3-clause | cubePositions :: [V3 GLfloat]
cubePositions = [
V3 0.0 0.0 0.0,
V3 2.0 5.0 (-15.0),
V3 (-1.5) (-2.2) (-2.5),
V3 (-3.8) (-2.0) (-12.3),
V3 2.4 (-0.4) (-3.5),
V3 (-1.7) 3.0 (-7.5),
V3 1.3 (-2.0) (-2.5),
V3 1.5 2.0 (-2.5),
V3 1.5 0.2 (-1.5),
V3 (-1.3) 1.0 (-1.5)] | 306 | cubePositions :: [V3 GLfloat]
cubePositions = [
V3 0.0 0.0 0.0,
V3 2.0 5.0 (-15.0),
V3 (-1.5) (-2.2) (-2.5),
V3 (-3.8) (-2.0) (-12.3),
V3 2.4 (-0.4) (-3.5),
V3 (-1.7) 3.0 (-7.5),
V3 1.3 (-2.0) (-2.5),
V3 1.5 2.0 (-2.5),
V3 1.5 0.2 (-1.5),
V3 (-1.3) 1.0 (-1.5)] | 306 | cubePositions = [
V3 0.0 0.0 0.0,
V3 2.0 5.0 (-15.0),
V3 (-1.5) (-2.2) (-2.5),
V3 (-3.8) (-2.0) (-12.3),
V3 2.4 (-0.4) (-3.5),
V3 (-1.7) 3.0 (-7.5),
V3 1.3 (-2.0) (-2.5),
V3 1.5 2.0 (-2.5),
V3 1.5 0.2 (-1.5),
V3 (-1.3) 1.0 (-1.5)] | 276 | false | true | 0 | 8 | 92 | 202 | 110 | 92 | null | null |
kristoff3r/importify | HLint.hs | mit | warn = (either (\_ -> pass ) f m) ==> Universum.whenRight m f | 67 | warn = (either (\_ -> pass ) f m) ==> Universum.whenRight m f | 67 | warn = (either (\_ -> pass ) f m) ==> Universum.whenRight m f | 67 | false | false | 0 | 9 | 18 | 35 | 18 | 17 | null | null |
castaway/pandoc | src/Text/Pandoc/Readers/RST.hs | gpl-2.0 | code :: GenParser Char ParserState Inline
code = try $ do
string "``"
result <- manyTill anyChar (try (string "``"))
return $ Code nullAttr
$ removeLeadingTrailingSpace $ intercalate " " $ lines result | 217 | code :: GenParser Char ParserState Inline
code = try $ do
string "``"
result <- manyTill anyChar (try (string "``"))
return $ Code nullAttr
$ removeLeadingTrailingSpace $ intercalate " " $ lines result | 217 | code = try $ do
string "``"
result <- manyTill anyChar (try (string "``"))
return $ Code nullAttr
$ removeLeadingTrailingSpace $ intercalate " " $ lines result | 175 | false | true | 2 | 13 | 48 | 87 | 37 | 50 | null | null |
topliceanu/learn | haskell/Geometry/Cuboid.hs | mit | volume :: Float -> Float -> Float -> Float
volume a b c = (rectArea a b) * c | 76 | volume :: Float -> Float -> Float -> Float
volume a b c = (rectArea a b) * c | 76 | volume a b c = (rectArea a b) * c | 33 | false | true | 1 | 9 | 18 | 49 | 22 | 27 | null | null |
Chouffe/hlisp | src/Evaluator.hs | bsd-3-clause | -- evalExpr :: [Expr] -> ThrowsError Expr
-- evalExpr (expr:_) = eval expr
isString :: [Expr] -> ThrowsError Expr
isString [String _] = return $ Bool True | 155 | isString :: [Expr] -> ThrowsError Expr
isString [String _] = return $ Bool True | 79 | isString [String _] = return $ Bool True | 40 | true | true | 0 | 7 | 27 | 39 | 20 | 19 | null | null |
anttisalonen/freekick2 | src/Listings.hs | gpl-3.0 | countryContinent "Taiwan" = Asia | 32 | countryContinent "Taiwan" = Asia | 32 | countryContinent "Taiwan" = Asia | 32 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
np/lens | tests/properties.hs | bsd-3-clause | prop_both = isTraversal (both :: Traversal' (Int,Int) Int) | 88 | prop_both = isTraversal (both :: Traversal' (Int,Int) Int) | 88 | prop_both = isTraversal (both :: Traversal' (Int,Int) Int) | 88 | false | false | 0 | 8 | 37 | 26 | 14 | 12 | null | null |
Bolt64/wyas | src/SourceParser.hs | mit | nonEscape :: Parser Char
nonEscape = noneOf "\\\"" | 50 | nonEscape :: Parser Char
nonEscape = noneOf "\\\"" | 50 | nonEscape = noneOf "\\\"" | 25 | false | true | 0 | 6 | 7 | 23 | 9 | 14 | null | null |
chrisdone/keyboard-stats | src/main/XInputKeylogger.hs | bsd-3-clause | format line =
do t <- liftIO getPOSIXTime
return (formatted line t) | 74 | format line =
do t <- liftIO getPOSIXTime
return (formatted line t) | 74 | format line =
do t <- liftIO getPOSIXTime
return (formatted line t) | 74 | false | false | 0 | 9 | 18 | 33 | 14 | 19 | null | null |
tolysz/postgresql-simple | src/Database/PostgreSQL/Simple/Internal.hs | bsd-3-clause | -- | Turns a 'ConnectInfo' data structure into a libpq connection string.
postgreSQLConnectionString :: ConnectInfo -> ByteString
postgreSQLConnectionString connectInfo = fromString connstr
where
connstr = str "host=" connectHost
$ num "port=" connectPort
$ str "user=" connectUser
$ str "password=" connectPassword
$ str "dbname=" connectDatabase
$ []
str name field
| null value = id
| otherwise = showString name . quote value . space
where value = field connectInfo
num name field
| value <= 0 = id
| otherwise = showString name . shows value . space
where value = field connectInfo
quote str rest = '\'' : foldr delta ('\'' : rest) str
where
delta c cs = case c of
'\\' -> '\\' : '\\' : cs
'\'' -> '\\' : '\'' : cs
_ -> c : cs
space [] = []
space xs = ' ':xs | 1,001 | postgreSQLConnectionString :: ConnectInfo -> ByteString
postgreSQLConnectionString connectInfo = fromString connstr
where
connstr = str "host=" connectHost
$ num "port=" connectPort
$ str "user=" connectUser
$ str "password=" connectPassword
$ str "dbname=" connectDatabase
$ []
str name field
| null value = id
| otherwise = showString name . quote value . space
where value = field connectInfo
num name field
| value <= 0 = id
| otherwise = showString name . shows value . space
where value = field connectInfo
quote str rest = '\'' : foldr delta ('\'' : rest) str
where
delta c cs = case c of
'\\' -> '\\' : '\\' : cs
'\'' -> '\\' : '\'' : cs
_ -> c : cs
space [] = []
space xs = ' ':xs | 926 | postgreSQLConnectionString connectInfo = fromString connstr
where
connstr = str "host=" connectHost
$ num "port=" connectPort
$ str "user=" connectUser
$ str "password=" connectPassword
$ str "dbname=" connectDatabase
$ []
str name field
| null value = id
| otherwise = showString name . quote value . space
where value = field connectInfo
num name field
| value <= 0 = id
| otherwise = showString name . shows value . space
where value = field connectInfo
quote str rest = '\'' : foldr delta ('\'' : rest) str
where
delta c cs = case c of
'\\' -> '\\' : '\\' : cs
'\'' -> '\\' : '\'' : cs
_ -> c : cs
space [] = []
space xs = ' ':xs | 870 | true | true | 8 | 13 | 378 | 291 | 136 | 155 | null | null |
msakai/multiset-large | Data/IntMultiSet/Large.hs | bsd-3-clause | -- | /O(log n)/. Delete the maximal element.
deleteMax :: IntMultiSet -> IntMultiSet
deleteMax = MS . Map.updateMax (deleteN 1) . unMS | 134 | deleteMax :: IntMultiSet -> IntMultiSet
deleteMax = MS . Map.updateMax (deleteN 1) . unMS | 89 | deleteMax = MS . Map.updateMax (deleteN 1) . unMS | 49 | true | true | 0 | 9 | 21 | 35 | 18 | 17 | null | null |
CulpaBS/wbBach | src/Language/Futhark/Attributes.hs | bsd-3-clause | setArrayUniqueness :: ArrayTypeBase shape as vn -> Uniqueness
-> ArrayTypeBase shape as vn
setArrayUniqueness (PrimArray et dims _ als) u =
PrimArray et dims u als | 184 | setArrayUniqueness :: ArrayTypeBase shape as vn -> Uniqueness
-> ArrayTypeBase shape as vn
setArrayUniqueness (PrimArray et dims _ als) u =
PrimArray et dims u als | 184 | setArrayUniqueness (PrimArray et dims _ als) u =
PrimArray et dims u als | 74 | false | true | 0 | 7 | 46 | 59 | 28 | 31 | null | null |
athanclark/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | expl_param = Exp [] Dynamic True | 32 | expl_param = Exp [] Dynamic True | 32 | expl_param = Exp [] Dynamic True | 32 | false | false | 1 | 6 | 5 | 18 | 7 | 11 | null | null |
mrBliss/haddock | haddock-api/src/Haddock/Backends/LaTeX.hs | bsd-2-clause | ppLaTeXModule :: String -> FilePath -> Interface -> IO ()
ppLaTeXModule _title odir iface = do
createDirectoryIfMissing True odir
let
mdl = ifaceMod iface
mdl_str = moduleString mdl
exports = ifaceRnExportItems iface
tex = vcat [
text "\\haddockmoduleheading" <> braces (text mdl_str),
text "\\label{module:" <> text mdl_str <> char '}',
text "\\haddockbeginheader",
verb $ vcat [
text "module" <+> text mdl_str <+> lparen,
text " " <> fsep (punctuate (text ", ") $
map exportListItem $
filter forSummary exports),
text " ) where"
],
text "\\haddockendheader" $$ text "",
description,
body
]
description
= (fromMaybe empty . documentationToLaTeX . ifaceRnDoc) iface
body = processExports exports
--
writeFile (odir </> moduleLaTeXFile mdl) (fullRender PageMode 80 1 string_txt "" tex) | 1,013 | ppLaTeXModule :: String -> FilePath -> Interface -> IO ()
ppLaTeXModule _title odir iface = do
createDirectoryIfMissing True odir
let
mdl = ifaceMod iface
mdl_str = moduleString mdl
exports = ifaceRnExportItems iface
tex = vcat [
text "\\haddockmoduleheading" <> braces (text mdl_str),
text "\\label{module:" <> text mdl_str <> char '}',
text "\\haddockbeginheader",
verb $ vcat [
text "module" <+> text mdl_str <+> lparen,
text " " <> fsep (punctuate (text ", ") $
map exportListItem $
filter forSummary exports),
text " ) where"
],
text "\\haddockendheader" $$ text "",
description,
body
]
description
= (fromMaybe empty . documentationToLaTeX . ifaceRnDoc) iface
body = processExports exports
--
writeFile (odir </> moduleLaTeXFile mdl) (fullRender PageMode 80 1 string_txt "" tex) | 1,013 | ppLaTeXModule _title odir iface = do
createDirectoryIfMissing True odir
let
mdl = ifaceMod iface
mdl_str = moduleString mdl
exports = ifaceRnExportItems iface
tex = vcat [
text "\\haddockmoduleheading" <> braces (text mdl_str),
text "\\label{module:" <> text mdl_str <> char '}',
text "\\haddockbeginheader",
verb $ vcat [
text "module" <+> text mdl_str <+> lparen,
text " " <> fsep (punctuate (text ", ") $
map exportListItem $
filter forSummary exports),
text " ) where"
],
text "\\haddockendheader" $$ text "",
description,
body
]
description
= (fromMaybe empty . documentationToLaTeX . ifaceRnDoc) iface
body = processExports exports
--
writeFile (odir </> moduleLaTeXFile mdl) (fullRender PageMode 80 1 string_txt "" tex) | 955 | false | true | 0 | 22 | 346 | 282 | 135 | 147 | null | null |
ckaestne/CIDE | other/CaseStudies/Arith/orig_armin/lambdas-strict/Arith.hs | gpl-3.0 | eval (App exp1 exp2) =
case (eval exp1, eval exp2) of
(Result (TVFun f), Result arg) -> f arg
(Result (TVFun _), Fail err) -> Fail err
(Result _, _) -> Fail ApplicationError
(Fail err, _) -> Fail err | 238 | eval (App exp1 exp2) =
case (eval exp1, eval exp2) of
(Result (TVFun f), Result arg) -> f arg
(Result (TVFun _), Fail err) -> Fail err
(Result _, _) -> Fail ApplicationError
(Fail err, _) -> Fail err | 238 | eval (App exp1 exp2) =
case (eval exp1, eval exp2) of
(Result (TVFun f), Result arg) -> f arg
(Result (TVFun _), Fail err) -> Fail err
(Result _, _) -> Fail ApplicationError
(Fail err, _) -> Fail err | 238 | false | false | 6 | 8 | 77 | 115 | 59 | 56 | null | null |
mzini/qlogic | Qlogic/Diophantine.hs | gpl-3.0 | toFormGen f cb n (A (p `Geq` q)) = do pres <- f cb n p
qres <- f cb n q
natComputation $ pres `geq` qres | 180 | toFormGen f cb n (A (p `Geq` q)) = do pres <- f cb n p
qres <- f cb n q
natComputation $ pres `geq` qres | 180 | toFormGen f cb n (A (p `Geq` q)) = do pres <- f cb n p
qres <- f cb n q
natComputation $ pres `geq` qres | 180 | false | false | 0 | 9 | 102 | 71 | 35 | 36 | null | null |
phaazon/Idris-dev | src/IRTS/CodegenJavaScript.hs | bsd-3-clause | jsPROJECT :: CompileInfo -> Reg -> Int -> Int -> JS
jsPROJECT _ reg loc 0 = JSNoop | 83 | jsPROJECT :: CompileInfo -> Reg -> Int -> Int -> JS
jsPROJECT _ reg loc 0 = JSNoop | 83 | jsPROJECT _ reg loc 0 = JSNoop | 31 | false | true | 0 | 8 | 18 | 36 | 18 | 18 | null | null |
alexander-b/coreutilhs | cf.hs | gpl-3.0 | -- Count number of files in a directory.
main :: IO ()
main = do
dirs <- getArgs
if null dirs
then printCount "."
else forM_ dirs $ \d -> printCount d | 163 | main :: IO ()
main = do
dirs <- getArgs
if null dirs
then printCount "."
else forM_ dirs $ \d -> printCount d | 122 | main = do
dirs <- getArgs
if null dirs
then printCount "."
else forM_ dirs $ \d -> printCount d | 107 | true | true | 0 | 11 | 44 | 62 | 28 | 34 | null | null |
iand675/uri-templater | src/Network/URI/Template/Internal.hs | mit | allowEncoder :: (Buildable str, ToHttpApiData a) => Proxy str -> Allow -> a -> Builder str
allowEncoder p Unreserved = addBytestringBuilder p . urlEncodeBuilder True . T.encodeUtf8 . toUrlPiece | 193 | allowEncoder :: (Buildable str, ToHttpApiData a) => Proxy str -> Allow -> a -> Builder str
allowEncoder p Unreserved = addBytestringBuilder p . urlEncodeBuilder True . T.encodeUtf8 . toUrlPiece | 193 | allowEncoder p Unreserved = addBytestringBuilder p . urlEncodeBuilder True . T.encodeUtf8 . toUrlPiece | 102 | false | true | 0 | 9 | 28 | 69 | 33 | 36 | null | null |
josefs/MiniDSL | Feldspar/Frontend.hs | bsd-3-clause | _ <+> _ = Nothing | 29 | _ <+> _ = Nothing | 29 | _ <+> _ = Nothing | 29 | false | false | 0 | 5 | 16 | 12 | 5 | 7 | null | null |
boggle/neo4j-haskell-driver | src/Database/Neo4j/Internal/Packstream/Marker.hs | apache-2.0 | _INT_32 :: Marker
_INT_32 = MkMarker 0xca | 41 | _INT_32 :: Marker
_INT_32 = MkMarker 0xca | 41 | _INT_32 = MkMarker 0xca | 23 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
jrahm/Beowulf | Beowulf/Style.hs | bsd-2-clause | serialAlignment AlignLeft = "left" | 34 | serialAlignment AlignLeft = "left" | 34 | serialAlignment AlignLeft = "left" | 34 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
keithodulaigh/Hets | Comorphisms/HasCASL2IsabelleHOL.hs | gpl-2.0 | transPat sign (TupleTerm terms@(_ : _) _) =
foldl1 (binConst isaPair) (map (transPat sign) terms) | 101 | transPat sign (TupleTerm terms@(_ : _) _) =
foldl1 (binConst isaPair) (map (transPat sign) terms) | 101 | transPat sign (TupleTerm terms@(_ : _) _) =
foldl1 (binConst isaPair) (map (transPat sign) terms) | 101 | false | false | 0 | 10 | 18 | 54 | 27 | 27 | null | null |
leshchevds/ganeti | src/Ganeti/Config.hs | bsd-2-clause | -- | Get nodes of a given node group.
getGroupNodes :: ConfigData -> String -> [Node]
getGroupNodes cfg gname =
let all_nodes = M.elems . fromContainer . configNodes $ cfg in
filter ((==gname) . nodeGroup) all_nodes | 219 | getGroupNodes :: ConfigData -> String -> [Node]
getGroupNodes cfg gname =
let all_nodes = M.elems . fromContainer . configNodes $ cfg in
filter ((==gname) . nodeGroup) all_nodes | 181 | getGroupNodes cfg gname =
let all_nodes = M.elems . fromContainer . configNodes $ cfg in
filter ((==gname) . nodeGroup) all_nodes | 133 | true | true | 0 | 12 | 39 | 75 | 37 | 38 | null | null |
romanb/amazonka | amazonka-ec2/gen/Network/AWS/EC2/Types.hs | mpl-2.0 | -- | If you used 'CreateKeyPair' to create the key pair, this is the SHA-1 digest of
-- the DER encoded private key. If you used 'ImportKeyPair' to provide AWS the
-- public key, this is the MD5 public key fingerprint as specified in section 4
-- of RFC4716.
kpiKeyFingerprint :: Lens' KeyPairInfo (Maybe Text)
kpiKeyFingerprint =
lens _kpiKeyFingerprint (\s a -> s { _kpiKeyFingerprint = a }) | 397 | kpiKeyFingerprint :: Lens' KeyPairInfo (Maybe Text)
kpiKeyFingerprint =
lens _kpiKeyFingerprint (\s a -> s { _kpiKeyFingerprint = a }) | 138 | kpiKeyFingerprint =
lens _kpiKeyFingerprint (\s a -> s { _kpiKeyFingerprint = a }) | 86 | true | true | 1 | 9 | 71 | 55 | 28 | 27 | null | null |
tolysz/prepare-ghcjs | spec-lts8/base/Numeric.hs | bsd-3-clause | -- | Show /non-negative/ 'Integral' numbers in base 8.
showOct :: (Integral a, Show a) => a -> ShowS
showOct = showIntAtBase 8 intToDigit | 138 | showOct :: (Integral a, Show a) => a -> ShowS
showOct = showIntAtBase 8 intToDigit | 83 | showOct = showIntAtBase 8 intToDigit | 37 | true | true | 0 | 6 | 24 | 36 | 19 | 17 | null | null |
ihc/futhark | src/Language/Futhark/Attributes.hs | isc | diet (Prim _) = Observe | 52 | diet (Prim _) = Observe | 52 | diet (Prim _) = Observe | 52 | false | false | 0 | 7 | 33 | 15 | 7 | 8 | null | null |
bitemyapp/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | hotplugTargetDisk :: String
hotplugTargetDisk = Types.hotplugTargetToRaw HTDisk | 79 | hotplugTargetDisk :: String
hotplugTargetDisk = Types.hotplugTargetToRaw HTDisk | 79 | hotplugTargetDisk = Types.hotplugTargetToRaw HTDisk | 51 | false | true | 0 | 6 | 6 | 22 | 9 | 13 | null | null |
rueshyna/gogol | gogol-dfareporting/gen/Network/Google/Resource/DFAReporting/UserRoles/Insert.hs | mpl-2.0 | -- | Creates a value of 'UserRolesInsert' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'uriProFileId'
--
-- * 'uriPayload'
userRolesInsert
:: Int64 -- ^ 'uriProFileId'
-> UserRole -- ^ 'uriPayload'
-> UserRolesInsert
userRolesInsert pUriProFileId_ pUriPayload_ =
UserRolesInsert'
{ _uriProFileId = _Coerce # pUriProFileId_
, _uriPayload = pUriPayload_
} | 469 | userRolesInsert
:: Int64 -- ^ 'uriProFileId'
-> UserRole -- ^ 'uriPayload'
-> UserRolesInsert
userRolesInsert pUriProFileId_ pUriPayload_ =
UserRolesInsert'
{ _uriProFileId = _Coerce # pUriProFileId_
, _uriPayload = pUriPayload_
} | 258 | userRolesInsert pUriProFileId_ pUriPayload_ =
UserRolesInsert'
{ _uriProFileId = _Coerce # pUriProFileId_
, _uriPayload = pUriPayload_
} | 152 | true | true | 0 | 8 | 94 | 60 | 34 | 26 | null | null |
serokell/time-warp | test/Test/Control/TimeWarp/Timed/ExceptionSpec.hs | mit | throwToThrowsCorrectException
:: Property
throwToThrowsCorrectException =
ioProperty . withCheckPoints $
\checkPoint ->
runEmu $ do
tid <- fork $ catch (wait $ for 1 sec) $
\(_ :: ArithException) -> checkPoint 1
throwTo tid $ SomeException Overflow -- should be unwrapped
-- automatically
wait $ for 2 sec
checkPoint 2 | 460 | throwToThrowsCorrectException
:: Property
throwToThrowsCorrectException =
ioProperty . withCheckPoints $
\checkPoint ->
runEmu $ do
tid <- fork $ catch (wait $ for 1 sec) $
\(_ :: ArithException) -> checkPoint 1
throwTo tid $ SomeException Overflow -- should be unwrapped
-- automatically
wait $ for 2 sec
checkPoint 2 | 460 | throwToThrowsCorrectException =
ioProperty . withCheckPoints $
\checkPoint ->
runEmu $ do
tid <- fork $ catch (wait $ for 1 sec) $
\(_ :: ArithException) -> checkPoint 1
throwTo tid $ SomeException Overflow -- should be unwrapped
-- automatically
wait $ for 2 sec
checkPoint 2 | 414 | false | true | 4 | 14 | 190 | 112 | 51 | 61 | null | null |
green-haskell/ghc | compiler/main/ErrUtils.hs | bsd-3-clause | pprErrMsgBagWithLoc :: Bag ErrMsg -> [SDoc]
pprErrMsgBagWithLoc bag = [ pprLocErrMsg item | item <- sortMsgBag bag ] | 116 | pprErrMsgBagWithLoc :: Bag ErrMsg -> [SDoc]
pprErrMsgBagWithLoc bag = [ pprLocErrMsg item | item <- sortMsgBag bag ] | 116 | pprErrMsgBagWithLoc bag = [ pprLocErrMsg item | item <- sortMsgBag bag ] | 72 | false | true | 0 | 9 | 17 | 45 | 21 | 24 | null | null |
bkeckes/Haskell_Schiffeversenken | src/Client.hs | bsd-3-clause | -- | monadic `until` = so lange bis
untilM p x = x >>= (\y -> if p y then return y else untilM p x) | 100 | untilM p x = x >>= (\y -> if p y then return y else untilM p x) | 63 | untilM p x = x >>= (\y -> if p y then return y else untilM p x) | 63 | true | false | 0 | 9 | 26 | 43 | 22 | 21 | null | null |
rudymatela/llcheck | src/Test/LeanCheck/Derive.hs | bsd-3-clause | -- | Same as 'deriveListable' but does not warn when the requested instance
-- already exists. The function 'deriveListable' is preferable in most
-- situations.
deriveListableIfNeeded :: Name -> DecsQ
deriveListableIfNeeded = deriveListableX False False | 261 | deriveListableIfNeeded :: Name -> DecsQ
deriveListableIfNeeded = deriveListableX False False | 94 | deriveListableIfNeeded = deriveListableX False False | 54 | true | true | 0 | 5 | 41 | 23 | 13 | 10 | null | null |
ony/hledger | hledger-lib/Hledger/Read/CsvReader.hs | gpl-3.0 | commentlinep :: CsvRulesParser ()
commentlinep = lift (many spacenonewline) >> commentcharp >> lift restofline >> return () <?> "comment line" | 142 | commentlinep :: CsvRulesParser ()
commentlinep = lift (many spacenonewline) >> commentcharp >> lift restofline >> return () <?> "comment line" | 142 | commentlinep = lift (many spacenonewline) >> commentcharp >> lift restofline >> return () <?> "comment line" | 108 | false | true | 1 | 10 | 19 | 53 | 23 | 30 | null | null |
ezyang/ghc | compiler/simplCore/SimplUtils.hs | bsd-3-clause | contArgs :: SimplCont -> (Bool, [ArgSummary], SimplCont)
-- Summarises value args, discards type args and coercions
-- The returned continuation of the call is only used to
-- answer questions like "are you interesting?"
contArgs cont
| lone cont = (True, [], cont)
| otherwise = go [] cont
where
lone (ApplyToTy {}) = False -- See Note [Lone variables] in CoreUnfold
lone (ApplyToVal {}) = False
lone (CastIt {}) = False
lone _ = True
go args (ApplyToVal { sc_arg = arg, sc_env = se, sc_cont = k })
= go (is_interesting arg se : args) k
go args (ApplyToTy { sc_cont = k }) = go args k
go args (CastIt _ k) = go args k
go args k = (False, reverse args, k)
is_interesting arg se = interestingArg se arg
-- Do *not* use short-cutting substitution here
-- because we want to get as much IdInfo as possible
------------------- | 1,007 | contArgs :: SimplCont -> (Bool, [ArgSummary], SimplCont)
contArgs cont
| lone cont = (True, [], cont)
| otherwise = go [] cont
where
lone (ApplyToTy {}) = False -- See Note [Lone variables] in CoreUnfold
lone (ApplyToVal {}) = False
lone (CastIt {}) = False
lone _ = True
go args (ApplyToVal { sc_arg = arg, sc_env = se, sc_cont = k })
= go (is_interesting arg se : args) k
go args (ApplyToTy { sc_cont = k }) = go args k
go args (CastIt _ k) = go args k
go args k = (False, reverse args, k)
is_interesting arg se = interestingArg se arg
-- Do *not* use short-cutting substitution here
-- because we want to get as much IdInfo as possible
------------------- | 843 | contArgs cont
| lone cont = (True, [], cont)
| otherwise = go [] cont
where
lone (ApplyToTy {}) = False -- See Note [Lone variables] in CoreUnfold
lone (ApplyToVal {}) = False
lone (CastIt {}) = False
lone _ = True
go args (ApplyToVal { sc_arg = arg, sc_env = se, sc_cont = k })
= go (is_interesting arg se : args) k
go args (ApplyToTy { sc_cont = k }) = go args k
go args (CastIt _ k) = go args k
go args k = (False, reverse args, k)
is_interesting arg se = interestingArg se arg
-- Do *not* use short-cutting substitution here
-- because we want to get as much IdInfo as possible
------------------- | 786 | true | true | 9 | 8 | 337 | 261 | 144 | 117 | null | null |
kevinbackhouse/Control-Monad-MultiPass | src/Control/Monad/MultiPass/Example/Assembler.hs | bsd-3-clause | emitInstr
:: (Monad p1, Monad p2, Monad p3)
=> EmitST2ArrayFxp Addr Word8 r w p1 p2 p3 tc
-> Monoid2 LabelMap r w p2 p3 tc
-> Delay p2 p3 tc
-> Instruction
-> MultiPass r w tc ()
emitInstr emitter labelMap delay12 instruction =
case instruction of
AddImm8 r k
-> emitList emitter (return 4) $
let r' = emitRegister r in
return $
encodeOpcodeWithREX 1 0x83 3 0 r' ++ [k]
Label label
-> do addr <- getIndex emitter
tell labelMap $ liftM (singletonLabelMap label) addr
Goto label
-> do pCurrAddr <- getIndex emitter
pLabels <- listen labelMap
emitList emitter (return 2) $
do currAddr <- delay delay12 pCurrAddr
labels <- pLabels
let gotoAddr = lookupLabel labels label
-- The 2-byte JMP instruction can only be used if the
-- relative offset can be represented as a signed
-- 8-bit number. Note that the offset is calculated
-- from the start of the next instruction, so
-- currAddr needs to be incremented by 2 for this
-- case.
let Addr offset = gotoAddr - (currAddr + 2)
return $
if fitsSignedInt8 offset
then [0xEB, fromIntegral offset]
else -- Emit a 5-byte instruction. The offset
-- needs to be updated accordingly.
0xE9 : emitInt32 (offset - 3)
-- Encode the first three bytes of an instruction with a REX prefix:
--
-- 1. REX prefix
-- 2. Instruction opcode
-- 3. ModR/M byte
-- | 1,704 | emitInstr
:: (Monad p1, Monad p2, Monad p3)
=> EmitST2ArrayFxp Addr Word8 r w p1 p2 p3 tc
-> Monoid2 LabelMap r w p2 p3 tc
-> Delay p2 p3 tc
-> Instruction
-> MultiPass r w tc ()
emitInstr emitter labelMap delay12 instruction =
case instruction of
AddImm8 r k
-> emitList emitter (return 4) $
let r' = emitRegister r in
return $
encodeOpcodeWithREX 1 0x83 3 0 r' ++ [k]
Label label
-> do addr <- getIndex emitter
tell labelMap $ liftM (singletonLabelMap label) addr
Goto label
-> do pCurrAddr <- getIndex emitter
pLabels <- listen labelMap
emitList emitter (return 2) $
do currAddr <- delay delay12 pCurrAddr
labels <- pLabels
let gotoAddr = lookupLabel labels label
-- The 2-byte JMP instruction can only be used if the
-- relative offset can be represented as a signed
-- 8-bit number. Note that the offset is calculated
-- from the start of the next instruction, so
-- currAddr needs to be incremented by 2 for this
-- case.
let Addr offset = gotoAddr - (currAddr + 2)
return $
if fitsSignedInt8 offset
then [0xEB, fromIntegral offset]
else -- Emit a 5-byte instruction. The offset
-- needs to be updated accordingly.
0xE9 : emitInt32 (offset - 3)
-- Encode the first three bytes of an instruction with a REX prefix:
--
-- 1. REX prefix
-- 2. Instruction opcode
-- 3. ModR/M byte
-- | 1,704 | emitInstr emitter labelMap delay12 instruction =
case instruction of
AddImm8 r k
-> emitList emitter (return 4) $
let r' = emitRegister r in
return $
encodeOpcodeWithREX 1 0x83 3 0 r' ++ [k]
Label label
-> do addr <- getIndex emitter
tell labelMap $ liftM (singletonLabelMap label) addr
Goto label
-> do pCurrAddr <- getIndex emitter
pLabels <- listen labelMap
emitList emitter (return 2) $
do currAddr <- delay delay12 pCurrAddr
labels <- pLabels
let gotoAddr = lookupLabel labels label
-- The 2-byte JMP instruction can only be used if the
-- relative offset can be represented as a signed
-- 8-bit number. Note that the offset is calculated
-- from the start of the next instruction, so
-- currAddr needs to be incremented by 2 for this
-- case.
let Addr offset = gotoAddr - (currAddr + 2)
return $
if fitsSignedInt8 offset
then [0xEB, fromIntegral offset]
else -- Emit a 5-byte instruction. The offset
-- needs to be updated accordingly.
0xE9 : emitInt32 (offset - 3)
-- Encode the first three bytes of an instruction with a REX prefix:
--
-- 1. REX prefix
-- 2. Instruction opcode
-- 3. ModR/M byte
-- | 1,513 | false | true | 5 | 16 | 653 | 376 | 180 | 196 | null | null |
kosmoskatten/ghost-lang | ghost-shell/src/Shell.hs | mit | nodeGetHttpConfig :: MonadIO m => IORef State -> m (Either String Service)
nodeGetHttpConfig state = do
(mgr, baseUrl) <- nodeParams <$> liftIO (readIORef state)
liftIO $ getHttpConfig mgr baseUrl | 200 | nodeGetHttpConfig :: MonadIO m => IORef State -> m (Either String Service)
nodeGetHttpConfig state = do
(mgr, baseUrl) <- nodeParams <$> liftIO (readIORef state)
liftIO $ getHttpConfig mgr baseUrl | 200 | nodeGetHttpConfig state = do
(mgr, baseUrl) <- nodeParams <$> liftIO (readIORef state)
liftIO $ getHttpConfig mgr baseUrl | 125 | false | true | 0 | 12 | 32 | 81 | 37 | 44 | null | null |
infotroph/pandoc-crossref | lib/Text/Pandoc/CrossRef/Util/Settings/Template.hs | gpl-2.0 | dropQualifiers :: Name -> Name
dropQualifiers (Name occ _) = mkName (occString occ) | 83 | dropQualifiers :: Name -> Name
dropQualifiers (Name occ _) = mkName (occString occ) | 83 | dropQualifiers (Name occ _) = mkName (occString occ) | 52 | false | true | 0 | 7 | 12 | 35 | 17 | 18 | null | null |
fluffynukeit/FNIStash | src/FNIStash/Logic/Env.hs | bsd-3-clause | sharedStashPath Env{..} = do
searchHead <- require config $ T.pack $ show SHAREDSTASHLOCATION
searchName <- require config $ T.pack $ show SHAREDSTASHFILE
rightFile <- simpleFind ((searchName ==) . takeFileName) searchHead
return (rightFile, searchName, searchHead)
-- Each of the functions below returns a lookup function. This is how we can keep the loaded PAK
-- handy for repeated lookups since we cannot have a global. The PAK stays on the stack. | 472 | sharedStashPath Env{..} = do
searchHead <- require config $ T.pack $ show SHAREDSTASHLOCATION
searchName <- require config $ T.pack $ show SHAREDSTASHFILE
rightFile <- simpleFind ((searchName ==) . takeFileName) searchHead
return (rightFile, searchName, searchHead)
-- Each of the functions below returns a lookup function. This is how we can keep the loaded PAK
-- handy for repeated lookups since we cannot have a global. The PAK stays on the stack. | 472 | sharedStashPath Env{..} = do
searchHead <- require config $ T.pack $ show SHAREDSTASHLOCATION
searchName <- require config $ T.pack $ show SHAREDSTASHFILE
rightFile <- simpleFind ((searchName ==) . takeFileName) searchHead
return (rightFile, searchName, searchHead)
-- Each of the functions below returns a lookup function. This is how we can keep the loaded PAK
-- handy for repeated lookups since we cannot have a global. The PAK stays on the stack. | 472 | false | false | 0 | 11 | 90 | 101 | 49 | 52 | null | null |
hvr/vector | Data/Vector/Generic.hs | bsd-3-clause | (!) v i = BOUNDS_CHECK(checkIndex) "(!)" i (length v)
$ unId (basicUnsafeIndexM v i) | 92 | (!) v i = BOUNDS_CHECK(checkIndex) "(!)" i (length v)
$ unId (basicUnsafeIndexM v i) | 92 | (!) v i = BOUNDS_CHECK(checkIndex) "(!)" i (length v)
$ unId (basicUnsafeIndexM v i) | 92 | false | false | 0 | 8 | 21 | 47 | 23 | 24 | null | null |
HIPERFIT/futhark | src/Futhark/Analysis/PrimExp.hs | isc | -- | Is the expression a constant one of some sort?
oneIshExp :: PrimExp v -> Bool
oneIshExp (ValueExp v) = oneIsh v | 116 | oneIshExp :: PrimExp v -> Bool
oneIshExp (ValueExp v) = oneIsh v | 64 | oneIshExp (ValueExp v) = oneIsh v | 33 | true | true | 0 | 7 | 22 | 31 | 15 | 16 | null | null |
typedvar/hLand | hcore/GCompiler.hs | mit | compileLet' ((_, expr):defs) env =
compileC expr env ++ compileLet' defs (argOffset 1 env) | 95 | compileLet' ((_, expr):defs) env =
compileC expr env ++ compileLet' defs (argOffset 1 env) | 95 | compileLet' ((_, expr):defs) env =
compileC expr env ++ compileLet' defs (argOffset 1 env) | 95 | false | false | 0 | 8 | 18 | 46 | 23 | 23 | null | null |
batterseapower/context-semantics | Language/ContextSemantics/Graph.hs | bsd-3-clause | insertNode :: Int -> n LooseEnd -> GraphBuilderM n ()
insertNode i node = GraphBuilderM $ \env -> (env { gbe_nodes = IM.insert i node (gbe_nodes env) }, ()) | 156 | insertNode :: Int -> n LooseEnd -> GraphBuilderM n ()
insertNode i node = GraphBuilderM $ \env -> (env { gbe_nodes = IM.insert i node (gbe_nodes env) }, ()) | 156 | insertNode i node = GraphBuilderM $ \env -> (env { gbe_nodes = IM.insert i node (gbe_nodes env) }, ()) | 102 | false | true | 0 | 12 | 28 | 74 | 38 | 36 | null | null |
cstrahan/gochan | weight/Main.hs | mit | unselectSendRecv :: Chan Int -> IO ()
unselectSendRecv c = do
forkIO $ chanSelect [Send c 0 (return ())] Nothing
chanSelect [Recv c (const (return ()))] Nothing
return () | 182 | unselectSendRecv :: Chan Int -> IO ()
unselectSendRecv c = do
forkIO $ chanSelect [Send c 0 (return ())] Nothing
chanSelect [Recv c (const (return ()))] Nothing
return () | 182 | unselectSendRecv c = do
forkIO $ chanSelect [Send c 0 (return ())] Nothing
chanSelect [Recv c (const (return ()))] Nothing
return () | 144 | false | true | 0 | 14 | 40 | 94 | 43 | 51 | null | null |
zeekay/lambdabot | Plugin/Log.hs | mit | -- * State manipulation functions
--
-- | Cleans up after the module (closes files)
cleanLogState :: Log ()
cleanLogState =
withMS $ \state writer -> do
io $ M.fold (\cs iom -> iom >> hClose (chanHandle cs)) (return ()) state
writer M.empty
-- | Fetch a channel from the internal map. Uses LB's fail if not found. | 331 | cleanLogState :: Log ()
cleanLogState =
withMS $ \state writer -> do
io $ M.fold (\cs iom -> iom >> hClose (chanHandle cs)) (return ()) state
writer M.empty
-- | Fetch a channel from the internal map. Uses LB's fail if not found. | 246 | cleanLogState =
withMS $ \state writer -> do
io $ M.fold (\cs iom -> iom >> hClose (chanHandle cs)) (return ()) state
writer M.empty
-- | Fetch a channel from the internal map. Uses LB's fail if not found. | 222 | true | true | 2 | 16 | 75 | 93 | 45 | 48 | null | null |
markus1189/xmonad-contrib-710 | XMonad/Layout/DecorationMadness.hs | bsd-3-clause | -- $float
-- Here you will find decorated layout based on the SimpleFloating
-- layout
-- | A simple floating layout where every window is placed according
-- to the window's initial attributes.
--
-- Here you can find a screen shot:
--
-- <http://code.haskell.org/~arossato/xmonadShots/floatSimpleSimple.png>
floatSimpleSimple :: (Show a, Eq a) => ModifiedLayout (Decoration SimpleDecoration DefaultShrinker)
(ModifiedLayout MouseResize (ModifiedLayout WindowArranger SimpleFloat)) a
floatSimpleSimple = simpleFloat | 534 | floatSimpleSimple :: (Show a, Eq a) => ModifiedLayout (Decoration SimpleDecoration DefaultShrinker)
(ModifiedLayout MouseResize (ModifiedLayout WindowArranger SimpleFloat)) a
floatSimpleSimple = simpleFloat | 223 | floatSimpleSimple = simpleFloat | 31 | true | true | 0 | 10 | 82 | 66 | 38 | 28 | null | null |
fthomas/ohloh-hs | tools/cmdoh.hs | bsd-3-clause | cmdFetch = Fetch {
key = def &= typ "KEY" &= help "Ohloh API key",
queryItem = def &= argPos 0,
queryArgs = def &= args &= typ "ITEM_ARGS"
} | 146 | cmdFetch = Fetch {
key = def &= typ "KEY" &= help "Ohloh API key",
queryItem = def &= argPos 0,
queryArgs = def &= args &= typ "ITEM_ARGS"
} | 146 | cmdFetch = Fetch {
key = def &= typ "KEY" &= help "Ohloh API key",
queryItem = def &= argPos 0,
queryArgs = def &= args &= typ "ITEM_ARGS"
} | 146 | false | false | 0 | 9 | 35 | 58 | 30 | 28 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.