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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
kolmodin/cabal
|
cabal-install/Distribution/Client/FileMonitor.hs
|
bsd-3-clause
|
whenCacheChanged CacheUnchanged _ = return ()
| 48 |
whenCacheChanged CacheUnchanged _ = return ()
| 48 |
whenCacheChanged CacheUnchanged _ = return ()
| 48 | false | false | 0 | 6 | 8 | 16 | 7 | 9 | null | null |
joecrayne/hs-bitsyntax
|
Data/BitSyntax.hs
|
bsd-3-clause
|
bits (U16LE v) = getBytes (littleEndian16 $ fromIntegral v)
| 59 |
bits (U16LE v) = getBytes (littleEndian16 $ fromIntegral v)
| 59 |
bits (U16LE v) = getBytes (littleEndian16 $ fromIntegral v)
| 59 | false | false | 0 | 8 | 8 | 29 | 13 | 16 | null | null |
anthonybrice/euler94
|
euler94-bin/Brice/Euler94/Bin/Main.hs
|
gpl-3.0
|
mapNs :: Integral a => [a] -> Map a a
mapNs = fromList . init . foldl' mainFold [(15, 0)] . sort . nub
| 102 |
mapNs :: Integral a => [a] -> Map a a
mapNs = fromList . init . foldl' mainFold [(15, 0)] . sort . nub
| 102 |
mapNs = fromList . init . foldl' mainFold [(15, 0)] . sort . nub
| 64 | false | true | 0 | 10 | 23 | 60 | 31 | 29 | null | null |
phischu/fragnix
|
tests/packages/scotty/Data.Map.Internal.hs
|
bsd-3-clause
|
-- | /O(n)/. A strict version of 'foldl'. Each application of the operator is
-- evaluated before using the result in the next application. This
-- function is strict in the starting value.
foldl' :: (a -> b -> a) -> a -> Map k b -> a
foldl' f z = go z
where
go !z' Tip = z'
go z' (Bin _ _ x l r) = go (f (go z' l) x) r
| 342 |
foldl' :: (a -> b -> a) -> a -> Map k b -> a
foldl' f z = go z
where
go !z' Tip = z'
go z' (Bin _ _ x l r) = go (f (go z' l) x) r
| 152 |
foldl' f z = go z
where
go !z' Tip = z'
go z' (Bin _ _ x l r) = go (f (go z' l) x) r
| 107 | true | true | 1 | 9 | 98 | 118 | 55 | 63 | null | null |
abakst/liquidhaskell
|
benchmarks/text-0.11.2.3/Data/Text/Fusion/Size.hs
|
bsd-3-clause
|
mulSize _ _ = Unknown
| 37 |
mulSize _ _ = Unknown
| 37 |
mulSize _ _ = Unknown
| 37 | false | false | 0 | 5 | 20 | 11 | 5 | 6 | null | null |
dalonng/hellos
|
haskell.hello/FixedPointFunction.hs
|
gpl-2.0
|
factorial :: Int -> Int
factorial = fix (\f n -> if (n==0) then 1 else n * f (n-1))
| 83 |
factorial :: Int -> Int
factorial = fix (\f n -> if (n==0) then 1 else n * f (n-1))
| 83 |
factorial = fix (\f n -> if (n==0) then 1 else n * f (n-1))
| 59 | false | true | 0 | 12 | 19 | 57 | 31 | 26 | null | null |
mvr/abyme
|
haskell-model/src/Abyme/Regiony/Addressing.hs
|
bsd-3-clause
|
contains :: HasSquares a => Universe -> a -> Square -> Bool
contains u a s = s `elem` (constituentSquares u a)
| 110 |
contains :: HasSquares a => Universe -> a -> Square -> Bool
contains u a s = s `elem` (constituentSquares u a)
| 110 |
contains u a s = s `elem` (constituentSquares u a)
| 50 | false | true | 0 | 8 | 21 | 51 | 26 | 25 | null | null |
rahulmutt/ghcvm
|
compiler/Eta/BasicTypes/Name.hs
|
bsd-3-clause
|
getSrcSpan = nameSrcSpan . getName
| 52 |
getSrcSpan = nameSrcSpan . getName
| 52 |
getSrcSpan = nameSrcSpan . getName
| 52 | false | false | 1 | 5 | 22 | 13 | 5 | 8 | null | null |
ehlemur/HLearn
|
src/HLearn/Data/SpaceTree/Algorithms/NearestNeighbor.hs
|
bsd-3-clause
|
property_orderedNeighborList (NL_Cons n (NL_Cons n2 ns)) = if neighborDistance n < neighborDistance n2
then property_orderedNeighborList (NL_Cons n2 ns)
else False
| 171 |
property_orderedNeighborList (NL_Cons n (NL_Cons n2 ns)) = if neighborDistance n < neighborDistance n2
then property_orderedNeighborList (NL_Cons n2 ns)
else False
| 171 |
property_orderedNeighborList (NL_Cons n (NL_Cons n2 ns)) = if neighborDistance n < neighborDistance n2
then property_orderedNeighborList (NL_Cons n2 ns)
else False
| 171 | false | false | 0 | 9 | 27 | 54 | 26 | 28 | null | null |
rueshyna/gogol
|
gogol-fitness/gen/Network/Google/Resource/Fitness/Users/DataSources/Get.hs
|
mpl-2.0
|
-- | Retrieve a data source for the person identified. Use me to indicate the
-- authenticated user. Only me is supported at this time.
udsgUserId :: Lens' UsersDataSourcesGet Text
udsgUserId
= lens _udsgUserId (\ s a -> s{_udsgUserId = a})
| 242 |
udsgUserId :: Lens' UsersDataSourcesGet Text
udsgUserId
= lens _udsgUserId (\ s a -> s{_udsgUserId = a})
| 106 |
udsgUserId
= lens _udsgUserId (\ s a -> s{_udsgUserId = a})
| 61 | true | true | 1 | 9 | 42 | 47 | 23 | 24 | null | null |
dmbarbour/Sirea
|
sirea-filesystem/src/Sirea/Filesystem/KeyedSched.hs
|
bsd-3-clause
|
dKeyedWork :: (Ord k) => KSched k -> k -> Work -> IO ()
addKeyedWork ks@(KS rf _) k w = join $ atomicModifyIORef rf addw where
addw m0 = addw' m0 (M.lookup k m0)
addw' m0 Nothing = (M.insert k [] m0, initKeyedWork ks k w)
addw' m0 (Just ws) = (M.insert k (ws ++ [w]) m0, return ())
| 296 |
addKeyedWork :: (Ord k) => KSched k -> k -> Work -> IO ()
addKeyedWork ks@(KS rf _) k w = join $ atomicModifyIORef rf addw where
addw m0 = addw' m0 (M.lookup k m0)
addw' m0 Nothing = (M.insert k [] m0, initKeyedWork ks k w)
addw' m0 (Just ws) = (M.insert k (ws ++ [w]) m0, return ())
| 296 |
addKeyedWork ks@(KS rf _) k w = join $ atomicModifyIORef rf addw where
addw m0 = addw' m0 (M.lookup k m0)
addw' m0 Nothing = (M.insert k [] m0, initKeyedWork ks k w)
addw' m0 (Just ws) = (M.insert k (ws ++ [w]) m0, return ())
| 238 | false | true | 0 | 11 | 74 | 172 | 86 | 86 | null | null |
ghc-android/ghc
|
testsuite/tests/ghci/should_run/ghcirun004.hs
|
bsd-3-clause
|
4129 = 4128
| 11 |
4129 = 4128
| 11 |
4129 = 4128
| 11 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
nfjinjing/mps
|
src/MPS/Math/PermutationGroupExamples.hs
|
bsd-3-clause
|
-- S(5,8,24) constructed as the image of a single octad under the action of PSL(2,23)
-- it has 759 blocks ( (24 `choose` 5) `div` (8 `choose` 5) )
-- The automorphism group of S(5,8,24) is in fact the full Mathieu group M24
-- (You can check that deltaM24 is also an automorphism)
-- Extended binary Golay code G24
qr23 = [1,2,3,4,6,8,9,12,13,16,18] :: [Int]
| 370 |
qr23 = [1,2,3,4,6,8,9,12,13,16,18] :: [Int]
| 43 |
qr23 = [1,2,3,4,6,8,9,12,13,16,18] :: [Int]
| 43 | true | false | 0 | 5 | 74 | 50 | 34 | 16 | null | null |
sordina/wai
|
wai-conduit/Network/Wai/Conduit.hs
|
bsd-2-clause
|
-- | Create a raw response using @Source@ and @Sink@ conduits.
--
-- This is an adapter to Wai's @responseRaw@ for conduits.
--
-- @Source@ and @Sink@ data are provided. The @Source@ is a byte conduit from
-- the client's socket. The @Sink@ is a byte conduit to the client's socket.
--
-- The @Response@ argument is a backup response. It is sent to the client if
-- the handler does not support @responseRaw@.
--
-- Since 3.0.0
responseRawSource :: (MonadIO m, MonadIO n)
=> (ConduitT () ByteString m () -> ConduitT ByteString Void n () -> IO ())
-> Response
-> Response
responseRawSource app =
responseRaw app'
where
app' recv send =
app src sink
where
src = do
bs <- liftIO recv
unless (S.null bs) $ do
yield bs
src
sink = CL.mapM_ $ liftIO . send
| 899 |
responseRawSource :: (MonadIO m, MonadIO n)
=> (ConduitT () ByteString m () -> ConduitT ByteString Void n () -> IO ())
-> Response
-> Response
responseRawSource app =
responseRaw app'
where
app' recv send =
app src sink
where
src = do
bs <- liftIO recv
unless (S.null bs) $ do
yield bs
src
sink = CL.mapM_ $ liftIO . send
| 471 |
responseRawSource app =
responseRaw app'
where
app' recv send =
app src sink
where
src = do
bs <- liftIO recv
unless (S.null bs) $ do
yield bs
src
sink = CL.mapM_ $ liftIO . send
| 274 | true | true | 5 | 12 | 288 | 186 | 86 | 100 | null | null |
dysinger/amazonka
|
amazonka-ec2/gen/Network/AWS/EC2/Types.hs
|
mpl-2.0
|
-- | 'Monitoring' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'mState' @::@ 'Maybe' 'MonitoringState'
--
monitoring :: Monitoring
monitoring = Monitoring
{ _mState = Nothing
}
| 222 |
monitoring :: Monitoring
monitoring = Monitoring
{ _mState = Nothing
}
| 78 |
monitoring = Monitoring
{ _mState = Nothing
}
| 53 | true | true | 0 | 6 | 39 | 28 | 18 | 10 | null | null |
bennofs/haskell-generate
|
src/Language/Haskell/Generate/TH.hs
|
bsd-3-clause
|
-- | Make a ExpG for some thing, using the given name for the definition. The third tuple element
-- specifies the constructor to use for constructing the Name. This can either be @'Symbol@ (for symbols)
-- or @'Ident@ (for functions).
declareNamedThing :: (Name, String, Name) -> DecsQ
declareNamedThing (thing, name, thingClass) = do
info <- reify thing
typ <- case info of
VarI _ t _ _ -> return t
ClassOpI _ t _ _ -> return t
DataConI _ t _ _ -> return t
_ -> fail $ "Not a function: " ++ nameBase thing
md <- maybe (fail "No module name for function!") return $ nameModule thing
sequence
[ sigD (mkName name) $ return $ overQuantifiedType (ConT ''ExpG `AppT`) typ
, funD (mkName name) $ return $ flip (clause []) [] $ normalB
[| useValue $(lift md) $ $(conE thingClass) $(lift $ nameBase thing) |]
]
where overQuantifiedType f (ForallT bnds ctx t) = ForallT (map removeKind bnds) ctx $ overQuantifiedType f t
overQuantifiedType f x = f x
removeKind :: TyVarBndr -> TyVarBndr
removeKind (KindedTV n _) = PlainTV n
removeKind x = x
-- | Declare a symbol, using the given name for the definition.
| 1,184 |
declareNamedThing :: (Name, String, Name) -> DecsQ
declareNamedThing (thing, name, thingClass) = do
info <- reify thing
typ <- case info of
VarI _ t _ _ -> return t
ClassOpI _ t _ _ -> return t
DataConI _ t _ _ -> return t
_ -> fail $ "Not a function: " ++ nameBase thing
md <- maybe (fail "No module name for function!") return $ nameModule thing
sequence
[ sigD (mkName name) $ return $ overQuantifiedType (ConT ''ExpG `AppT`) typ
, funD (mkName name) $ return $ flip (clause []) [] $ normalB
[| useValue $(lift md) $ $(conE thingClass) $(lift $ nameBase thing) |]
]
where overQuantifiedType f (ForallT bnds ctx t) = ForallT (map removeKind bnds) ctx $ overQuantifiedType f t
overQuantifiedType f x = f x
removeKind :: TyVarBndr -> TyVarBndr
removeKind (KindedTV n _) = PlainTV n
removeKind x = x
-- | Declare a symbol, using the given name for the definition.
| 948 |
declareNamedThing (thing, name, thingClass) = do
info <- reify thing
typ <- case info of
VarI _ t _ _ -> return t
ClassOpI _ t _ _ -> return t
DataConI _ t _ _ -> return t
_ -> fail $ "Not a function: " ++ nameBase thing
md <- maybe (fail "No module name for function!") return $ nameModule thing
sequence
[ sigD (mkName name) $ return $ overQuantifiedType (ConT ''ExpG `AppT`) typ
, funD (mkName name) $ return $ flip (clause []) [] $ normalB
[| useValue $(lift md) $ $(conE thingClass) $(lift $ nameBase thing) |]
]
where overQuantifiedType f (ForallT bnds ctx t) = ForallT (map removeKind bnds) ctx $ overQuantifiedType f t
overQuantifiedType f x = f x
removeKind :: TyVarBndr -> TyVarBndr
removeKind (KindedTV n _) = PlainTV n
removeKind x = x
-- | Declare a symbol, using the given name for the definition.
| 897 | true | true | 4 | 14 | 286 | 336 | 166 | 170 | null | null |
mrkkrp/stack
|
src/Stack/Build/Cache.hs
|
bsd-3-clause
|
writePrecompiledCache :: (MonadThrow m, MonadReader env m, HasEnvConfig env, MonadIO m, MonadLogger m)
=> BaseConfigOpts
-> PackageIdentifier
-> ConfigureOpts
-> Set GhcPkgId -- ^ dependencies
-> Installed -- ^ library
-> Set Text -- ^ executables
-> m ()
writePrecompiledCache baseConfigOpts pkgident copts depIDs mghcPkgId exes = do
(file, _) <- precompiledCacheFile pkgident copts depIDs
ensureDir (parent file)
ec <- view envConfigL
let stackRootRelative = makeRelative (view stackRootL ec)
mlibpath <-
case mghcPkgId of
Executable _ -> return Nothing
Library _ ipid -> liftM Just $ do
ipid' <- parseRelFile $ ghcPkgIdString ipid ++ ".conf"
relPath <- stackRootRelative $ bcoSnapDB baseConfigOpts </> ipid'
return $ toFilePath relPath
exes' <- forM (Set.toList exes) $ \exe -> do
name <- parseRelFile $ T.unpack exe
relPath <- stackRootRelative $ bcoSnapInstallRoot baseConfigOpts </> bindirSuffix </> name
return $ toFilePath relPath
$(versionedEncodeFile precompiledCacheVC) file PrecompiledCache
{ pcLibrary = mlibpath
, pcExes = exes'
}
-- | Check the cache for a precompiled package matching the given
-- configuration.
| 1,439 |
writePrecompiledCache :: (MonadThrow m, MonadReader env m, HasEnvConfig env, MonadIO m, MonadLogger m)
=> BaseConfigOpts
-> PackageIdentifier
-> ConfigureOpts
-> Set GhcPkgId -- ^ dependencies
-> Installed -- ^ library
-> Set Text -- ^ executables
-> m ()
writePrecompiledCache baseConfigOpts pkgident copts depIDs mghcPkgId exes = do
(file, _) <- precompiledCacheFile pkgident copts depIDs
ensureDir (parent file)
ec <- view envConfigL
let stackRootRelative = makeRelative (view stackRootL ec)
mlibpath <-
case mghcPkgId of
Executable _ -> return Nothing
Library _ ipid -> liftM Just $ do
ipid' <- parseRelFile $ ghcPkgIdString ipid ++ ".conf"
relPath <- stackRootRelative $ bcoSnapDB baseConfigOpts </> ipid'
return $ toFilePath relPath
exes' <- forM (Set.toList exes) $ \exe -> do
name <- parseRelFile $ T.unpack exe
relPath <- stackRootRelative $ bcoSnapInstallRoot baseConfigOpts </> bindirSuffix </> name
return $ toFilePath relPath
$(versionedEncodeFile precompiledCacheVC) file PrecompiledCache
{ pcLibrary = mlibpath
, pcExes = exes'
}
-- | Check the cache for a precompiled package matching the given
-- configuration.
| 1,439 |
writePrecompiledCache baseConfigOpts pkgident copts depIDs mghcPkgId exes = do
(file, _) <- precompiledCacheFile pkgident copts depIDs
ensureDir (parent file)
ec <- view envConfigL
let stackRootRelative = makeRelative (view stackRootL ec)
mlibpath <-
case mghcPkgId of
Executable _ -> return Nothing
Library _ ipid -> liftM Just $ do
ipid' <- parseRelFile $ ghcPkgIdString ipid ++ ".conf"
relPath <- stackRootRelative $ bcoSnapDB baseConfigOpts </> ipid'
return $ toFilePath relPath
exes' <- forM (Set.toList exes) $ \exe -> do
name <- parseRelFile $ T.unpack exe
relPath <- stackRootRelative $ bcoSnapInstallRoot baseConfigOpts </> bindirSuffix </> name
return $ toFilePath relPath
$(versionedEncodeFile precompiledCacheVC) file PrecompiledCache
{ pcLibrary = mlibpath
, pcExes = exes'
}
-- | Check the cache for a precompiled package matching the given
-- configuration.
| 1,029 | false | true | 0 | 17 | 473 | 352 | 166 | 186 | null | null |
olsner/ghc
|
compiler/main/HscMain.hs
|
bsd-3-clause
|
getWarnings :: Hsc WarningMessages
getWarnings = Hsc $ \_ w -> return (w, w)
| 76 |
getWarnings :: Hsc WarningMessages
getWarnings = Hsc $ \_ w -> return (w, w)
| 76 |
getWarnings = Hsc $ \_ w -> return (w, w)
| 41 | false | true | 0 | 8 | 13 | 34 | 18 | 16 | null | null |
ghcjs/jsaddle-dom
|
src/JSDOM/Generated/TreeWalker.hs
|
mit
|
-- | <https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker.lastChild Mozilla TreeWalker.lastChild documentation>
lastChild :: (MonadDOM m) => TreeWalker -> m (Maybe Node)
lastChild self
= liftDOM ((self ^. jsf "lastChild" ()) >>= fromJSVal)
| 250 |
lastChild :: (MonadDOM m) => TreeWalker -> m (Maybe Node)
lastChild self
= liftDOM ((self ^. jsf "lastChild" ()) >>= fromJSVal)
| 129 |
lastChild self
= liftDOM ((self ^. jsf "lastChild" ()) >>= fromJSVal)
| 71 | true | true | 0 | 11 | 29 | 66 | 32 | 34 | null | null |
mpickering/hackage-server
|
Distribution/Server/Features/Upload/State.hs
|
bsd-3-clause
|
modifyHackageTrustees :: (UserList -> UserList) -> Update HackageTrustees ()
modifyHackageTrustees func = State.modify (\ht -> ht {trusteeList = func (trusteeList ht) })
| 169 |
modifyHackageTrustees :: (UserList -> UserList) -> Update HackageTrustees ()
modifyHackageTrustees func = State.modify (\ht -> ht {trusteeList = func (trusteeList ht) })
| 169 |
modifyHackageTrustees func = State.modify (\ht -> ht {trusteeList = func (trusteeList ht) })
| 92 | false | true | 0 | 12 | 21 | 62 | 32 | 30 | null | null |
noexc/mapview
|
tests/test.hs
|
mit
|
properties :: TestTree
properties = testGroup "Properties" [qcProps]
| 68 |
properties :: TestTree
properties = testGroup "Properties" [qcProps]
| 68 |
properties = testGroup "Properties" [qcProps]
| 45 | false | true | 0 | 6 | 7 | 19 | 10 | 9 | null | null |
rylev/blankfuck
|
Interpreter.hs
|
mit
|
stepState DecrementValue = updateVal $ subtract 1
| 49 |
stepState DecrementValue = updateVal $ subtract 1
| 49 |
stepState DecrementValue = updateVal $ subtract 1
| 49 | false | false | 3 | 5 | 6 | 20 | 7 | 13 | null | null |
siddhanathan/ghc
|
libraries/base/Data/OldList.hs
|
bsd-3-clause
|
-- -----------------------------------------------------------------------------
-- Functions on strings
-- | 'lines' breaks a string up into a list of strings at newline
-- characters. The resulting strings do not contain newlines.
lines :: String -> [String]
lines "" = []
| 310 |
lines :: String -> [String]
lines "" = []
| 75 |
lines "" = []
| 29 | true | true | 0 | 6 | 73 | 28 | 16 | 12 | null | null |
uuhan/Idris-dev
|
src/IRTS/JavaScript/Codegen.hs
|
bsd-3-clause
|
cgConst :: Const -> State CGBodyState JsExpr
cgConst (I i) = pure $ JsInt i
| 75 |
cgConst :: Const -> State CGBodyState JsExpr
cgConst (I i) = pure $ JsInt i
| 75 |
cgConst (I i) = pure $ JsInt i
| 30 | false | true | 0 | 7 | 14 | 36 | 17 | 19 | null | null |
tjakway/ghcjvm
|
compiler/basicTypes/Unique.hs
|
bsd-3-clause
|
mkPreludeClassUnique i = mkUnique '2' i
| 39 |
mkPreludeClassUnique i = mkUnique '2' i
| 39 |
mkPreludeClassUnique i = mkUnique '2' i
| 39 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
jonathanknowles/hs-type-level-prime-product
|
Data/TypeLevel/PrimeProduct/SparseTest.hs
|
bsd-3-clause
|
m2 = undefined :: Multiply (P2:^:P1:::E) E (P2:^:P1:::E) => x
| 73 |
m2 = undefined :: Multiply (P2:^:P1:::E) E (P2:^:P1:::E) => x
| 73 |
m2 = undefined :: Multiply (P2:^:P1:::E) E (P2:^:P1:::E) => x
| 73 | false | false | 0 | 9 | 21 | 42 | 22 | 20 | null | null |
haskell-distributed/distributed-process-platform
|
src/Control/Distributed/Process/Platform/Service/SystemLog.hs
|
bsd-3-clause
|
critical :: (Logger l, ToLog m) => l -> m -> Process ()
critical l m = sendLog l m Critical
| 91 |
critical :: (Logger l, ToLog m) => l -> m -> Process ()
critical l m = sendLog l m Critical
| 91 |
critical l m = sendLog l m Critical
| 35 | false | true | 0 | 9 | 20 | 51 | 25 | 26 | null | null |
spechub/Hets
|
HasCASL/Builtin.hs
|
gpl-2.0
|
bindA :: Type -> TypeScheme
bindA = bindVarA aTypeArg
| 53 |
bindA :: Type -> TypeScheme
bindA = bindVarA aTypeArg
| 53 |
bindA = bindVarA aTypeArg
| 25 | false | true | 0 | 7 | 8 | 25 | 10 | 15 | null | null |
Chaddai/CurveProject
|
high-school-plotting/src/Math/PSTricksGenerator.hs
|
bsd-3-clause
|
drawTangents _ _ _ = mempty
| 27 |
drawTangents _ _ _ = mempty
| 27 |
drawTangents _ _ _ = mempty
| 27 | false | false | 0 | 5 | 5 | 13 | 6 | 7 | null | null |
quickdudley/varroa
|
Reinforcement.hs
|
agpl-3.0
|
isStudent _ = False
| 19 |
isStudent _ = False
| 19 |
isStudent _ = False
| 19 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
abhishekkr/tutorials_as_code
|
talks-articles/languages-n-runtimes/haskell/PhilipWadler-UniversityOfEdinburgh-2011/lecture18.example05.hs
|
mit
|
prop_parse :: Proposition -> Bool
prop_parse p = read (show p) == p
| 67 |
prop_parse :: Proposition -> Bool
prop_parse p = read (show p) == p
| 67 |
prop_parse p = read (show p) == p
| 33 | false | true | 0 | 7 | 12 | 37 | 16 | 21 | null | null |
haskell-distributed/distributed-process
|
src/Control/Distributed/Process/Internal/Primitives.hs
|
bsd-3-clause
|
whereisRemoteAsync :: NodeId -> String -> Process ()
whereisRemoteAsync nid label = do
here <- getSelfNode
sendCtrlMsg (if nid == here then Nothing else Just nid) (WhereIs label)
-- | Named send to a process in the local registry (asynchronous)
| 253 |
whereisRemoteAsync :: NodeId -> String -> Process ()
whereisRemoteAsync nid label = do
here <- getSelfNode
sendCtrlMsg (if nid == here then Nothing else Just nid) (WhereIs label)
-- | Named send to a process in the local registry (asynchronous)
| 253 |
whereisRemoteAsync nid label = do
here <- getSelfNode
sendCtrlMsg (if nid == here then Nothing else Just nid) (WhereIs label)
-- | Named send to a process in the local registry (asynchronous)
| 200 | false | true | 0 | 10 | 48 | 69 | 34 | 35 | null | null |
spacekitteh/smcghc
|
compiler/codeGen/StgCmmPrim.hs
|
bsd-3-clause
|
emitPrimOp _ res WriteByteArrayOp_Int64 args = doWriteByteArrayOp Nothing b64 res args
| 102 |
emitPrimOp _ res WriteByteArrayOp_Int64 args = doWriteByteArrayOp Nothing b64 res args
| 102 |
emitPrimOp _ res WriteByteArrayOp_Int64 args = doWriteByteArrayOp Nothing b64 res args
| 102 | false | false | 1 | 5 | 26 | 28 | 11 | 17 | null | null |
FranklinChen/music-score
|
sketch/old/trans/trans.hs
|
bsd-3-clause
|
tapp' :: Monoid m => m -> Trans m a -> Trans m a
tapp' m = (tell m >>)
| 70 |
tapp' :: Monoid m => m -> Trans m a -> Trans m a
tapp' m = (tell m >>)
| 70 |
tapp' m = (tell m >>)
| 21 | false | true | 0 | 9 | 19 | 51 | 23 | 28 | null | null |
HIPERFIT/futhark
|
src/Futhark/IR/Primitive.hs
|
isc
|
doBinOp SMin {} = doIntBinOp doSMin
| 35 |
doBinOp SMin {} = doIntBinOp doSMin
| 35 |
doBinOp SMin {} = doIntBinOp doSMin
| 35 | false | false | 1 | 5 | 5 | 17 | 7 | 10 | null | null |
michaelficarra/purescript
|
src/Language/PureScript/CodeGen/JS/Optimizer/Inliner.hs
|
mit
|
isFn (moduleName, fnName) (JSIndexer (JSStringLiteral x) (JSVar y)) = x == fnName && y == moduleName
| 100 |
isFn (moduleName, fnName) (JSIndexer (JSStringLiteral x) (JSVar y)) = x == fnName && y == moduleName
| 100 |
isFn (moduleName, fnName) (JSIndexer (JSStringLiteral x) (JSVar y)) = x == fnName && y == moduleName
| 100 | false | false | 0 | 9 | 15 | 49 | 25 | 24 | null | null |
dmjio/miso
|
examples/svg/Main.hs
|
bsd-3-clause
|
updateModel :: Action -> Model -> Effect Action Model
updateModel (HandleTouch (TouchEvent touch)) model =
model <# do
return $ HandleMouse $ trunc . page $ touch
| 168 |
updateModel :: Action -> Model -> Effect Action Model
updateModel (HandleTouch (TouchEvent touch)) model =
model <# do
return $ HandleMouse $ trunc . page $ touch
| 168 |
updateModel (HandleTouch (TouchEvent touch)) model =
model <# do
return $ HandleMouse $ trunc . page $ touch
| 114 | false | true | 2 | 12 | 32 | 70 | 32 | 38 | null | null |
keera-studios/pang-a-lambda
|
Experiments/collisions/Data/IdentityList.hs
|
gpl-3.0
|
findIL :: ((ILKey, a) -> Bool) -> IL a -> Maybe a
findIL p (IL {ilAssocs = kas}) = findHlp kas
where
findHlp [] = Nothing
findHlp (ka@(_, a) : kas) = if p ka then Just a else findHlp kas
| 221 |
findIL :: ((ILKey, a) -> Bool) -> IL a -> Maybe a
findIL p (IL {ilAssocs = kas}) = findHlp kas
where
findHlp [] = Nothing
findHlp (ka@(_, a) : kas) = if p ka then Just a else findHlp kas
| 221 |
findIL p (IL {ilAssocs = kas}) = findHlp kas
where
findHlp [] = Nothing
findHlp (ka@(_, a) : kas) = if p ka then Just a else findHlp kas
| 171 | false | true | 1 | 10 | 75 | 114 | 58 | 56 | null | null |
arjunguha/haskell-couchdb
|
src/Database/CouchDB/Unsafe.hs
|
bsd-3-clause
|
getAllDocIds ::String -- ^database name
-> CouchMonad [JSString]
getAllDocIds db = do
response <- request' (db ++ "/_all_docs") GET
case rspCode response of
(2,0,0) -> do
let result = couchResponse (rspBody response)
let (JSArray rows) = fromJust $ lookup "rows" result
return $ mapMaybe allDocRow rows
otherwise -> error (show response)
--
-- $views
-- Creating and querying views
--
| 428 |
getAllDocIds ::String -- ^database name
-> CouchMonad [JSString]
getAllDocIds db = do
response <- request' (db ++ "/_all_docs") GET
case rspCode response of
(2,0,0) -> do
let result = couchResponse (rspBody response)
let (JSArray rows) = fromJust $ lookup "rows" result
return $ mapMaybe allDocRow rows
otherwise -> error (show response)
--
-- $views
-- Creating and querying views
--
| 428 |
getAllDocIds db = do
response <- request' (db ++ "/_all_docs") GET
case rspCode response of
(2,0,0) -> do
let result = couchResponse (rspBody response)
let (JSArray rows) = fromJust $ lookup "rows" result
return $ mapMaybe allDocRow rows
otherwise -> error (show response)
--
-- $views
-- Creating and querying views
--
| 350 | false | true | 0 | 17 | 103 | 143 | 70 | 73 | null | null |
stappit/fit-parser
|
library/Types.hs
|
gpl-3.0
|
mkLRB :: Word8 -> LeftRightBalance
mkLRB w = LRB balance contribution
where
contribution = w .&. 0x7F
balance = if w `testBit` 7
then Right
else Unknown
| 204 |
mkLRB :: Word8 -> LeftRightBalance
mkLRB w = LRB balance contribution
where
contribution = w .&. 0x7F
balance = if w `testBit` 7
then Right
else Unknown
| 204 |
mkLRB w = LRB balance contribution
where
contribution = w .&. 0x7F
balance = if w `testBit` 7
then Right
else Unknown
| 169 | false | true | 0 | 8 | 78 | 53 | 29 | 24 | null | null |
rueshyna/gogol
|
gogol-proximitybeacon/gen/Network/Google/Resource/ProximityBeacon/Beacons/Attachments/Delete.hs
|
mpl-2.0
|
-- | OAuth bearer token.
badBearerToken :: Lens' BeaconsAttachmentsDelete (Maybe Text)
badBearerToken
= lens _badBearerToken
(\ s a -> s{_badBearerToken = a})
| 166 |
badBearerToken :: Lens' BeaconsAttachmentsDelete (Maybe Text)
badBearerToken
= lens _badBearerToken
(\ s a -> s{_badBearerToken = a})
| 141 |
badBearerToken
= lens _badBearerToken
(\ s a -> s{_badBearerToken = a})
| 79 | true | true | 1 | 9 | 29 | 51 | 25 | 26 | null | null |
mgaut72/MarkovChain
|
markov-bot/Web/MarkovBot/Main.hs
|
mit
|
--
-- Send a message out to the server we're currently connected to
--
write :: String -> String -> Net ()
write s t = do
h <- use socket
io $ hPrintf h "%s %s\r\n" s t
io $ printf "> %s %s\n" s t
--
-- Convenience.
--
| 234 |
write :: String -> String -> Net ()
write s t = do
h <- use socket
io $ hPrintf h "%s %s\r\n" s t
io $ printf "> %s %s\n" s t
--
-- Convenience.
--
| 163 |
write s t = do
h <- use socket
io $ hPrintf h "%s %s\r\n" s t
io $ printf "> %s %s\n" s t
--
-- Convenience.
--
| 127 | true | true | 0 | 9 | 66 | 80 | 38 | 42 | null | null |
wavewave/LHEParser
|
src/HEP/Parser/LHE/DecayTop.hs
|
bsd-2-clause
|
-- |
mkDecayTop :: DecayMap -> PtlID -> DecayTop PtlID
mkDecayTop dmap pid = let dlist = (M.lookup pid dmap)
in case dlist of
Nothing -> Terminal pid
Just ls -> Decay (pid, map (mkDecayTop dmap) ls)
-- |
| 279 |
mkDecayTop :: DecayMap -> PtlID -> DecayTop PtlID
mkDecayTop dmap pid = let dlist = (M.lookup pid dmap)
in case dlist of
Nothing -> Terminal pid
Just ls -> Decay (pid, map (mkDecayTop dmap) ls)
-- |
| 273 |
mkDecayTop dmap pid = let dlist = (M.lookup pid dmap)
in case dlist of
Nothing -> Terminal pid
Just ls -> Decay (pid, map (mkDecayTop dmap) ls)
-- |
| 223 | true | true | 0 | 14 | 114 | 96 | 46 | 50 | null | null |
ekmett/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcTypes.hs
|
lgpl-2.1
|
withRefPageSetupDialogData :: (Ptr (TPageSetupDialogData a) -> IO ()) -> IO (PageSetupDialogData a)
withRefPageSetupDialogData f
= assignRef wxPageSetupDialogData_Create f
| 174 |
withRefPageSetupDialogData :: (Ptr (TPageSetupDialogData a) -> IO ()) -> IO (PageSetupDialogData a)
withRefPageSetupDialogData f
= assignRef wxPageSetupDialogData_Create f
| 174 |
withRefPageSetupDialogData f
= assignRef wxPageSetupDialogData_Create f
| 74 | false | true | 0 | 10 | 20 | 54 | 25 | 29 | null | null |
sharkspeed/dororis
|
languages/haskell/LYHGG/5-recursion/0-use-recursion.hs
|
bsd-2-clause
|
{-maximum' (x:xs)-}
{-| x > maxTail = x-}
{-| otherwise = maxTail-}
{-where maxTail = maximum' xs-}
maximum' (x:xs) = max x (maximum' xs)
| 149 |
maximum' (x:xs) = max x (maximum' xs)
| 37 |
maximum' (x:xs) = max x (maximum' xs)
| 37 | true | false | 0 | 6 | 35 | 33 | 17 | 16 | null | null |
thalerjonathan/phd
|
thesis/code/sugarscape/src/test/Agent/Move.hs
|
gpl-3.0
|
test_selectBestSites_bestSugarLevel_multibestsamedist :: TestTree
test_selectBestSites_bestSugarLevel_multibestsamedist = testCase "multi best same distances" $ do
let cells = [ ((1,0), pc { sugEnvSiteSugarLevel = 4 })
, ((0,1), pc { sugEnvSiteSugarLevel = 1 })
, ((2,1), pc { sugEnvSiteSugarLevel = 2 })
, ((1,2), pc { sugEnvSiteSugarLevel = 4 }) ]
let bcs = selectBestSites sugarSiteMeasure (1,1) cells
assertEqual "should return 2 cells" 2 (length bcs)
let ((bc1Coord, bc1):(bc2Coord, bc2):_) = bcs
assertEqual "expected different cell 1" (1,0) bc1Coord
assertEqual "level does not match original level of cell 1" 4 (sugEnvSiteSugarLevel bc1)
assertEqual "expected different cell 2" (1,2) bc2Coord
assertEqual "level does not match original level of cell 2" 4 (sugEnvSiteSugarLevel bc2)
assertEqual "sugarlevels do not match although must be same" (sugEnvSiteSugarLevel bc1) (sugEnvSiteSugarLevel bc2)
| 969 |
test_selectBestSites_bestSugarLevel_multibestsamedist :: TestTree
test_selectBestSites_bestSugarLevel_multibestsamedist = testCase "multi best same distances" $ do
let cells = [ ((1,0), pc { sugEnvSiteSugarLevel = 4 })
, ((0,1), pc { sugEnvSiteSugarLevel = 1 })
, ((2,1), pc { sugEnvSiteSugarLevel = 2 })
, ((1,2), pc { sugEnvSiteSugarLevel = 4 }) ]
let bcs = selectBestSites sugarSiteMeasure (1,1) cells
assertEqual "should return 2 cells" 2 (length bcs)
let ((bc1Coord, bc1):(bc2Coord, bc2):_) = bcs
assertEqual "expected different cell 1" (1,0) bc1Coord
assertEqual "level does not match original level of cell 1" 4 (sugEnvSiteSugarLevel bc1)
assertEqual "expected different cell 2" (1,2) bc2Coord
assertEqual "level does not match original level of cell 2" 4 (sugEnvSiteSugarLevel bc2)
assertEqual "sugarlevels do not match although must be same" (sugEnvSiteSugarLevel bc1) (sugEnvSiteSugarLevel bc2)
| 969 |
test_selectBestSites_bestSugarLevel_multibestsamedist = testCase "multi best same distances" $ do
let cells = [ ((1,0), pc { sugEnvSiteSugarLevel = 4 })
, ((0,1), pc { sugEnvSiteSugarLevel = 1 })
, ((2,1), pc { sugEnvSiteSugarLevel = 2 })
, ((1,2), pc { sugEnvSiteSugarLevel = 4 }) ]
let bcs = selectBestSites sugarSiteMeasure (1,1) cells
assertEqual "should return 2 cells" 2 (length bcs)
let ((bc1Coord, bc1):(bc2Coord, bc2):_) = bcs
assertEqual "expected different cell 1" (1,0) bc1Coord
assertEqual "level does not match original level of cell 1" 4 (sugEnvSiteSugarLevel bc1)
assertEqual "expected different cell 2" (1,2) bc2Coord
assertEqual "level does not match original level of cell 2" 4 (sugEnvSiteSugarLevel bc2)
assertEqual "sugarlevels do not match although must be same" (sugEnvSiteSugarLevel bc1) (sugEnvSiteSugarLevel bc2)
| 903 | false | true | 0 | 14 | 186 | 276 | 149 | 127 | null | null |
hucal/SCMinHS
|
Scheme/Types.hs
|
bsd-3-clause
|
getAsDouble :: LispNum -> Double
getAsDouble (Int n) = fromInteger n
| 68 |
getAsDouble :: LispNum -> Double
getAsDouble (Int n) = fromInteger n
| 68 |
getAsDouble (Int n) = fromInteger n
| 35 | false | true | 0 | 9 | 10 | 32 | 14 | 18 | null | null |
beni55/cps-core
|
CPS/Syntax.hs
|
bsd-3-clause
|
lintTransfer :: UniqueMap Type -> UniqueMap CoType -> Transfer -> LintM ()
lintTransfer x_tys u_ntys (Return u ts) = do
lintCoId u_ntys u
mapM_ (lintTrivial x_tys) ts
warnM [hang (pPrint u <+> text "return type incompatible:") 2
(text "Applied:" <+> pPrint ts <+> text "::" <+> pPrint (map trivialType ts) $$
text "Expected:" <+> pPrint (coIdType u))
| map trivialType ts /= coIdType u]
| 433 |
lintTransfer :: UniqueMap Type -> UniqueMap CoType -> Transfer -> LintM ()
lintTransfer x_tys u_ntys (Return u ts) = do
lintCoId u_ntys u
mapM_ (lintTrivial x_tys) ts
warnM [hang (pPrint u <+> text "return type incompatible:") 2
(text "Applied:" <+> pPrint ts <+> text "::" <+> pPrint (map trivialType ts) $$
text "Expected:" <+> pPrint (coIdType u))
| map trivialType ts /= coIdType u]
| 433 |
lintTransfer x_tys u_ntys (Return u ts) = do
lintCoId u_ntys u
mapM_ (lintTrivial x_tys) ts
warnM [hang (pPrint u <+> text "return type incompatible:") 2
(text "Applied:" <+> pPrint ts <+> text "::" <+> pPrint (map trivialType ts) $$
text "Expected:" <+> pPrint (coIdType u))
| map trivialType ts /= coIdType u]
| 358 | false | true | 0 | 17 | 110 | 176 | 78 | 98 | null | null |
brendanhay/gogol
|
gogol-shopping-content/gen/Network/Google/ShoppingContent/Types/Product.hs
|
mpl-2.0
|
-- | Creates a value of 'ProductsCustomBatchRequestEntry' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'prorMerchantId'
--
-- * 'prorUpdateMask'
--
-- * 'prorMethod'
--
-- * 'prorFeedId'
--
-- * 'prorProduct'
--
-- * 'prorProductId'
--
-- * 'prorBatchId'
productsCustomBatchRequestEntry
:: ProductsCustomBatchRequestEntry
productsCustomBatchRequestEntry =
ProductsCustomBatchRequestEntry'
{ _prorMerchantId = Nothing
, _prorUpdateMask = Nothing
, _prorMethod = Nothing
, _prorFeedId = Nothing
, _prorProduct = Nothing
, _prorProductId = Nothing
, _prorBatchId = Nothing
}
| 697 |
productsCustomBatchRequestEntry
:: ProductsCustomBatchRequestEntry
productsCustomBatchRequestEntry =
ProductsCustomBatchRequestEntry'
{ _prorMerchantId = Nothing
, _prorUpdateMask = Nothing
, _prorMethod = Nothing
, _prorFeedId = Nothing
, _prorProduct = Nothing
, _prorProductId = Nothing
, _prorBatchId = Nothing
}
| 354 |
productsCustomBatchRequestEntry =
ProductsCustomBatchRequestEntry'
{ _prorMerchantId = Nothing
, _prorUpdateMask = Nothing
, _prorMethod = Nothing
, _prorFeedId = Nothing
, _prorProduct = Nothing
, _prorProductId = Nothing
, _prorBatchId = Nothing
}
| 283 | true | true | 1 | 7 | 130 | 79 | 53 | 26 | null | null |
Sgoettschkes/learning
|
haskell/exercism/gigasecond/gigasecond_test.hs
|
mit
|
main :: IO ()
main = exitProperly $ runTestTT $ TestList
[ TestList gigasecondTests ]
| 92 |
main :: IO ()
main = exitProperly $ runTestTT $ TestList
[ TestList gigasecondTests ]
| 92 |
main = exitProperly $ runTestTT $ TestList
[ TestList gigasecondTests ]
| 78 | false | true | 0 | 8 | 21 | 33 | 16 | 17 | null | null |
rvion/lamdu
|
bottlelib/Graphics/UI/Bottle/Widgets/Layout.hs
|
gpl-3.0
|
perpAxis Horizontal = _2
| 24 |
perpAxis Horizontal = _2
| 24 |
perpAxis Horizontal = _2
| 24 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
hpacheco/HAAP
|
examples/plab/oracle/SimulateT6.hs
|
mit
|
tempojogo = 1 * 60
| 18 |
tempojogo = 1 * 60
| 18 |
tempojogo = 1 * 60
| 18 | false | false | 0 | 5 | 4 | 10 | 5 | 5 | null | null |
tmcgilchrist/scheme
|
src/Scheme/RTS.hs
|
bsd-3-clause
|
unpackStr :: LispVal -> ThrowsError Text
unpackStr (String s) = return $ s
| 74 |
unpackStr :: LispVal -> ThrowsError Text
unpackStr (String s) = return $ s
| 74 |
unpackStr (String s) = return $ s
| 33 | false | true | 0 | 9 | 12 | 36 | 16 | 20 | null | null |
anchor/candide
|
lib/Candide/Server.hs
|
bsd-3-clause
|
parseContentsRequests :: Monad m => L.ByteString -> m [ContentsRequest]
parseContentsRequests bs = P.toListM $
parsed parseContentsRequest (PB.fromLazy bs)
>>= either (throw . fst) return
| 195 |
parseContentsRequests :: Monad m => L.ByteString -> m [ContentsRequest]
parseContentsRequests bs = P.toListM $
parsed parseContentsRequest (PB.fromLazy bs)
>>= either (throw . fst) return
| 195 |
parseContentsRequests bs = P.toListM $
parsed parseContentsRequest (PB.fromLazy bs)
>>= either (throw . fst) return
| 123 | false | true | 2 | 9 | 31 | 70 | 34 | 36 | null | null |
kalhauge/typeical
|
test/Main.hs
|
mit
|
tests = [
parseTests
, matchTests
]
| 49 |
tests = [
parseTests
, matchTests
]
| 49 |
tests = [
parseTests
, matchTests
]
| 49 | false | false | 1 | 5 | 20 | 15 | 7 | 8 | null | null |
ashnikel/haskellbook
|
ch14/addition/Addition.hs
|
mit
|
genMaybe :: Arbitrary a => Gen (Maybe a)
genMaybe = do
a <- arbitrary
elements [Nothing, Just a]
| 104 |
genMaybe :: Arbitrary a => Gen (Maybe a)
genMaybe = do
a <- arbitrary
elements [Nothing, Just a]
| 104 |
genMaybe = do
a <- arbitrary
elements [Nothing, Just a]
| 63 | false | true | 0 | 9 | 25 | 49 | 23 | 26 | null | null |
takagi/SimulationDSL
|
Examples/InterpreterRun.hs
|
bsd-3-clause
|
rowString :: [Vector3] -> String
rowString = join "," . map vec3String
| 70 |
rowString :: [Vector3] -> String
rowString = join "," . map vec3String
| 70 |
rowString = join "," . map vec3String
| 37 | false | true | 1 | 7 | 11 | 35 | 15 | 20 | null | null |
helino/wham
|
src/Wham/PrettyPrinter.hs
|
bsd-3-clause
|
pprint (IfCP b s1 s2 cp) am = str2
where
info = Map.lookup cp am
str = (pprintState info) ++ (printCond info) ++ "\n"
str2 = str ++ "if " ++ (pprintB b) ++ "\n" ++ (indent 1 "then") ++ "\n"
++ (indent 2 $ pprint s1 am) ++ "\n" ++
(indent 1 "else") ++ "\n" ++ (indent 2 $ pprint s2 am)
| 343 |
pprint (IfCP b s1 s2 cp) am = str2
where
info = Map.lookup cp am
str = (pprintState info) ++ (printCond info) ++ "\n"
str2 = str ++ "if " ++ (pprintB b) ++ "\n" ++ (indent 1 "then") ++ "\n"
++ (indent 2 $ pprint s1 am) ++ "\n" ++
(indent 1 "else") ++ "\n" ++ (indent 2 $ pprint s2 am)
| 343 |
pprint (IfCP b s1 s2 cp) am = str2
where
info = Map.lookup cp am
str = (pprintState info) ++ (printCond info) ++ "\n"
str2 = str ++ "if " ++ (pprintB b) ++ "\n" ++ (indent 1 "then") ++ "\n"
++ (indent 2 $ pprint s1 am) ++ "\n" ++
(indent 1 "else") ++ "\n" ++ (indent 2 $ pprint s2 am)
| 343 | false | false | 6 | 11 | 121 | 174 | 79 | 95 | null | null |
jgm/texmath
|
src/Text/TeXMath/Readers/TeX.hs
|
gpl-2.0
|
cedilla 'o' = "o̧"
| 18 |
cedilla 'o' = "o̧"
| 18 |
cedilla 'o' = "o̧"
| 18 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
newmana/lets-lens
|
src/Lets/Lens.hs
|
bsd-3-clause
|
-- |
--
-- >>> fstL .~ 1 $ (0 :: Int, "abc")
-- (1,"abc")
--
-- >>> sndL .~ 1 $ ("abc", 0 :: Int)
-- ("abc",1)
--
-- prop> let types = (x :: Int, y :: String) in set fstL (x, y) z == (fstL .~ z $ (x, y))
--
-- prop> let types = (x :: Int, y :: String) in set sndL (x, y) z == (sndL .~ z $ (x, y))
(.~) ::
Lens s t a b
-> b
-> s
-> t
(.~) =
error "todo: (.~)"
| 368 |
(.~) ::
Lens s t a b
-> b
-> s
-> t
(.~) =
error "todo: (.~)"
| 71 |
(.~) =
error "todo: (.~)"
| 27 | true | true | 0 | 9 | 105 | 53 | 32 | 21 | null | null |
ancientlanguage/haskell-analysis
|
prepare/src/Prepare/Decompose.hs
|
mit
|
decomposeChar '\x2F91D' = "\x24263"
| 35 |
decomposeChar '\x2F91D' = "\x24263"
| 35 |
decomposeChar '\x2F91D' = "\x24263"
| 35 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
vbalalla/financial_contract_language
|
pfp-jun06/Dice.hs
|
mit
|
dice n = joinWith (:) die (dice (n-1))
| 38 |
dice n = joinWith (:) die (dice (n-1))
| 38 |
dice n = joinWith (:) die (dice (n-1))
| 38 | false | false | 1 | 9 | 7 | 35 | 16 | 19 | null | null |
wochinge/CacheSimulator
|
src/Clock/Clock.hs
|
bsd-3-clause
|
checkPageReference prio (Just (fileID, _, (referenced, fileSize)))
| referenced == Referenced = (Nothing, Just (fileID, prio, (NotReferenced, fileSize)))
| otherwise = (Just (fileID, fileSize), Nothing)
| 210 |
checkPageReference prio (Just (fileID, _, (referenced, fileSize)))
| referenced == Referenced = (Nothing, Just (fileID, prio, (NotReferenced, fileSize)))
| otherwise = (Just (fileID, fileSize), Nothing)
| 210 |
checkPageReference prio (Just (fileID, _, (referenced, fileSize)))
| referenced == Referenced = (Nothing, Just (fileID, prio, (NotReferenced, fileSize)))
| otherwise = (Just (fileID, fileSize), Nothing)
| 210 | false | false | 1 | 9 | 32 | 89 | 50 | 39 | null | null |
wolftune/yesodweb.com
|
Application.hs
|
bsd-2-clause
|
pullGitBranches :: YesodWeb -> IO ()
pullGitBranches yw = do
forM_ branches $ \(dir, branch) -> do
let run x y = void $ runProcess x y (Just dir) Nothing Nothing Nothing Nothing >>= waitForProcess
run "git" ["fetch"]
run "git" ["checkout", "origin/" ++ branch]
eblog <- loadBlog
case eblog of
Left e -> print e
Right blog -> writeIORef (ywBlog yw) blog
bsReload $ getBook14 yw
bsReload $ getBook12 yw
bsReload $ getBook11 yw
loadAuthors >>= writeIORef (ywAuthors yw)
| 534 |
pullGitBranches :: YesodWeb -> IO ()
pullGitBranches yw = do
forM_ branches $ \(dir, branch) -> do
let run x y = void $ runProcess x y (Just dir) Nothing Nothing Nothing Nothing >>= waitForProcess
run "git" ["fetch"]
run "git" ["checkout", "origin/" ++ branch]
eblog <- loadBlog
case eblog of
Left e -> print e
Right blog -> writeIORef (ywBlog yw) blog
bsReload $ getBook14 yw
bsReload $ getBook12 yw
bsReload $ getBook11 yw
loadAuthors >>= writeIORef (ywAuthors yw)
| 534 |
pullGitBranches yw = do
forM_ branches $ \(dir, branch) -> do
let run x y = void $ runProcess x y (Just dir) Nothing Nothing Nothing Nothing >>= waitForProcess
run "git" ["fetch"]
run "git" ["checkout", "origin/" ++ branch]
eblog <- loadBlog
case eblog of
Left e -> print e
Right blog -> writeIORef (ywBlog yw) blog
bsReload $ getBook14 yw
bsReload $ getBook12 yw
bsReload $ getBook11 yw
loadAuthors >>= writeIORef (ywAuthors yw)
| 497 | false | true | 0 | 19 | 146 | 213 | 96 | 117 | null | null |
Daniel-Diaz/yesod
|
yesod-test/Yesod/Test.hs
|
mit
|
-- | Get the foundation value used for the current test.
--
-- Since 1.2.0
getTestYesod :: YesodExample site site
getTestYesod = fmap yedSite ST.get
| 148 |
getTestYesod :: YesodExample site site
getTestYesod = fmap yedSite ST.get
| 73 |
getTestYesod = fmap yedSite ST.get
| 34 | true | true | 0 | 6 | 24 | 26 | 14 | 12 | null | null |
Ornedan/dom4statusbot
|
src/Model/Dominions4.hs
|
bsd-3-clause
|
nationName 86 = "EA Oceania"
| 28 |
nationName 86 = "EA Oceania"
| 28 |
nationName 86 = "EA Oceania"
| 28 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
CulpaBS/wbBach
|
src/Futhark/Optimise/InPlaceLowering.hs
|
bsd-3-clause
|
bindingNumber :: VName -> ForwardingM Int
bindingNumber name = do
res <- asks $ fmap entryNumber . HM.lookup name . topDownTable
case res of Just n -> return n
Nothing -> fail $ "bindingNumber: variable " ++
pretty name ++ " not found."
| 280 |
bindingNumber :: VName -> ForwardingM Int
bindingNumber name = do
res <- asks $ fmap entryNumber . HM.lookup name . topDownTable
case res of Just n -> return n
Nothing -> fail $ "bindingNumber: variable " ++
pretty name ++ " not found."
| 280 |
bindingNumber name = do
res <- asks $ fmap entryNumber . HM.lookup name . topDownTable
case res of Just n -> return n
Nothing -> fail $ "bindingNumber: variable " ++
pretty name ++ " not found."
| 238 | false | true | 0 | 12 | 86 | 88 | 40 | 48 | null | null |
alexander-at-github/eta
|
compiler/ETA/Main/Packages.hs
|
bsd-3-clause
|
matching (PackageIdArg str) = matchingId str
| 44 |
matching (PackageIdArg str) = matchingId str
| 44 |
matching (PackageIdArg str) = matchingId str
| 44 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
CaptainPatate/xmonad-contrib
|
XMonad/Actions/FloatSnap.hs
|
bsd-3-clause
|
getSnap :: Bool -> Maybe Int -> Display -> Window -> X ((Maybe Int,Maybe Int,Bool),(Maybe Int,Maybe Int,Bool))
getSnap horiz collidedist d w = do
wa <- io $ getWindowAttributes d w
screen <- W.current <$> gets windowset
let sr = screenRect $ W.screenDetail screen
wl = W.integrate' . W.stack $ W.workspace screen
gr <- fmap ($sr) $ calcGapForAll $ S.fromList [minBound .. maxBound]
wla <- filter (collides wa) `fmap` (io $ mapM (getWindowAttributes d) $ filter (/=w) wl)
return ( neighbours (back wa sr gr wla) (wpos wa)
, neighbours (front wa sr gr wla) (wpos wa + wdim wa)
)
where
wborder = fromIntegral.wa_border_width
(wpos, wdim, rpos, rdim) = constructors horiz
(refwpos, refwdim, _, _) = constructors $ not horiz
back wa sr gr wla = dropWhile (< rpos sr) $
takeWhile (< rpos sr + rdim sr) $
sort $ (rpos sr):(rpos gr):(rpos gr + rdim gr):
foldr (\a as -> (wpos a):(wpos a + wdim a + wborder a + wborder wa):as) [] wla
front wa sr gr wla = dropWhile (<= rpos sr) $
takeWhile (<= rpos sr + rdim sr) $
sort $ (rpos gr - 2*wborder wa):(rpos gr + rdim gr - 2*wborder wa):(rpos sr + rdim sr - 2*wborder wa):
foldr (\a as -> (wpos a - wborder a - wborder wa):(wpos a + wdim a):as) [] wla
neighbours l v = ( listToMaybe $ reverse $ takeWhile (< v) l
, listToMaybe $ dropWhile (<= v) l
, v `elem` l
)
collides wa oa = case collidedist of
Nothing -> True
Just dist -> ( refwpos oa - wborder oa < refwpos wa + refwdim wa + wborder wa + dist
&& refwpos wa - wborder wa - dist < refwpos oa + refwdim oa + wborder oa )
| 1,993 |
getSnap :: Bool -> Maybe Int -> Display -> Window -> X ((Maybe Int,Maybe Int,Bool),(Maybe Int,Maybe Int,Bool))
getSnap horiz collidedist d w = do
wa <- io $ getWindowAttributes d w
screen <- W.current <$> gets windowset
let sr = screenRect $ W.screenDetail screen
wl = W.integrate' . W.stack $ W.workspace screen
gr <- fmap ($sr) $ calcGapForAll $ S.fromList [minBound .. maxBound]
wla <- filter (collides wa) `fmap` (io $ mapM (getWindowAttributes d) $ filter (/=w) wl)
return ( neighbours (back wa sr gr wla) (wpos wa)
, neighbours (front wa sr gr wla) (wpos wa + wdim wa)
)
where
wborder = fromIntegral.wa_border_width
(wpos, wdim, rpos, rdim) = constructors horiz
(refwpos, refwdim, _, _) = constructors $ not horiz
back wa sr gr wla = dropWhile (< rpos sr) $
takeWhile (< rpos sr + rdim sr) $
sort $ (rpos sr):(rpos gr):(rpos gr + rdim gr):
foldr (\a as -> (wpos a):(wpos a + wdim a + wborder a + wborder wa):as) [] wla
front wa sr gr wla = dropWhile (<= rpos sr) $
takeWhile (<= rpos sr + rdim sr) $
sort $ (rpos gr - 2*wborder wa):(rpos gr + rdim gr - 2*wborder wa):(rpos sr + rdim sr - 2*wborder wa):
foldr (\a as -> (wpos a - wborder a - wborder wa):(wpos a + wdim a):as) [] wla
neighbours l v = ( listToMaybe $ reverse $ takeWhile (< v) l
, listToMaybe $ dropWhile (<= v) l
, v `elem` l
)
collides wa oa = case collidedist of
Nothing -> True
Just dist -> ( refwpos oa - wborder oa < refwpos wa + refwdim wa + wborder wa + dist
&& refwpos wa - wborder wa - dist < refwpos oa + refwdim oa + wborder oa )
| 1,993 |
getSnap horiz collidedist d w = do
wa <- io $ getWindowAttributes d w
screen <- W.current <$> gets windowset
let sr = screenRect $ W.screenDetail screen
wl = W.integrate' . W.stack $ W.workspace screen
gr <- fmap ($sr) $ calcGapForAll $ S.fromList [minBound .. maxBound]
wla <- filter (collides wa) `fmap` (io $ mapM (getWindowAttributes d) $ filter (/=w) wl)
return ( neighbours (back wa sr gr wla) (wpos wa)
, neighbours (front wa sr gr wla) (wpos wa + wdim wa)
)
where
wborder = fromIntegral.wa_border_width
(wpos, wdim, rpos, rdim) = constructors horiz
(refwpos, refwdim, _, _) = constructors $ not horiz
back wa sr gr wla = dropWhile (< rpos sr) $
takeWhile (< rpos sr + rdim sr) $
sort $ (rpos sr):(rpos gr):(rpos gr + rdim gr):
foldr (\a as -> (wpos a):(wpos a + wdim a + wborder a + wborder wa):as) [] wla
front wa sr gr wla = dropWhile (<= rpos sr) $
takeWhile (<= rpos sr + rdim sr) $
sort $ (rpos gr - 2*wborder wa):(rpos gr + rdim gr - 2*wborder wa):(rpos sr + rdim sr - 2*wborder wa):
foldr (\a as -> (wpos a - wborder a - wborder wa):(wpos a + wdim a):as) [] wla
neighbours l v = ( listToMaybe $ reverse $ takeWhile (< v) l
, listToMaybe $ dropWhile (<= v) l
, v `elem` l
)
collides wa oa = case collidedist of
Nothing -> True
Just dist -> ( refwpos oa - wborder oa < refwpos wa + refwdim wa + wborder wa + dist
&& refwpos wa - wborder wa - dist < refwpos oa + refwdim oa + wborder oa )
| 1,882 | false | true | 0 | 22 | 779 | 855 | 420 | 435 | null | null |
brendanhay/gogol
|
gogol-admin-directory/gen/Network/Google/Resource/Directory/ChromeosDevices/Get.hs
|
mpl-2.0
|
-- | Determines whether the response contains the full list of properties or
-- only a subset.
cdgProjection :: Lens' ChromeosDevicesGet (Maybe ChromeosDevicesGetProjection)
cdgProjection
= lens _cdgProjection
(\ s a -> s{_cdgProjection = a})
| 250 |
cdgProjection :: Lens' ChromeosDevicesGet (Maybe ChromeosDevicesGetProjection)
cdgProjection
= lens _cdgProjection
(\ s a -> s{_cdgProjection = a})
| 155 |
cdgProjection
= lens _cdgProjection
(\ s a -> s{_cdgProjection = a})
| 76 | true | true | 0 | 9 | 41 | 49 | 26 | 23 | null | null |
vdweegen/UvA-Software_Testing
|
Lab5/Jordan/Lecture5Original.hs
|
gpl-3.0
|
emptyN :: Node
emptyN = (\ _ -> 0,constraints (\ _ -> 0))
| 57 |
emptyN :: Node
emptyN = (\ _ -> 0,constraints (\ _ -> 0))
| 57 |
emptyN = (\ _ -> 0,constraints (\ _ -> 0))
| 42 | false | true | 0 | 9 | 12 | 40 | 20 | 20 | null | null |
facebookincubator/duckling
|
Duckling/Numeral/AF/Rules.hs
|
bsd-3-clause
|
ruleDecimals :: Rule
ruleDecimals = Rule
{ name = "decimal number"
, pattern =
[ regex "(\\d*\\,\\d+)"
]
, prod = \case
(Token RegexMatch (GroupMatch (match:_)):_) -> parseDecimal False match
_ -> Nothing
}
| 234 |
ruleDecimals :: Rule
ruleDecimals = Rule
{ name = "decimal number"
, pattern =
[ regex "(\\d*\\,\\d+)"
]
, prod = \case
(Token RegexMatch (GroupMatch (match:_)):_) -> parseDecimal False match
_ -> Nothing
}
| 234 |
ruleDecimals = Rule
{ name = "decimal number"
, pattern =
[ regex "(\\d*\\,\\d+)"
]
, prod = \case
(Token RegexMatch (GroupMatch (match:_)):_) -> parseDecimal False match
_ -> Nothing
}
| 213 | false | true | 0 | 17 | 61 | 85 | 45 | 40 | null | null |
andrewMacmurray/haskell-book-solutions
|
src/ch17/Cow.hs
|
mit
|
-- With Maybe Monad
cowFromString'' :: String -> Int -> Int -> Maybe Cow
cowFromString'' n a w =
noEmpty n >>=
\name ->
noNegative a >>=
\age ->
noNegative w >>=
\weight ->
return $ Cow name age weight
| 222 |
cowFromString'' :: String -> Int -> Int -> Maybe Cow
cowFromString'' n a w =
noEmpty n >>=
\name ->
noNegative a >>=
\age ->
noNegative w >>=
\weight ->
return $ Cow name age weight
| 201 |
cowFromString'' n a w =
noEmpty n >>=
\name ->
noNegative a >>=
\age ->
noNegative w >>=
\weight ->
return $ Cow name age weight
| 148 | true | true | 0 | 12 | 60 | 81 | 40 | 41 | null | null |
sopvop/cabal
|
cabal-install/Distribution/Client/BuildReports/Anonymous.hs
|
bsd-3-clause
|
cabalInstallID :: PackageIdentifier
cabalInstallID =
PackageIdentifier (PackageName "cabal-install") Paths_cabal_install.version
| 130 |
cabalInstallID :: PackageIdentifier
cabalInstallID =
PackageIdentifier (PackageName "cabal-install") Paths_cabal_install.version
| 130 |
cabalInstallID =
PackageIdentifier (PackageName "cabal-install") Paths_cabal_install.version
| 94 | false | true | 0 | 7 | 10 | 24 | 12 | 12 | null | null |
sol/inject
|
driver/Main.hs
|
mit
|
main :: IO ()
main = T.getContents >>= inject >>= T.putStr
| 58 |
main :: IO ()
main = T.getContents >>= inject >>= T.putStr
| 58 |
main = T.getContents >>= inject >>= T.putStr
| 44 | false | true | 1 | 7 | 10 | 32 | 14 | 18 | null | null |
sdiehl/ghc
|
compiler/GHC/CmmToC.hs
|
bsd-3-clause
|
isStrangeTypeGlobal CurrentTSO = True
| 46 |
isStrangeTypeGlobal CurrentTSO = True
| 46 |
isStrangeTypeGlobal CurrentTSO = True
| 46 | false | false | 0 | 5 | 12 | 9 | 4 | 5 | null | null |
langthom/stats
|
CalcStats.hs
|
bsd-3-clause
|
buildOutString ("--hm":r) nums str = if not (any (0==) nums) then str ++ "Harmonic Mean: \t\t\t" ++ show (calcHarmonicM nums) ++ "\n" ++
buildOutString r nums str
else str ++ "Harmonic Mean: \t\t\tCannot be computed because of some '0' numbers\n" ++
buildOutString r nums str
| 470 |
buildOutString ("--hm":r) nums str = if not (any (0==) nums) then str ++ "Harmonic Mean: \t\t\t" ++ show (calcHarmonicM nums) ++ "\n" ++
buildOutString r nums str
else str ++ "Harmonic Mean: \t\t\tCannot be computed because of some '0' numbers\n" ++
buildOutString r nums str
| 470 |
buildOutString ("--hm":r) nums str = if not (any (0==) nums) then str ++ "Harmonic Mean: \t\t\t" ++ show (calcHarmonicM nums) ++ "\n" ++
buildOutString r nums str
else str ++ "Harmonic Mean: \t\t\tCannot be computed because of some '0' numbers\n" ++
buildOutString r nums str
| 470 | false | false | 0 | 11 | 239 | 90 | 45 | 45 | null | null |
audetto/andsoft
|
haskell/Elves/Exp.hs
|
gpl-3.0
|
type3 f (E a) (E b) (E c) = E (f a b c)
| 39 |
type3 f (E a) (E b) (E c) = E (f a b c)
| 39 |
type3 f (E a) (E b) (E c) = E (f a b c)
| 39 | false | false | 1 | 7 | 13 | 50 | 22 | 28 | null | null |
rfranek/duckling
|
Duckling/Time/PT/Rules.hs
|
bsd-3-clause
|
ruleNCycleAtras :: Rule
ruleNCycleAtras = Rule
{ name = "n <cycle> atras"
, pattern =
[ Predicate $ isIntegerBetween 2 9999
, dimension TimeGrain
, regex "atr(a|\x00e1)s"
]
, prod = \tokens -> case tokens of
(token:Token TimeGrain grain:_) -> do
v <- getIntValue token
tt $ cycleN True grain (- v)
_ -> Nothing
}
| 364 |
ruleNCycleAtras :: Rule
ruleNCycleAtras = Rule
{ name = "n <cycle> atras"
, pattern =
[ Predicate $ isIntegerBetween 2 9999
, dimension TimeGrain
, regex "atr(a|\x00e1)s"
]
, prod = \tokens -> case tokens of
(token:Token TimeGrain grain:_) -> do
v <- getIntValue token
tt $ cycleN True grain (- v)
_ -> Nothing
}
| 364 |
ruleNCycleAtras = Rule
{ name = "n <cycle> atras"
, pattern =
[ Predicate $ isIntegerBetween 2 9999
, dimension TimeGrain
, regex "atr(a|\x00e1)s"
]
, prod = \tokens -> case tokens of
(token:Token TimeGrain grain:_) -> do
v <- getIntValue token
tt $ cycleN True grain (- v)
_ -> Nothing
}
| 340 | false | true | 0 | 17 | 107 | 125 | 64 | 61 | null | null |
scott-fleischman/greek-grammar
|
haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs
|
mit
|
decomposeChar '\x30D0' = "\x30CF\x3099"
| 39 |
decomposeChar '\x30D0' = "\x30CF\x3099"
| 39 |
decomposeChar '\x30D0' = "\x30CF\x3099"
| 39 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
dcreager/cabal
|
Distribution/ParseUtils.hs
|
bsd-3-clause
|
parseSepList :: ReadP r b
-> ReadP r a -- ^The parser for the stuff between commas
-> ReadP r [a]
parseSepList sepr p = sepBy p separator
where separator = skipSpaces >> sepr >> skipSpaces
| 218 |
parseSepList :: ReadP r b
-> ReadP r a -- ^The parser for the stuff between commas
-> ReadP r [a]
parseSepList sepr p = sepBy p separator
where separator = skipSpaces >> sepr >> skipSpaces
| 218 |
parseSepList sepr p = sepBy p separator
where separator = skipSpaces >> sepr >> skipSpaces
| 94 | false | true | 1 | 9 | 65 | 73 | 32 | 41 | null | null |
jwiegley/github
|
src/GitHub/Endpoints/PullRequests/Comments.hs
|
bsd-3-clause
|
createPullCommentReplyR :: Name Owner -> Name Repo -> IssueNumber -> Id Comment -> Text -> Request 'RW Comment
createPullCommentReplyR user repo iss cid body =
command Post parts (encode $ PullCommentReply body)
where
parts = ["repos", toPathPart user, toPathPart repo, "pulls", toPathPart iss
, "comments", toPathPart cid, "replies"]
| 356 |
createPullCommentReplyR :: Name Owner -> Name Repo -> IssueNumber -> Id Comment -> Text -> Request 'RW Comment
createPullCommentReplyR user repo iss cid body =
command Post parts (encode $ PullCommentReply body)
where
parts = ["repos", toPathPart user, toPathPart repo, "pulls", toPathPart iss
, "comments", toPathPart cid, "replies"]
| 356 |
createPullCommentReplyR user repo iss cid body =
command Post parts (encode $ PullCommentReply body)
where
parts = ["repos", toPathPart user, toPathPart repo, "pulls", toPathPart iss
, "comments", toPathPart cid, "replies"]
| 245 | false | true | 0 | 11 | 69 | 119 | 59 | 60 | null | null |
danr/hipspec
|
testsuite/prod/Definitions.hs
|
gpl-3.0
|
S x <= S y = x <= y
| 19 |
S x <= S y = x <= y
| 19 |
S x <= S y = x <= y
| 19 | false | false | 2 | 6 | 8 | 24 | 10 | 14 | null | null |
tdfirth/lambda
|
src/Lambda/Parse.hs
|
mit
|
spaces :: Parser ()
spaces = skipMany1 space
| 44 |
spaces :: Parser ()
spaces = skipMany1 space
| 44 |
spaces = skipMany1 space
| 24 | false | true | 0 | 6 | 7 | 19 | 9 | 10 | null | null |
xnning/fcore
|
lib/OptiUtils.hs
|
bsd-2-clause
|
joinExpr (JMethod jc m es cn) =
JMethod (fmap joinExpr jc) m (map joinExpr es) cn
| 83 |
joinExpr (JMethod jc m es cn) =
JMethod (fmap joinExpr jc) m (map joinExpr es) cn
| 83 |
joinExpr (JMethod jc m es cn) =
JMethod (fmap joinExpr jc) m (map joinExpr es) cn
| 83 | false | false | 0 | 7 | 17 | 46 | 22 | 24 | null | null |
ygale/yesod
|
yesod-form/Yesod/Form/I18n/English.hs
|
mit
|
englishFormMessage :: FormMessage -> Text
englishFormMessage (MsgInvalidInteger t) = "Invalid integer: " `mappend` t
| 116 |
englishFormMessage :: FormMessage -> Text
englishFormMessage (MsgInvalidInteger t) = "Invalid integer: " `mappend` t
| 116 |
englishFormMessage (MsgInvalidInteger t) = "Invalid integer: " `mappend` t
| 74 | false | true | 0 | 7 | 13 | 30 | 16 | 14 | null | null |
cartazio/arithmoi
|
Math/NumberTheory/ArithmeticFunctions/NFreedom.hs
|
mit
|
nFrees n = concatMap (uncurry (nFreesBlock n)) $ zip bounds strides
where
-- The 56th element of @iterate (2 *) 256@ is @2^64 :: Word == 0@, so to
-- avoid overflow only the first 55 elements of this list are used.
-- After those, since @maxBound :: Int@ is the largest a vector can be,
-- this value is just repeated. This means after a few dozen iterations,
-- the sieve will stop increasing in size.
strides :: [Word]
strides = take 55 (iterate (2 *) 256) ++ repeat (fromIntegral (maxBound :: Int))
-- Infinite list of lower bounds at which @sieveBlockNFree@ will be
-- applied. This has type @Integral a => a@ instead of @Word@ because
-- unlike the sizes of the sieve that eventually stop increasing (see
-- above comment), the lower bound at which @sieveBlockNFree@ is called does not.
bounds :: [a]
bounds = scanl' (+) 1 $ map fromIntegral strides
-- | Generate @n@-free numbers in a block starting at a certain value.
-- The length of the list is determined by the value passed in as the third
-- argument. It will be lesser than or equal to this value.
--
-- This function should not be used with a negative lower bound. If it is,
-- the result is undefined.
--
-- The block length cannot exceed @maxBound :: Int@, this precondition is not
-- checked.
--
-- As with @nFrees@, passing @n = 0, 1@ results in an empty list.
| 1,385 |
nFrees n = concatMap (uncurry (nFreesBlock n)) $ zip bounds strides
where
-- The 56th element of @iterate (2 *) 256@ is @2^64 :: Word == 0@, so to
-- avoid overflow only the first 55 elements of this list are used.
-- After those, since @maxBound :: Int@ is the largest a vector can be,
-- this value is just repeated. This means after a few dozen iterations,
-- the sieve will stop increasing in size.
strides :: [Word]
strides = take 55 (iterate (2 *) 256) ++ repeat (fromIntegral (maxBound :: Int))
-- Infinite list of lower bounds at which @sieveBlockNFree@ will be
-- applied. This has type @Integral a => a@ instead of @Word@ because
-- unlike the sizes of the sieve that eventually stop increasing (see
-- above comment), the lower bound at which @sieveBlockNFree@ is called does not.
bounds :: [a]
bounds = scanl' (+) 1 $ map fromIntegral strides
-- | Generate @n@-free numbers in a block starting at a certain value.
-- The length of the list is determined by the value passed in as the third
-- argument. It will be lesser than or equal to this value.
--
-- This function should not be used with a negative lower bound. If it is,
-- the result is undefined.
--
-- The block length cannot exceed @maxBound :: Int@, this precondition is not
-- checked.
--
-- As with @nFrees@, passing @n = 0, 1@ results in an empty list.
| 1,385 |
nFrees n = concatMap (uncurry (nFreesBlock n)) $ zip bounds strides
where
-- The 56th element of @iterate (2 *) 256@ is @2^64 :: Word == 0@, so to
-- avoid overflow only the first 55 elements of this list are used.
-- After those, since @maxBound :: Int@ is the largest a vector can be,
-- this value is just repeated. This means after a few dozen iterations,
-- the sieve will stop increasing in size.
strides :: [Word]
strides = take 55 (iterate (2 *) 256) ++ repeat (fromIntegral (maxBound :: Int))
-- Infinite list of lower bounds at which @sieveBlockNFree@ will be
-- applied. This has type @Integral a => a@ instead of @Word@ because
-- unlike the sizes of the sieve that eventually stop increasing (see
-- above comment), the lower bound at which @sieveBlockNFree@ is called does not.
bounds :: [a]
bounds = scanl' (+) 1 $ map fromIntegral strides
-- | Generate @n@-free numbers in a block starting at a certain value.
-- The length of the list is determined by the value passed in as the third
-- argument. It will be lesser than or equal to this value.
--
-- This function should not be used with a negative lower bound. If it is,
-- the result is undefined.
--
-- The block length cannot exceed @maxBound :: Int@, this precondition is not
-- checked.
--
-- As with @nFrees@, passing @n = 0, 1@ results in an empty list.
| 1,385 | false | false | 0 | 10 | 303 | 134 | 79 | 55 | null | null |
jonsterling/ETT-Lite
|
src/TypeCheck.hs
|
bsd-3-clause
|
tcTerm t@(Prod a b ann1) ann2 = do
ann <- matchAnnots ann1 ann2
case ann of
Nothing -> err [DS "Cannot check term", DD t, DS "without annotation"]
Just ty@(Sigma bnd) -> do
((x, unembed-> tyA), tyB) <- unbind bnd
(aa,_) <- checkType a tyA
(ba,_) <- extendCtxs [Sig x tyA, Def x aa] $ checkType b tyB
return (Prod aa ba (Annot ann), ty)
Just ty -> err [DS "Products must have Sigma Type", DD ty,
DS "found instead"]
| 473 |
tcTerm t@(Prod a b ann1) ann2 = do
ann <- matchAnnots ann1 ann2
case ann of
Nothing -> err [DS "Cannot check term", DD t, DS "without annotation"]
Just ty@(Sigma bnd) -> do
((x, unembed-> tyA), tyB) <- unbind bnd
(aa,_) <- checkType a tyA
(ba,_) <- extendCtxs [Sig x tyA, Def x aa] $ checkType b tyB
return (Prod aa ba (Annot ann), ty)
Just ty -> err [DS "Products must have Sigma Type", DD ty,
DS "found instead"]
| 473 |
tcTerm t@(Prod a b ann1) ann2 = do
ann <- matchAnnots ann1 ann2
case ann of
Nothing -> err [DS "Cannot check term", DD t, DS "without annotation"]
Just ty@(Sigma bnd) -> do
((x, unembed-> tyA), tyB) <- unbind bnd
(aa,_) <- checkType a tyA
(ba,_) <- extendCtxs [Sig x tyA, Def x aa] $ checkType b tyB
return (Prod aa ba (Annot ann), ty)
Just ty -> err [DS "Products must have Sigma Type", DD ty,
DS "found instead"]
| 473 | false | false | 1 | 17 | 138 | 235 | 111 | 124 | null | null |
troydm/edda
|
src/EDDA/Schema/CommodityV3.hs
|
mit
|
getCommodity :: Value -> ConfigT (Maybe CommodityMarketInfo)
getCommodity v = do
ret <- do
let statusFlags = getStrArray v "statusFlags"
return $ do name <- getStr v "name"
meanPrice <- getInt v "meanPrice"
buyPrice <- getInt v "buyPrice"
stock <- getInt v "stock"
let stockBracket = Low
stockBracket <- getBracket v "stockBracket"
sellPrice <- getInt v "sellPrice"
demand <- getInt v "demand"
let demandBracket = Low
demandBracket <- getBracket v "demandBracket"
return CommodityMarketInfo { commodityMarketInfoName = name,
commodityMarketInfoMeanPrice = meanPrice,
commodityMarketInfoBuyPrice = buyPrice,
commodityMarketInfoSupply = stock,
commodityMarketInfoSupplyLevel = stockBracket,
commodityMarketInfoSellPrice = sellPrice,
commodityMarketInfoDemand = demand,
commodityMarketInfoDemandLevel = demandBracket,
commodityMarketInfoStatusFlags = statusFlags }
if isNothing ret then liftIO (errorM "EDDA.Schema.CommodityV3" ("Couldn't parse commodity v3: " ++ show v)) >> return Nothing else return ret
| 1,866 |
getCommodity :: Value -> ConfigT (Maybe CommodityMarketInfo)
getCommodity v = do
ret <- do
let statusFlags = getStrArray v "statusFlags"
return $ do name <- getStr v "name"
meanPrice <- getInt v "meanPrice"
buyPrice <- getInt v "buyPrice"
stock <- getInt v "stock"
let stockBracket = Low
stockBracket <- getBracket v "stockBracket"
sellPrice <- getInt v "sellPrice"
demand <- getInt v "demand"
let demandBracket = Low
demandBracket <- getBracket v "demandBracket"
return CommodityMarketInfo { commodityMarketInfoName = name,
commodityMarketInfoMeanPrice = meanPrice,
commodityMarketInfoBuyPrice = buyPrice,
commodityMarketInfoSupply = stock,
commodityMarketInfoSupplyLevel = stockBracket,
commodityMarketInfoSellPrice = sellPrice,
commodityMarketInfoDemand = demand,
commodityMarketInfoDemandLevel = demandBracket,
commodityMarketInfoStatusFlags = statusFlags }
if isNothing ret then liftIO (errorM "EDDA.Schema.CommodityV3" ("Couldn't parse commodity v3: " ++ show v)) >> return Nothing else return ret
| 1,866 |
getCommodity v = do
ret <- do
let statusFlags = getStrArray v "statusFlags"
return $ do name <- getStr v "name"
meanPrice <- getInt v "meanPrice"
buyPrice <- getInt v "buyPrice"
stock <- getInt v "stock"
let stockBracket = Low
stockBracket <- getBracket v "stockBracket"
sellPrice <- getInt v "sellPrice"
demand <- getInt v "demand"
let demandBracket = Low
demandBracket <- getBracket v "demandBracket"
return CommodityMarketInfo { commodityMarketInfoName = name,
commodityMarketInfoMeanPrice = meanPrice,
commodityMarketInfoBuyPrice = buyPrice,
commodityMarketInfoSupply = stock,
commodityMarketInfoSupplyLevel = stockBracket,
commodityMarketInfoSellPrice = sellPrice,
commodityMarketInfoDemand = demand,
commodityMarketInfoDemandLevel = demandBracket,
commodityMarketInfoStatusFlags = statusFlags }
if isNothing ret then liftIO (errorM "EDDA.Schema.CommodityV3" ("Couldn't parse commodity v3: " ++ show v)) >> return Nothing else return ret
| 1,805 | false | true | 0 | 15 | 985 | 276 | 133 | 143 | null | null |
raichoo/Idris-dev
|
src/Idris/AbsSyntaxTree.hs
|
bsd-3-clause
|
eqCon = sUN "Refl"
| 18 |
eqCon = sUN "Refl"
| 18 |
eqCon = sUN "Refl"
| 18 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
brendanhay/gogol
|
gogol-androidmanagement/gen/Network/Google/AndroidManagement/Types/Product.hs
|
mpl-2.0
|
-- | The system bootloader version number, e.g. 0.6.7.
siBootLoaderVersion :: Lens' SoftwareInfo (Maybe Text)
siBootLoaderVersion
= lens _siBootLoaderVersion
(\ s a -> s{_siBootLoaderVersion = a})
| 204 |
siBootLoaderVersion :: Lens' SoftwareInfo (Maybe Text)
siBootLoaderVersion
= lens _siBootLoaderVersion
(\ s a -> s{_siBootLoaderVersion = a})
| 149 |
siBootLoaderVersion
= lens _siBootLoaderVersion
(\ s a -> s{_siBootLoaderVersion = a})
| 94 | true | true | 0 | 8 | 33 | 49 | 25 | 24 | null | null |
Chobbes/Juicy.Pixels
|
src/Codec/Picture/Png/Export.hs
|
bsd-3-clause
|
encodePalettedPng :: Palette -> Image Pixel8 -> Either String Lb.ByteString
encodePalettedPng = encodePalettedPngWithMetadata mempty
| 133 |
encodePalettedPng :: Palette -> Image Pixel8 -> Either String Lb.ByteString
encodePalettedPng = encodePalettedPngWithMetadata mempty
| 132 |
encodePalettedPng = encodePalettedPngWithMetadata mempty
| 56 | false | true | 0 | 9 | 14 | 37 | 16 | 21 | null | null |
Helium4Haskell/helium
|
src/Helium/Syntax/UHA_Range.hs
|
gpl-3.0
|
getExprRange (Expression_Negate r _ ) = r
| 56 |
getExprRange (Expression_Negate r _ ) = r
| 56 |
getExprRange (Expression_Negate r _ ) = r
| 56 | false | false | 0 | 7 | 21 | 17 | 8 | 9 | null | null |
nushio3/ghc
|
compiler/utils/Outputable.hs
|
bsd-3-clause
|
debugStyle :: PprStyle -> Bool
debugStyle PprDebug = True
| 57 |
debugStyle :: PprStyle -> Bool
debugStyle PprDebug = True
| 57 |
debugStyle PprDebug = True
| 26 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
rueshyna/gogol
|
gogol-apps-calendar/gen/Network/Google/AppsCalendar/Types/Product.hs
|
mpl-2.0
|
-- | Creation time of the event (as a RFC3339 timestamp). Read-only.
eCreated :: Lens' Event (Maybe UTCTime)
eCreated
= lens _eCreated (\ s a -> s{_eCreated = a}) .
mapping _DateTime
| 190 |
eCreated :: Lens' Event (Maybe UTCTime)
eCreated
= lens _eCreated (\ s a -> s{_eCreated = a}) .
mapping _DateTime
| 121 |
eCreated
= lens _eCreated (\ s a -> s{_eCreated = a}) .
mapping _DateTime
| 81 | true | true | 0 | 10 | 39 | 55 | 28 | 27 | null | null |
ganeti/ganeti
|
src/Ganeti/Constants.hs
|
bsd-2-clause
|
-- * Common exit codes
exitSuccess :: Int
exitSuccess = 0
| 58 |
exitSuccess :: Int
exitSuccess = 0
| 34 |
exitSuccess = 0
| 15 | true | true | 0 | 4 | 11 | 12 | 7 | 5 | null | null |
dmvianna/haskellbook
|
src/Ch27-OutsideIn.hs
|
unlicense
|
hypo :: IO ()
hypo = do
let x :: Int
x = undefined
s <- getLine
case s of
"hi" -> print x
_ -> putStrLn "hello"
| 131 |
hypo :: IO ()
hypo = do
let x :: Int
x = undefined
s <- getLine
case s of
"hi" -> print x
_ -> putStrLn "hello"
| 131 |
hypo = do
let x :: Int
x = undefined
s <- getLine
case s of
"hi" -> print x
_ -> putStrLn "hello"
| 117 | false | true | 0 | 10 | 47 | 62 | 29 | 33 | null | null |
mlite/hLLVM
|
src/Llvm/Asm/Parser/Basic.hs
|
bsd-3-clause
|
pGlobalId :: P GlobalId
pGlobalId = lexeme (char '@' >> choice [ liftM GlobalIdNum unsignedInt
, try $ liftM (GlobalIdAlphaNum) pAlphaNum
, try $ liftM GlobalIdAlphaNum (lexeme (between (char '"') (char '"') pAlphaNum))
, liftM GlobalIdDqString pQuoteStr
])
| 414 |
pGlobalId :: P GlobalId
pGlobalId = lexeme (char '@' >> choice [ liftM GlobalIdNum unsignedInt
, try $ liftM (GlobalIdAlphaNum) pAlphaNum
, try $ liftM GlobalIdAlphaNum (lexeme (between (char '"') (char '"') pAlphaNum))
, liftM GlobalIdDqString pQuoteStr
])
| 414 |
pGlobalId = lexeme (char '@' >> choice [ liftM GlobalIdNum unsignedInt
, try $ liftM (GlobalIdAlphaNum) pAlphaNum
, try $ liftM GlobalIdAlphaNum (lexeme (between (char '"') (char '"') pAlphaNum))
, liftM GlobalIdDqString pQuoteStr
])
| 390 | false | true | 0 | 17 | 194 | 107 | 51 | 56 | null | null |
jhegedus42/svg-tree
|
src/Graphics/Svg/CssParser.hs
|
bsd-3-clause
|
ident :: Parser T.Text
ident =
(\f c -> f . T.cons c . T.pack)
<$> trailingSub
<*> nmstart <*> nmchar
where
trailingSub = option id $ T.cons '-' <$ char '-'
underscore = char '_'
nmstart = letter <|> underscore
nmchar = many (letter <|> digit <|> underscore <|> char '-')
| 307 |
ident :: Parser T.Text
ident =
(\f c -> f . T.cons c . T.pack)
<$> trailingSub
<*> nmstart <*> nmchar
where
trailingSub = option id $ T.cons '-' <$ char '-'
underscore = char '_'
nmstart = letter <|> underscore
nmchar = many (letter <|> digit <|> underscore <|> char '-')
| 307 |
ident =
(\f c -> f . T.cons c . T.pack)
<$> trailingSub
<*> nmstart <*> nmchar
where
trailingSub = option id $ T.cons '-' <$ char '-'
underscore = char '_'
nmstart = letter <|> underscore
nmchar = many (letter <|> digit <|> underscore <|> char '-')
| 284 | false | true | 0 | 13 | 87 | 123 | 61 | 62 | null | null |
seagreen/housejeffries
|
page-forkable-wiki/src/PageForkableWiki.hs
|
mit
|
writePage :: FilePath -> Site -> SiteTemplates -> Page -> Action ()
writePage = writePageSetIgnore defaultIgnore
where
defaultIgnore :: FilePath -> Bool
defaultIgnore path =
path == "page.md"
|| isInfixOf ".git" path
|| isInfixOf ".stack-work" path
| 279 |
writePage :: FilePath -> Site -> SiteTemplates -> Page -> Action ()
writePage = writePageSetIgnore defaultIgnore
where
defaultIgnore :: FilePath -> Bool
defaultIgnore path =
path == "page.md"
|| isInfixOf ".git" path
|| isInfixOf ".stack-work" path
| 279 |
writePage = writePageSetIgnore defaultIgnore
where
defaultIgnore :: FilePath -> Bool
defaultIgnore path =
path == "page.md"
|| isInfixOf ".git" path
|| isInfixOf ".stack-work" path
| 211 | false | true | 2 | 10 | 66 | 77 | 37 | 40 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.