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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
jessica-taylor/quipp2 | src/Quipp/Interpreter.hs | mit | popState :: State [a] a
popState = do
(x:xs) <- get
put xs
return x | 73 | popState :: State [a] a
popState = do
(x:xs) <- get
put xs
return x | 73 | popState = do
(x:xs) <- get
put xs
return x | 49 | false | true | 0 | 9 | 20 | 45 | 21 | 24 | null | null |
sopvop/snap | test/suite/Snap/Snaplet/Internal/Tests.hs | bsd-3-clause | appInit :: SnapletInit App App
appInit = makeSnaplet "app" "Test application" Nothing $ do
cwd <- liftIO getCurrentDirectory
configAssertions "root "
([], cwd, Just "app", "Test application", "")
assertGet "environment" getEnvironment "devel"
f <- nestSnaplet "foo" foo $ fooInit
b <- nestSnaplet "bar" bar $ barInit
return $ App f b
------------------------------------------------------------------------------ | 449 | appInit :: SnapletInit App App
appInit = makeSnaplet "app" "Test application" Nothing $ do
cwd <- liftIO getCurrentDirectory
configAssertions "root "
([], cwd, Just "app", "Test application", "")
assertGet "environment" getEnvironment "devel"
f <- nestSnaplet "foo" foo $ fooInit
b <- nestSnaplet "bar" bar $ barInit
return $ App f b
------------------------------------------------------------------------------ | 449 | appInit = makeSnaplet "app" "Test application" Nothing $ do
cwd <- liftIO getCurrentDirectory
configAssertions "root "
([], cwd, Just "app", "Test application", "")
assertGet "environment" getEnvironment "devel"
f <- nestSnaplet "foo" foo $ fooInit
b <- nestSnaplet "bar" bar $ barInit
return $ App f b
------------------------------------------------------------------------------ | 418 | false | true | 0 | 10 | 88 | 120 | 56 | 64 | null | null |
edofic/core.js | src/Immediate/Simplify.hs | mit | simplifyForceDefer (Defer (Force expr)) = simplifyForceDefer expr | 65 | simplifyForceDefer (Defer (Force expr)) = simplifyForceDefer expr | 65 | simplifyForceDefer (Defer (Force expr)) = simplifyForceDefer expr | 65 | false | false | 0 | 9 | 6 | 24 | 11 | 13 | null | null |
urbanslug/ghc | compiler/main/HscTypes.hs | bsd-3-clause | -- | Perform the given action and call the exception handler if the action
-- throws a 'SourceError'. See 'SourceError' for more information.
handleSourceError :: (ExceptionMonad m) =>
(SourceError -> m a) -- ^ exception handler
-> m a -- ^ action to perform
-> m a
handleSourceError handler act =
gcatch act (\(e :: SourceError) -> handler e) | 403 | handleSourceError :: (ExceptionMonad m) =>
(SourceError -> m a) -- ^ exception handler
-> m a -- ^ action to perform
-> m a
handleSourceError handler act =
gcatch act (\(e :: SourceError) -> handler e) | 260 | handleSourceError handler act =
gcatch act (\(e :: SourceError) -> handler e) | 79 | true | true | 0 | 10 | 118 | 82 | 41 | 41 | null | null |
vituscze/norri | src/Compiler/TypeChecking/Infer.hs | bsd-3-clause | inferVariant :: Type -- ^ Type constructor.
-> Set TyVar -- ^ Bound type variables.
-> Infer Variant TICtx
inferVariant dt bound (DataCon n ts) = do
let ty = foldr1 TyArr (ts ++ [dt])
tyq = quantify bound ty
fr = Set.toList (free tyq)
checkKind (scheme ty)
-- The type of data constructor should be self-contained, it should
-- not contain any free type variables.
case fr of
[] -> return ()
u:_ -> throwTCError $ SError (UndefinedType u)
tc <- askTc
when (n `Map.member` tc) . throwTCError $ SError (ValueRedefined n)
localT (Map.insert n tyq) askCtx
-- | Infer the type of an eliminator for a data type given the type constructor,
-- list of variables bound in the type constructor, name of the type
-- constructor and the actual list of data constructors.
--
-- If the inference succeeds, return the type inference context extended with
-- the eliminator and its type scheme.
--
-- Note that 'inferElim' automatically picks the name for the eliminator:
-- it is the uncapitalsed name of the data type. If a value with this name
-- already exists, an error is produced. | 1,188 | inferVariant :: Type -- ^ Type constructor.
-> Set TyVar -- ^ Bound type variables.
-> Infer Variant TICtx
inferVariant dt bound (DataCon n ts) = do
let ty = foldr1 TyArr (ts ++ [dt])
tyq = quantify bound ty
fr = Set.toList (free tyq)
checkKind (scheme ty)
-- The type of data constructor should be self-contained, it should
-- not contain any free type variables.
case fr of
[] -> return ()
u:_ -> throwTCError $ SError (UndefinedType u)
tc <- askTc
when (n `Map.member` tc) . throwTCError $ SError (ValueRedefined n)
localT (Map.insert n tyq) askCtx
-- | Infer the type of an eliminator for a data type given the type constructor,
-- list of variables bound in the type constructor, name of the type
-- constructor and the actual list of data constructors.
--
-- If the inference succeeds, return the type inference context extended with
-- the eliminator and its type scheme.
--
-- Note that 'inferElim' automatically picks the name for the eliminator:
-- it is the uncapitalsed name of the data type. If a value with this name
-- already exists, an error is produced. | 1,188 | inferVariant dt bound (DataCon n ts) = do
let ty = foldr1 TyArr (ts ++ [dt])
tyq = quantify bound ty
fr = Set.toList (free tyq)
checkKind (scheme ty)
-- The type of data constructor should be self-contained, it should
-- not contain any free type variables.
case fr of
[] -> return ()
u:_ -> throwTCError $ SError (UndefinedType u)
tc <- askTc
when (n `Map.member` tc) . throwTCError $ SError (ValueRedefined n)
localT (Map.insert n tyq) askCtx
-- | Infer the type of an eliminator for a data type given the type constructor,
-- list of variables bound in the type constructor, name of the type
-- constructor and the actual list of data constructors.
--
-- If the inference succeeds, return the type inference context extended with
-- the eliminator and its type scheme.
--
-- Note that 'inferElim' automatically picks the name for the eliminator:
-- it is the uncapitalsed name of the data type. If a value with this name
-- already exists, an error is produced. | 1,048 | false | true | 0 | 13 | 307 | 220 | 112 | 108 | null | null |
mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Core31/Tokens.hs | bsd-3-clause | gl_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH :: GLenum
gl_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76 | 100 | gl_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH :: GLenum
gl_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76 | 100 | gl_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76 | 49 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
mimi1vx/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | prop_checkArithmeticDeref4 = verifyNot checkArithmeticDeref "(( ! $? ))" | 72 | prop_checkArithmeticDeref4 = verifyNot checkArithmeticDeref "(( ! $? ))" | 72 | prop_checkArithmeticDeref4 = verifyNot checkArithmeticDeref "(( ! $? ))" | 72 | false | false | 1 | 5 | 7 | 14 | 5 | 9 | null | null |
gcampax/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | ctEvCoercion (CtWanted { ctev_evar = v }) = mkTcCoVarCo v | 59 | ctEvCoercion (CtWanted { ctev_evar = v }) = mkTcCoVarCo v | 59 | ctEvCoercion (CtWanted { ctev_evar = v }) = mkTcCoVarCo v | 59 | false | false | 0 | 9 | 11 | 24 | 12 | 12 | null | null |
DougBurke/swish | src/Swish/RDF/Vocabulary/FOAF.hs | lgpl-2.1 | -- | @foaf:depicts@ from <http://xmlns.com/foaf/spec/#term_depicts>.
foafdepicts :: ScopedName
foafdepicts = toF "depicts" | 123 | foafdepicts :: ScopedName
foafdepicts = toF "depicts" | 53 | foafdepicts = toF "depicts" | 27 | true | true | 0 | 5 | 12 | 15 | 8 | 7 | null | null |
WraithM/haskell-opaleye | opaleye-sqlite/src/Opaleye/SQLite/PGTypes.hs | bsd-3-clause | pgTimeOfDay :: Time.TimeOfDay -> Column PGTime
pgTimeOfDay = IPT.unsafePgFormatTime "time" "'%T'" | 97 | pgTimeOfDay :: Time.TimeOfDay -> Column PGTime
pgTimeOfDay = IPT.unsafePgFormatTime "time" "'%T'" | 97 | pgTimeOfDay = IPT.unsafePgFormatTime "time" "'%T'" | 50 | false | true | 0 | 6 | 10 | 27 | 13 | 14 | null | null |
AlexanderPankiv/ghc | compiler/main/HscTypes.hs | bsd-3-clause | lookupTypeEnv :: TypeEnv -> Name -> Maybe TyThing
emptyTypeEnv = emptyNameEnv | 87 | lookupTypeEnv :: TypeEnv -> Name -> Maybe TyThing
emptyTypeEnv = emptyNameEnv | 86 | emptyTypeEnv = emptyNameEnv | 34 | false | true | 0 | 7 | 20 | 22 | 11 | 11 | null | null |
ksaveljev/hake-2 | src/Game/Monsters/MChick.hs | bsd-3-clause | chickRun :: EntThink
chickRun =
GenericEntThink "chick_run" $ \selfRef -> do
self <- readRef selfRef
if (self^.eMonsterInfo.miAIFlags) .&. Constants.aiStandGround /= 0
then
modifyRef selfRef (\v -> v & eMonsterInfo.miCurrentMove .~ Just chickMoveStand)
else do
let action = case self^.eMonsterInfo.miCurrentMove of
Nothing -> chickMoveStartRun
Just move -> if (move^.mmId) == (chickMoveWalk^.mmId) || (move^.mmId) == (chickMoveStartRun^.mmId)
then chickMoveRun
else chickMoveStartRun
modifyRef selfRef (\v -> v & eMonsterInfo.miCurrentMove .~ Just action)
return True | 743 | chickRun :: EntThink
chickRun =
GenericEntThink "chick_run" $ \selfRef -> do
self <- readRef selfRef
if (self^.eMonsterInfo.miAIFlags) .&. Constants.aiStandGround /= 0
then
modifyRef selfRef (\v -> v & eMonsterInfo.miCurrentMove .~ Just chickMoveStand)
else do
let action = case self^.eMonsterInfo.miCurrentMove of
Nothing -> chickMoveStartRun
Just move -> if (move^.mmId) == (chickMoveWalk^.mmId) || (move^.mmId) == (chickMoveStartRun^.mmId)
then chickMoveRun
else chickMoveStartRun
modifyRef selfRef (\v -> v & eMonsterInfo.miCurrentMove .~ Just action)
return True | 743 | chickRun =
GenericEntThink "chick_run" $ \selfRef -> do
self <- readRef selfRef
if (self^.eMonsterInfo.miAIFlags) .&. Constants.aiStandGround /= 0
then
modifyRef selfRef (\v -> v & eMonsterInfo.miCurrentMove .~ Just chickMoveStand)
else do
let action = case self^.eMonsterInfo.miCurrentMove of
Nothing -> chickMoveStartRun
Just move -> if (move^.mmId) == (chickMoveWalk^.mmId) || (move^.mmId) == (chickMoveStartRun^.mmId)
then chickMoveRun
else chickMoveStartRun
modifyRef selfRef (\v -> v & eMonsterInfo.miCurrentMove .~ Just action)
return True | 722 | false | true | 0 | 23 | 245 | 206 | 104 | 102 | null | null |
jhickner/minions | minions.hs | bsd-3-clause | runTasks :: [Task] -> Int -> (Result -> IO a) -> IO ()
runTasks ts tmout handler = do
out <- newChan
forM_ ts $ run out
replicateM_ (length ts) (readChan out >>= handler)
where run ch t = forkIO $ do
!res <- runTask t tmout
writeChan ch res | 300 | runTasks :: [Task] -> Int -> (Result -> IO a) -> IO ()
runTasks ts tmout handler = do
out <- newChan
forM_ ts $ run out
replicateM_ (length ts) (readChan out >>= handler)
where run ch t = forkIO $ do
!res <- runTask t tmout
writeChan ch res | 300 | runTasks ts tmout handler = do
out <- newChan
forM_ ts $ run out
replicateM_ (length ts) (readChan out >>= handler)
where run ch t = forkIO $ do
!res <- runTask t tmout
writeChan ch res | 245 | false | true | 1 | 11 | 109 | 139 | 60 | 79 | null | null |
AndrewRademacher/stack | src/Stack/Types/Config.hs | bsd-3-clause | compilerVersionDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Rel Dir)
compilerVersionDir = do
compilerVersion <- asks (envConfigCompilerVersion . getEnvConfig)
parseRelDir $ case compilerVersion of
GhcVersion version -> versionString version
GhcjsVersion {} -> compilerVersionString compilerVersion
-- | Package database for installing dependencies into | 402 | compilerVersionDir :: (MonadThrow m, MonadReader env m, HasEnvConfig env) => m (Path Rel Dir)
compilerVersionDir = do
compilerVersion <- asks (envConfigCompilerVersion . getEnvConfig)
parseRelDir $ case compilerVersion of
GhcVersion version -> versionString version
GhcjsVersion {} -> compilerVersionString compilerVersion
-- | Package database for installing dependencies into | 402 | compilerVersionDir = do
compilerVersion <- asks (envConfigCompilerVersion . getEnvConfig)
parseRelDir $ case compilerVersion of
GhcVersion version -> versionString version
GhcjsVersion {} -> compilerVersionString compilerVersion
-- | Package database for installing dependencies into | 308 | false | true | 0 | 11 | 70 | 99 | 48 | 51 | null | null |
elieux/ghc | compiler/utils/Outputable.hs | bsd-3-clause | -- Inline so that the RULE Pretty.text will fire
ftext s = docToSDoc $ Pretty.ftext s | 90 | ftext s = docToSDoc $ Pretty.ftext s | 40 | ftext s = docToSDoc $ Pretty.ftext s | 40 | true | false | 0 | 7 | 20 | 19 | 9 | 10 | null | null |
apyrgio/ganeti | src/Ganeti/HTools/Backend/IAlloc.hs | bsd-2-clause | -- | Flatten the log of a solution into a string.
describeSolution :: Cluster.AllocSolution -> String
describeSolution = intercalate ", " . Cluster.asLog | 153 | describeSolution :: Cluster.AllocSolution -> String
describeSolution = intercalate ", " . Cluster.asLog | 103 | describeSolution = intercalate ", " . Cluster.asLog | 51 | true | true | 0 | 6 | 22 | 27 | 14 | 13 | null | null |
pminten/xhaskell | palindrome-products/palindrome-products_test.hs | mit | palindromesTests :: [Test]
palindromesTests =
[ testCase "largest palindrome from single digit factors" $ do
let (largest, factors) = largestPalindrome 1 9
(9 :: Int) @=? largest
[(1, 9), (3, 3)] @=? norm factors
, testCase "smallest palindrome from single digit factors" $ do
let (smallest, factors) = smallestPalindrome 1 9
(1 :: Int) @=? smallest
[(1, 1)] @=? norm factors
, testCase "largest palindrome from double digit factors" $ do
let (largest, factors) = largestPalindrome 10 99
(9009 :: Int) @=? largest
[(91, 99)] @=? norm factors
, testCase "smallest palindrome from double digit factors" $ do
let (smallest, factors) = smallestPalindrome 10 99
(121 :: Int) @=? smallest
[(11, 11)] @=? norm factors
, testCase "largest palindrome from triple digit factors" $ do
let (largest, factors) = largestPalindrome 100 999
(906609 :: Int) @=? largest
[(913, 993)] @=? norm factors
, testCase "smallest palindrome from triple digit factors" $ do
let (smallest, factors) = smallestPalindrome 100 999
(10201 :: Int) @=? smallest
[(101, 101)] @=? norm factors
, testCase "largest palindrome from four digit factors" $ do
let (largest, factors) = largestPalindrome 1000 9999
(99000099 :: Int) @=? largest
[(9901, 9999)] @=? norm factors
, testCase "smallest palindrome from four digit factors" $ do
let (smallest, factors) = smallestPalindrome 1000 9999
(1002001 :: Int) @=? smallest
[(1001,1001)] @=? norm factors
, testCase "largest palindrome from five digit factors" $ do
let (largest, factors) = largestPalindrome 10000 99999
(9966006699 :: Integer) @=? largest
[(99681, 99979)] @=? norm factors
, testCase "smallest palindrome from five digit factors" $ do
let (smallest, factors) = smallestPalindrome 10000 99999
(100020001 :: Integer) @=? smallest
[(10001,10001)] @=? norm factors
] | 1,931 | palindromesTests :: [Test]
palindromesTests =
[ testCase "largest palindrome from single digit factors" $ do
let (largest, factors) = largestPalindrome 1 9
(9 :: Int) @=? largest
[(1, 9), (3, 3)] @=? norm factors
, testCase "smallest palindrome from single digit factors" $ do
let (smallest, factors) = smallestPalindrome 1 9
(1 :: Int) @=? smallest
[(1, 1)] @=? norm factors
, testCase "largest palindrome from double digit factors" $ do
let (largest, factors) = largestPalindrome 10 99
(9009 :: Int) @=? largest
[(91, 99)] @=? norm factors
, testCase "smallest palindrome from double digit factors" $ do
let (smallest, factors) = smallestPalindrome 10 99
(121 :: Int) @=? smallest
[(11, 11)] @=? norm factors
, testCase "largest palindrome from triple digit factors" $ do
let (largest, factors) = largestPalindrome 100 999
(906609 :: Int) @=? largest
[(913, 993)] @=? norm factors
, testCase "smallest palindrome from triple digit factors" $ do
let (smallest, factors) = smallestPalindrome 100 999
(10201 :: Int) @=? smallest
[(101, 101)] @=? norm factors
, testCase "largest palindrome from four digit factors" $ do
let (largest, factors) = largestPalindrome 1000 9999
(99000099 :: Int) @=? largest
[(9901, 9999)] @=? norm factors
, testCase "smallest palindrome from four digit factors" $ do
let (smallest, factors) = smallestPalindrome 1000 9999
(1002001 :: Int) @=? smallest
[(1001,1001)] @=? norm factors
, testCase "largest palindrome from five digit factors" $ do
let (largest, factors) = largestPalindrome 10000 99999
(9966006699 :: Integer) @=? largest
[(99681, 99979)] @=? norm factors
, testCase "smallest palindrome from five digit factors" $ do
let (smallest, factors) = smallestPalindrome 10000 99999
(100020001 :: Integer) @=? smallest
[(10001,10001)] @=? norm factors
] | 1,931 | palindromesTests =
[ testCase "largest palindrome from single digit factors" $ do
let (largest, factors) = largestPalindrome 1 9
(9 :: Int) @=? largest
[(1, 9), (3, 3)] @=? norm factors
, testCase "smallest palindrome from single digit factors" $ do
let (smallest, factors) = smallestPalindrome 1 9
(1 :: Int) @=? smallest
[(1, 1)] @=? norm factors
, testCase "largest palindrome from double digit factors" $ do
let (largest, factors) = largestPalindrome 10 99
(9009 :: Int) @=? largest
[(91, 99)] @=? norm factors
, testCase "smallest palindrome from double digit factors" $ do
let (smallest, factors) = smallestPalindrome 10 99
(121 :: Int) @=? smallest
[(11, 11)] @=? norm factors
, testCase "largest palindrome from triple digit factors" $ do
let (largest, factors) = largestPalindrome 100 999
(906609 :: Int) @=? largest
[(913, 993)] @=? norm factors
, testCase "smallest palindrome from triple digit factors" $ do
let (smallest, factors) = smallestPalindrome 100 999
(10201 :: Int) @=? smallest
[(101, 101)] @=? norm factors
, testCase "largest palindrome from four digit factors" $ do
let (largest, factors) = largestPalindrome 1000 9999
(99000099 :: Int) @=? largest
[(9901, 9999)] @=? norm factors
, testCase "smallest palindrome from four digit factors" $ do
let (smallest, factors) = smallestPalindrome 1000 9999
(1002001 :: Int) @=? smallest
[(1001,1001)] @=? norm factors
, testCase "largest palindrome from five digit factors" $ do
let (largest, factors) = largestPalindrome 10000 99999
(9966006699 :: Integer) @=? largest
[(99681, 99979)] @=? norm factors
, testCase "smallest palindrome from five digit factors" $ do
let (smallest, factors) = smallestPalindrome 10000 99999
(100020001 :: Integer) @=? smallest
[(10001,10001)] @=? norm factors
] | 1,904 | false | true | 0 | 12 | 419 | 653 | 334 | 319 | null | null |
ysnrkdm/Hamlet | src/BitBoard.hs | mit | toStringHelper :: Bb -> Int -> String
toStringHelper (Bb _ _ turn) (-1) = " " ++ (
case turn of
Piece.B -> "O"
Piece.W -> "X"
) | 151 | toStringHelper :: Bb -> Int -> String
toStringHelper (Bb _ _ turn) (-1) = " " ++ (
case turn of
Piece.B -> "O"
Piece.W -> "X"
) | 151 | toStringHelper (Bb _ _ turn) (-1) = " " ++ (
case turn of
Piece.B -> "O"
Piece.W -> "X"
) | 113 | false | true | 2 | 11 | 51 | 70 | 35 | 35 | null | null |
achirkin/BuildWrapper | test/Language/Haskell/BuildWrapper/CMDTests.hs | bsd-3-clause | evalLR :: Handle -> String -> IO ()
evalLR h expr=do
hPutStrLn h ("e "++expr)
hFlush h | 102 | evalLR :: Handle -> String -> IO ()
evalLR h expr=do
hPutStrLn h ("e "++expr)
hFlush h | 102 | evalLR h expr=do
hPutStrLn h ("e "++expr)
hFlush h | 66 | false | true | 0 | 10 | 32 | 55 | 24 | 31 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/IDBIndex.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/IDBIndex.getAllKeys Mozilla IDBIndex.getAllKeys documentation>
getAllKeysRange ::
(MonadDOM m) =>
IDBIndex -> Maybe IDBKeyRange -> Maybe Word -> m IDBRequest
getAllKeysRange self range count
= liftDOM
((self ^. jsf "getAllKeys" [toJSVal range, toJSVal count]) >>=
fromJSValUnchecked) | 390 | getAllKeysRange ::
(MonadDOM m) =>
IDBIndex -> Maybe IDBKeyRange -> Maybe Word -> m IDBRequest
getAllKeysRange self range count
= liftDOM
((self ^. jsf "getAllKeys" [toJSVal range, toJSVal count]) >>=
fromJSValUnchecked) | 271 | getAllKeysRange self range count
= liftDOM
((self ^. jsf "getAllKeys" [toJSVal range, toJSVal count]) >>=
fromJSValUnchecked) | 142 | true | true | 0 | 12 | 88 | 89 | 42 | 47 | null | null |
iteratee/haskell-tracker | PeerFinderTest.hs | mit | getSomePeers :: RandomPeerList -> Gen ([Peer], RandomPeerList, Int)
getSomePeers rpl = do
count <- oneof [choose (0, peerSize rpl), return $ peerSize rpl + 1]
gen <- arbitrary :: Gen StdGen
let (peers, rpl') = evalRand (getNPeers count rpl) gen
return (peers, rpl', count) | 280 | getSomePeers :: RandomPeerList -> Gen ([Peer], RandomPeerList, Int)
getSomePeers rpl = do
count <- oneof [choose (0, peerSize rpl), return $ peerSize rpl + 1]
gen <- arbitrary :: Gen StdGen
let (peers, rpl') = evalRand (getNPeers count rpl) gen
return (peers, rpl', count) | 280 | getSomePeers rpl = do
count <- oneof [choose (0, peerSize rpl), return $ peerSize rpl + 1]
gen <- arbitrary :: Gen StdGen
let (peers, rpl') = evalRand (getNPeers count rpl) gen
return (peers, rpl', count) | 212 | false | true | 0 | 13 | 51 | 134 | 66 | 68 | null | null |
chwthewke/passman-hs | src/Passman/Engine/Generator/Id.hs | bsd-3-clause | mkId :: Word32 -> Word32 -> Word32 -> Word32 -> GeneratorId
mkId a b c d = GeneratorId $ U.fromWords a b c d | 108 | mkId :: Word32 -> Word32 -> Word32 -> Word32 -> GeneratorId
mkId a b c d = GeneratorId $ U.fromWords a b c d | 108 | mkId a b c d = GeneratorId $ U.fromWords a b c d | 48 | false | true | 2 | 10 | 23 | 57 | 26 | 31 | null | null |
meteficha/HipmunkPlayground | Playground.hs | mit | createCircle :: Creator
createCircle angVel = do
let mass = 20
radius = 20
t = H.Circle radius
b <- H.newBody mass $ H.momentForCircle mass (0, radius) 0
s <- H.newShape b t 0
(H.position b SV.$=) =<< getMousePos
H.angVel b SV.$= angVel
H.friction s SV.$= 0.5
H.elasticity s SV.$= 0.9
let add space = do
H.spaceAdd space b
H.spaceAdd space s
let draw = do
drawMyShape s t
let remove space = do
H.spaceRemove space b
H.spaceRemove space s
return (s,add,draw,remove) | 546 | createCircle :: Creator
createCircle angVel = do
let mass = 20
radius = 20
t = H.Circle radius
b <- H.newBody mass $ H.momentForCircle mass (0, radius) 0
s <- H.newShape b t 0
(H.position b SV.$=) =<< getMousePos
H.angVel b SV.$= angVel
H.friction s SV.$= 0.5
H.elasticity s SV.$= 0.9
let add space = do
H.spaceAdd space b
H.spaceAdd space s
let draw = do
drawMyShape s t
let remove space = do
H.spaceRemove space b
H.spaceRemove space s
return (s,add,draw,remove) | 546 | createCircle angVel = do
let mass = 20
radius = 20
t = H.Circle radius
b <- H.newBody mass $ H.momentForCircle mass (0, radius) 0
s <- H.newShape b t 0
(H.position b SV.$=) =<< getMousePos
H.angVel b SV.$= angVel
H.friction s SV.$= 0.5
H.elasticity s SV.$= 0.9
let add space = do
H.spaceAdd space b
H.spaceAdd space s
let draw = do
drawMyShape s t
let remove space = do
H.spaceRemove space b
H.spaceRemove space s
return (s,add,draw,remove) | 522 | false | true | 0 | 13 | 163 | 244 | 111 | 133 | null | null |
afiskon/simple-genetic-algorithm | src/AI/GeneticAlgorithm/Simple.hs | bsd-2-clause | mutate :: (RandomGen g, Chromosome a) => g -> a -> Double -> (a, g)
mutate gen x mp =
let (r, gen') = randomR (0.0, 1.0) gen in
if r <= mp then mutation gen' x
else (x, gen') | 199 | mutate :: (RandomGen g, Chromosome a) => g -> a -> Double -> (a, g)
mutate gen x mp =
let (r, gen') = randomR (0.0, 1.0) gen in
if r <= mp then mutation gen' x
else (x, gen') | 199 | mutate gen x mp =
let (r, gen') = randomR (0.0, 1.0) gen in
if r <= mp then mutation gen' x
else (x, gen') | 131 | false | true | 0 | 10 | 64 | 103 | 55 | 48 | null | null |
Javran/tuppence | src/Kantour/ESports/Progressor.hs | mit | -- normal node, no battleship
timeNormBB :: Sum Double
timeNormBB = Sum 1.5 | 76 | timeNormBB :: Sum Double
timeNormBB = Sum 1.5 | 45 | timeNormBB = Sum 1.5 | 20 | true | true | 0 | 5 | 13 | 18 | 9 | 9 | null | null |
termite2/tsl | TSL2Boogie/Spec2Boogie.hs | bsd-3-clause | sym2Expr sym = EField (sym2Expr $ init sym) (last sym) | 57 | sym2Expr sym = EField (sym2Expr $ init sym) (last sym) | 57 | sym2Expr sym = EField (sym2Expr $ init sym) (last sym) | 57 | false | false | 1 | 8 | 12 | 34 | 14 | 20 | null | null |
msullivan/advent-of-code | 2016/A14a.hs | mit | main = putStrLn $ show $ (map head $ filter isKey (tails stream)) !! 63 | 71 | main = putStrLn $ show $ (map head $ filter isKey (tails stream)) !! 63 | 71 | main = putStrLn $ show $ (map head $ filter isKey (tails stream)) !! 63 | 71 | false | false | 0 | 11 | 14 | 39 | 19 | 20 | null | null |
spoqa/nirum | src/Nirum/Constructs/Identifier.hs | gpl-3.0 | toText :: Identifier -> T.Text
toText (Identifier text) = text | 62 | toText :: Identifier -> T.Text
toText (Identifier text) = text | 62 | toText (Identifier text) = text | 31 | false | true | 0 | 7 | 9 | 26 | 13 | 13 | null | null |
IQubic/TicTacToe | src/Main.hs | bsd-3-clause | isValidMove :: Board -> (Int, Int) -> Bool
isValidMove board spot = board ! spot == Blank | 89 | isValidMove :: Board -> (Int, Int) -> Bool
isValidMove board spot = board ! spot == Blank | 89 | isValidMove board spot = board ! spot == Blank | 46 | false | true | 0 | 7 | 16 | 38 | 20 | 18 | null | null |
Newlifer/libstep | src/Data/EXPRESS/Parsers.hs | mit | -- ABSTRACT SUPERTYPE ' ; ' .
pAbstractSupertype :: Parser AbstractSupertype
pAbstractSupertype = undefined | 107 | pAbstractSupertype :: Parser AbstractSupertype
pAbstractSupertype = undefined | 77 | pAbstractSupertype = undefined | 30 | true | true | 0 | 5 | 13 | 15 | 8 | 7 | null | null |
jaapweel/bloop | AnalyzeC.hs | gpl-2.0 | gotos :: Declaration -> [String]
gotos = everything (++) (mkQ [] gather) | 72 | gotos :: Declaration -> [String]
gotos = everything (++) (mkQ [] gather) | 72 | gotos = everything (++) (mkQ [] gather) | 39 | false | true | 0 | 8 | 11 | 35 | 19 | 16 | null | null |
lukexi/ghc | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | assignMem_IntCode pk addr src = do
is32Bit <- is32BitPlatform
Amode addr code_addr <- getAmode addr
(code_src, op_src) <- get_op_RI is32Bit src
let
code = code_src `appOL`
code_addr `snocOL`
MOV pk op_src (OpAddr addr)
-- NOTE: op_src is stable, so it will still be valid
-- after code_addr. This may involve the introduction
-- of an extra MOV to a temporary register, but we hope
-- the register allocator will get rid of it.
--
return code
where
get_op_RI :: Bool -> CmmExpr -> NatM (InstrBlock,Operand) -- code, operator
get_op_RI is32Bit (CmmLit lit) | is32BitLit is32Bit lit
= return (nilOL, OpImm (litToImm lit))
get_op_RI _ op
= do (reg,code) <- getNonClobberedReg op
return (code, OpReg reg)
-- Assign; dst is a reg, rhs is mem | 877 | assignMem_IntCode pk addr src = do
is32Bit <- is32BitPlatform
Amode addr code_addr <- getAmode addr
(code_src, op_src) <- get_op_RI is32Bit src
let
code = code_src `appOL`
code_addr `snocOL`
MOV pk op_src (OpAddr addr)
-- NOTE: op_src is stable, so it will still be valid
-- after code_addr. This may involve the introduction
-- of an extra MOV to a temporary register, but we hope
-- the register allocator will get rid of it.
--
return code
where
get_op_RI :: Bool -> CmmExpr -> NatM (InstrBlock,Operand) -- code, operator
get_op_RI is32Bit (CmmLit lit) | is32BitLit is32Bit lit
= return (nilOL, OpImm (litToImm lit))
get_op_RI _ op
= do (reg,code) <- getNonClobberedReg op
return (code, OpReg reg)
-- Assign; dst is a reg, rhs is mem | 877 | assignMem_IntCode pk addr src = do
is32Bit <- is32BitPlatform
Amode addr code_addr <- getAmode addr
(code_src, op_src) <- get_op_RI is32Bit src
let
code = code_src `appOL`
code_addr `snocOL`
MOV pk op_src (OpAddr addr)
-- NOTE: op_src is stable, so it will still be valid
-- after code_addr. This may involve the introduction
-- of an extra MOV to a temporary register, but we hope
-- the register allocator will get rid of it.
--
return code
where
get_op_RI :: Bool -> CmmExpr -> NatM (InstrBlock,Operand) -- code, operator
get_op_RI is32Bit (CmmLit lit) | is32BitLit is32Bit lit
= return (nilOL, OpImm (litToImm lit))
get_op_RI _ op
= do (reg,code) <- getNonClobberedReg op
return (code, OpReg reg)
-- Assign; dst is a reg, rhs is mem | 877 | false | false | 2 | 13 | 264 | 221 | 106 | 115 | null | null |
palf/haskellSDL2Examples | examples/lesson12/src/Lesson12/Rendering.hs | gpl-2.0 | modifyTexture :: (MonadIO m) => SDL.Texture -> World -> m ()
modifyTexture t w = SDL.textureColorMod t $= rgb
where
convert v = floor . v . colors
r = convert redV w
g = convert greenV w
b = convert blueV w
rgb = SDL.V3 r g b | 247 | modifyTexture :: (MonadIO m) => SDL.Texture -> World -> m ()
modifyTexture t w = SDL.textureColorMod t $= rgb
where
convert v = floor . v . colors
r = convert redV w
g = convert greenV w
b = convert blueV w
rgb = SDL.V3 r g b | 247 | modifyTexture t w = SDL.textureColorMod t $= rgb
where
convert v = floor . v . colors
r = convert redV w
g = convert greenV w
b = convert blueV w
rgb = SDL.V3 r g b | 186 | false | true | 2 | 9 | 70 | 116 | 55 | 61 | null | null |
acharal/hopes | src/prover/Infer.hs | gpl-2.0 | refute = refute''' | 19 | refute = refute''' | 19 | refute = refute''' | 19 | false | false | 1 | 5 | 3 | 10 | 3 | 7 | null | null |
brendanhay/gogol | gogol-cloudtasks/gen/Network/Google/CloudTasks/Types/Product.hs | mpl-2.0 | -- | The set of permissions to check for the \`resource\`. Permissions with
-- wildcards (such as \'*\' or \'storage.*\') are not allowed. For more
-- information see [IAM
-- Overview](https:\/\/cloud.google.com\/iam\/docs\/overview#permissions).
tiprPermissions :: Lens' TestIAMPermissionsRequest [Text]
tiprPermissions
= lens _tiprPermissions
(\ s a -> s{_tiprPermissions = a})
. _Default
. _Coerce | 420 | tiprPermissions :: Lens' TestIAMPermissionsRequest [Text]
tiprPermissions
= lens _tiprPermissions
(\ s a -> s{_tiprPermissions = a})
. _Default
. _Coerce | 173 | tiprPermissions
= lens _tiprPermissions
(\ s a -> s{_tiprPermissions = a})
. _Default
. _Coerce | 115 | true | true | 3 | 8 | 70 | 61 | 31 | 30 | null | null |
brownsys/pane | src/Set.hs | bsd-3-clause | toList All = Nothing | 20 | toList All = Nothing | 20 | toList All = Nothing | 20 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
mslovy/barrelfish | hake/RuleDefs.hs | mit | flounderRule :: Options -> [RuleToken] -> HRule
flounderRule opts args
= Rule $ [ flounderProgLoc ] ++ (flounderIncludes opts) ++ args | 138 | flounderRule :: Options -> [RuleToken] -> HRule
flounderRule opts args
= Rule $ [ flounderProgLoc ] ++ (flounderIncludes opts) ++ args | 138 | flounderRule opts args
= Rule $ [ flounderProgLoc ] ++ (flounderIncludes opts) ++ args | 90 | false | true | 0 | 8 | 24 | 48 | 25 | 23 | null | null |
TC1211/TCP | src/3a/tester-src/Data/IterIO/Parse.hs | apache-2.0 | hile1I :: (ChunkData t, LL.ListLike t e, Monad m) =>
(e -> Bool) -> Iter t m t
while1I test = ensureI test >> whileI test <?> "while1I"
| 147 | while1I :: (ChunkData t, LL.ListLike t e, Monad m) =>
(e -> Bool) -> Iter t m t
while1I test = ensureI test >> whileI test <?> "while1I" | 147 | while1I test = ensureI test >> whileI test <?> "while1I" | 56 | false | true | 0 | 8 | 39 | 71 | 35 | 36 | null | null |
Mikolaj/assert-failure | Control/Exception/Assert/Sugar.hs | bsd-3-clause | blame True _ = True | 19 | blame True _ = True | 19 | blame True _ = True | 19 | false | false | 0 | 4 | 4 | 13 | 5 | 8 | null | null |
snowleopard/alga | src/Algebra/Graph/HigherKinded/Class.hs | mit | -- | The /biclique/ on two lists of vertices.
-- Complexity: /O(L1 + L2)/ time, memory and size, where /L1/ and /L2/ are the
-- lengths of the given lists.
--
-- @
-- biclique [] [] == 'empty'
-- biclique [x] [] == 'vertex' x
-- biclique [] [y] == 'vertex' y
-- biclique [x1,x2] [y1,y2] == 'edges' [(x1,y1), (x1,y2), (x2,y1), (x2,y2)]
-- biclique xs ys == 'connect' ('vertices' xs) ('vertices' ys)
-- @
biclique :: Graph g => [a] -> [a] -> g a
biclique xs [] = vertices xs | 510 | biclique :: Graph g => [a] -> [a] -> g a
biclique xs [] = vertices xs | 69 | biclique xs [] = vertices xs | 28 | true | true | 0 | 8 | 129 | 56 | 33 | 23 | null | null |
google/codeworld | codeworld-prediction/src/CodeWorld/Prediction/Trivial.hs | apache-2.0 | -- | Advances the current time (by big steps)
advanceCurrentTime ::
StepFun s -> AnimationRate -> Timestamp -> Future s -> Future s
advanceCurrentTime step rate target = id | 174 | advanceCurrentTime ::
StepFun s -> AnimationRate -> Timestamp -> Future s -> Future s
advanceCurrentTime step rate target = id | 128 | advanceCurrentTime step rate target = id | 40 | true | true | 0 | 9 | 30 | 44 | 21 | 23 | null | null |
dalaing/sdl2 | examples/twinklebear/Lesson01.hs | bsd-3-clause | main :: IO ()
main = do
SDL.initialize [ SDL.InitEverything ]
let winConfig = SDL.defaultWindow { SDL.windowPosition = SDL.Absolute (P (V2 100 100))
, SDL.windowInitialSize = V2 640 480 }
rdrConfig = SDL.RendererConfig { SDL.rendererType = SDL.AcceleratedVSyncRenderer
, SDL.rendererTargetTexture = True }
window <- SDL.createWindow "Hello World!" winConfig
renderer <- SDL.createRenderer window (-1) rdrConfig
bmp <- getDataFileName "examples/twinklebear/hello.bmp" >>= SDL.loadBMP
tex <- SDL.createTextureFromSurface renderer bmp
SDL.freeSurface bmp
SDL.clear renderer
SDL.copy renderer tex Nothing Nothing
SDL.present renderer
SDL.delay 2000
SDL.destroyTexture tex
SDL.destroyRenderer renderer
SDL.destroyWindow window
SDL.quit | 847 | main :: IO ()
main = do
SDL.initialize [ SDL.InitEverything ]
let winConfig = SDL.defaultWindow { SDL.windowPosition = SDL.Absolute (P (V2 100 100))
, SDL.windowInitialSize = V2 640 480 }
rdrConfig = SDL.RendererConfig { SDL.rendererType = SDL.AcceleratedVSyncRenderer
, SDL.rendererTargetTexture = True }
window <- SDL.createWindow "Hello World!" winConfig
renderer <- SDL.createRenderer window (-1) rdrConfig
bmp <- getDataFileName "examples/twinklebear/hello.bmp" >>= SDL.loadBMP
tex <- SDL.createTextureFromSurface renderer bmp
SDL.freeSurface bmp
SDL.clear renderer
SDL.copy renderer tex Nothing Nothing
SDL.present renderer
SDL.delay 2000
SDL.destroyTexture tex
SDL.destroyRenderer renderer
SDL.destroyWindow window
SDL.quit | 847 | main = do
SDL.initialize [ SDL.InitEverything ]
let winConfig = SDL.defaultWindow { SDL.windowPosition = SDL.Absolute (P (V2 100 100))
, SDL.windowInitialSize = V2 640 480 }
rdrConfig = SDL.RendererConfig { SDL.rendererType = SDL.AcceleratedVSyncRenderer
, SDL.rendererTargetTexture = True }
window <- SDL.createWindow "Hello World!" winConfig
renderer <- SDL.createRenderer window (-1) rdrConfig
bmp <- getDataFileName "examples/twinklebear/hello.bmp" >>= SDL.loadBMP
tex <- SDL.createTextureFromSurface renderer bmp
SDL.freeSurface bmp
SDL.clear renderer
SDL.copy renderer tex Nothing Nothing
SDL.present renderer
SDL.delay 2000
SDL.destroyTexture tex
SDL.destroyRenderer renderer
SDL.destroyWindow window
SDL.quit | 833 | false | true | 0 | 16 | 201 | 255 | 116 | 139 | null | null |
bkoropoff/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | pureTerm (Bind n b sc) = notClassName n && pureBinder b && pureTerm sc where
pureBinder (Hole _) = False
pureBinder (Guess _ _) = False
pureBinder (Let t v) = pureTerm t && pureTerm v
pureBinder t = pureTerm (binderTy t)
notClassName (MN _ c) | c == txt "class" = False
notClassName _ = True | 316 | pureTerm (Bind n b sc) = notClassName n && pureBinder b && pureTerm sc where
pureBinder (Hole _) = False
pureBinder (Guess _ _) = False
pureBinder (Let t v) = pureTerm t && pureTerm v
pureBinder t = pureTerm (binderTy t)
notClassName (MN _ c) | c == txt "class" = False
notClassName _ = True | 316 | pureTerm (Bind n b sc) = notClassName n && pureBinder b && pureTerm sc where
pureBinder (Hole _) = False
pureBinder (Guess _ _) = False
pureBinder (Let t v) = pureTerm t && pureTerm v
pureBinder t = pureTerm (binderTy t)
notClassName (MN _ c) | c == txt "class" = False
notClassName _ = True | 316 | false | false | 0 | 11 | 81 | 149 | 69 | 80 | null | null |
ocean0yohsuke/deepcontrol | DeepControl/Monad/Trans/Identity.hs | bsd-3-clause | (-*--:) :: (Monad m1, Monad m2, Monad m3, Monad m4) => IdentityT3 m1 m3 m4 a -> IdentityT4 m1 m2 m3 m4 a
(-*--:) = IdentityT4 . (-*) . runIdentityT3 | 148 | (-*--:) :: (Monad m1, Monad m2, Monad m3, Monad m4) => IdentityT3 m1 m3 m4 a -> IdentityT4 m1 m2 m3 m4 a
(-*--:) = IdentityT4 . (-*) . runIdentityT3 | 148 | (-*--:) = IdentityT4 . (-*) . runIdentityT3 | 43 | false | true | 0 | 7 | 29 | 76 | 41 | 35 | null | null |
snoyberg/ghc | compiler/main/TidyPgm.hs | bsd-3-clause | tidyTopPair :: DynFlags
-> Bool -- show unfolding
-> TidyEnv -- The TidyEnv is used to tidy the IdInfo
-- It is knot-tied: don't look at it!
-> CafInfo
-> Name -- New name
-> (Id, CoreExpr) -- Binder and RHS before tidying
-> (Id, CoreExpr)
-- This function is the heart of Step 2
-- The rec_tidy_env is the one to use for the IdInfo
-- It's necessary because when we are dealing with a recursive
-- group, a variable late in the group might be mentioned
-- in the IdInfo of one early in the group
tidyTopPair dflags show_unfold rhs_tidy_env caf_info name' (bndr, rhs)
= (bndr1, rhs1)
where
bndr1 = mkGlobalId details name' ty' idinfo'
details = idDetails bndr -- Preserve the IdDetails
ty' = tidyTopType (idType bndr)
rhs1 = tidyExpr rhs_tidy_env rhs
idinfo' = tidyTopIdInfo dflags rhs_tidy_env name' rhs rhs1 (idInfo bndr)
show_unfold caf_info
-- tidyTopIdInfo creates the final IdInfo for top-level
-- binders. There are two delicate pieces:
--
-- * Arity. After CoreTidy, this arity must not change any more.
-- Indeed, CorePrep must eta expand where necessary to make
-- the manifest arity equal to the claimed arity.
--
-- * CAF info. This must also remain valid through to code generation.
-- We add the info here so that it propagates to all
-- occurrences of the binders in RHSs, and hence to occurrences in
-- unfoldings, which are inside Ids imported by GHCi. Ditto RULES.
-- CoreToStg makes use of this when constructing SRTs. | 1,696 | tidyTopPair :: DynFlags
-> Bool -- show unfolding
-> TidyEnv -- The TidyEnv is used to tidy the IdInfo
-- It is knot-tied: don't look at it!
-> CafInfo
-> Name -- New name
-> (Id, CoreExpr) -- Binder and RHS before tidying
-> (Id, CoreExpr)
tidyTopPair dflags show_unfold rhs_tidy_env caf_info name' (bndr, rhs)
= (bndr1, rhs1)
where
bndr1 = mkGlobalId details name' ty' idinfo'
details = idDetails bndr -- Preserve the IdDetails
ty' = tidyTopType (idType bndr)
rhs1 = tidyExpr rhs_tidy_env rhs
idinfo' = tidyTopIdInfo dflags rhs_tidy_env name' rhs rhs1 (idInfo bndr)
show_unfold caf_info
-- tidyTopIdInfo creates the final IdInfo for top-level
-- binders. There are two delicate pieces:
--
-- * Arity. After CoreTidy, this arity must not change any more.
-- Indeed, CorePrep must eta expand where necessary to make
-- the manifest arity equal to the claimed arity.
--
-- * CAF info. This must also remain valid through to code generation.
-- We add the info here so that it propagates to all
-- occurrences of the binders in RHSs, and hence to occurrences in
-- unfoldings, which are inside Ids imported by GHCi. Ditto RULES.
-- CoreToStg makes use of this when constructing SRTs. | 1,398 | tidyTopPair dflags show_unfold rhs_tidy_env caf_info name' (bndr, rhs)
= (bndr1, rhs1)
where
bndr1 = mkGlobalId details name' ty' idinfo'
details = idDetails bndr -- Preserve the IdDetails
ty' = tidyTopType (idType bndr)
rhs1 = tidyExpr rhs_tidy_env rhs
idinfo' = tidyTopIdInfo dflags rhs_tidy_env name' rhs rhs1 (idInfo bndr)
show_unfold caf_info
-- tidyTopIdInfo creates the final IdInfo for top-level
-- binders. There are two delicate pieces:
--
-- * Arity. After CoreTidy, this arity must not change any more.
-- Indeed, CorePrep must eta expand where necessary to make
-- the manifest arity equal to the claimed arity.
--
-- * CAF info. This must also remain valid through to code generation.
-- We add the info here so that it propagates to all
-- occurrences of the binders in RHSs, and hence to occurrences in
-- unfoldings, which are inside Ids imported by GHCi. Ditto RULES.
-- CoreToStg makes use of this when constructing SRTs. | 1,045 | true | true | 0 | 11 | 509 | 172 | 101 | 71 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/HTMLLegendElement.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/HTMLLegendElement.align Mozilla HTMLLegendElement.align documentation>
getAlign ::
(MonadDOM m, FromJSString result) => HTMLLegendElement -> m result
getAlign self
= liftDOM ((self ^. js "align") >>= fromJSValUnchecked) | 286 | getAlign ::
(MonadDOM m, FromJSString result) => HTMLLegendElement -> m result
getAlign self
= liftDOM ((self ^. js "align") >>= fromJSValUnchecked) | 159 | getAlign self
= liftDOM ((self ^. js "align") >>= fromJSValUnchecked) | 71 | true | true | 0 | 10 | 38 | 62 | 30 | 32 | null | null |
rueshyna/gogol | gogol-android-enterprise/gen/Network/Google/AndroidEnterprise/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'PageInfo' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'piResultPerPage'
--
-- * 'piTotalResults'
--
-- * 'piStartIndex'
pageInfo
:: PageInfo
pageInfo =
PageInfo'
{ _piResultPerPage = Nothing
, _piTotalResults = Nothing
, _piStartIndex = Nothing
} | 384 | pageInfo
:: PageInfo
pageInfo =
PageInfo'
{ _piResultPerPage = Nothing
, _piTotalResults = Nothing
, _piStartIndex = Nothing
} | 150 | pageInfo =
PageInfo'
{ _piResultPerPage = Nothing
, _piTotalResults = Nothing
, _piStartIndex = Nothing
} | 125 | true | true | 0 | 7 | 84 | 50 | 30 | 20 | null | null |
shinh/ags | be/fetcher/fernando.hs | gpl-2.0 | interpret = runCmds M.empty M.empty . map words . lines | 55 | interpret = runCmds M.empty M.empty . map words . lines | 55 | interpret = runCmds M.empty M.empty . map words . lines | 55 | false | false | 1 | 8 | 9 | 31 | 12 | 19 | null | null |
uduki/hsQt | Qtc/Classes/Types.hs | bsd-2-clause | toCFunPtr :: FunPtr a -> Ptr a
toCFunPtr fptr = castFunPtrToPtr fptr | 68 | toCFunPtr :: FunPtr a -> Ptr a
toCFunPtr fptr = castFunPtrToPtr fptr | 68 | toCFunPtr fptr = castFunPtrToPtr fptr | 37 | false | true | 0 | 6 | 11 | 27 | 12 | 15 | null | null |
exclipy/pdata | Data/BitUtil.hs | bsd-3-clause | bitCount8 182 = 5 | 17 | bitCount8 182 = 5 | 17 | bitCount8 182 = 5 | 17 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
fmthoma/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | isHoleCt:: Ct -> Bool
isHoleCt (CHoleCan {}) = True | 51 | isHoleCt:: Ct -> Bool
isHoleCt (CHoleCan {}) = True | 51 | isHoleCt (CHoleCan {}) = True | 29 | false | true | 1 | 8 | 8 | 31 | 14 | 17 | null | null |
pqnelson/surak | src/DavisPutnam.hs | mit | isSatisfiable :: Formula -> Bool
isSatisfiable fm = dplb (defCNFClauses fm) [] | 78 | isSatisfiable :: Formula -> Bool
isSatisfiable fm = dplb (defCNFClauses fm) [] | 78 | isSatisfiable fm = dplb (defCNFClauses fm) [] | 45 | false | true | 0 | 7 | 11 | 31 | 15 | 16 | null | null |
techlib/netflow | lib/Network/Flow/V9.hs | mit | getFlowsetLength :: Get Int
getFlowsetLength = label "getFlowsetLength" $ do
length' <- getWord16be
return $ fromIntegral length' - 4 | 143 | getFlowsetLength :: Get Int
getFlowsetLength = label "getFlowsetLength" $ do
length' <- getWord16be
return $ fromIntegral length' - 4 | 141 | getFlowsetLength = label "getFlowsetLength" $ do
length' <- getWord16be
return $ fromIntegral length' - 4 | 113 | false | true | 1 | 10 | 28 | 46 | 19 | 27 | null | null |
roman-smrz/rawe | src/FRP/Rawe/Prelude.hs | bsd-3-clause | scanr :: (Bhv a -> Bhv b -> Bhv b) -> Bhv b -> Bhv [a] -> Bhv [b]
scanr f q0 = bfix $ \scn -> list (q0 ~: nil) (\x xs -> let qs = scn xs in f x (head qs) ~: qs) | 172 | scanr :: (Bhv a -> Bhv b -> Bhv b) -> Bhv b -> Bhv [a] -> Bhv [b]
scanr f q0 = bfix $ \scn -> list (q0 ~: nil) (\x xs -> let qs = scn xs in f x (head qs) ~: qs) | 172 | scanr f q0 = bfix $ \scn -> list (q0 ~: nil) (\x xs -> let qs = scn xs in f x (head qs) ~: qs) | 94 | false | true | 2 | 13 | 57 | 129 | 61 | 68 | null | null |
elieux/ghc | compiler/deSugar/Coverage.hs | bsd-3-clause | addTickHsValBinds _ = panic "addTickHsValBinds" | 47 | addTickHsValBinds _ = panic "addTickHsValBinds" | 47 | addTickHsValBinds _ = panic "addTickHsValBinds" | 47 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
carletes/monad-transformers | Transformers.hs | bsd-3-clause | eval4 (Abs n e) = do tick
env <- ask
return $ FunVal env n e | 111 | eval4 (Abs n e) = do tick
env <- ask
return $ FunVal env n e | 111 | eval4 (Abs n e) = do tick
env <- ask
return $ FunVal env n e | 111 | false | false | 0 | 8 | 66 | 42 | 18 | 24 | null | null |
halarnold2000/learnhaskell | src/Cipher.hs | bsd-3-clause | unCipher :: Int -> String -> String
unCipher offset str = cipher (- offset) str | 79 | unCipher :: Int -> String -> String
unCipher offset str = cipher (- offset) str | 79 | unCipher offset str = cipher (- offset) str | 43 | false | true | 0 | 7 | 14 | 34 | 17 | 17 | null | null |
Hara-Laboratory/subleq-mips | TestSubnegInt.hs | gpl-3.0 | showIntSubleqState :: IntSubleqState -> Doc
showIntSubleqState (pc, mem) = integer pc <> colon PP.<+> hsep (map (\a-> integer $ Mem.read a mem) [0..16]) PP.<+> colon PP.<+> integer (Mem.read 0x120 mem) PP.<+> colon PP.<+> hsep (map (\a-> integer $ Mem.read a mem) [pc..(pc+2)]) | 278 | showIntSubleqState :: IntSubleqState -> Doc
showIntSubleqState (pc, mem) = integer pc <> colon PP.<+> hsep (map (\a-> integer $ Mem.read a mem) [0..16]) PP.<+> colon PP.<+> integer (Mem.read 0x120 mem) PP.<+> colon PP.<+> hsep (map (\a-> integer $ Mem.read a mem) [pc..(pc+2)]) | 278 | showIntSubleqState (pc, mem) = integer pc <> colon PP.<+> hsep (map (\a-> integer $ Mem.read a mem) [0..16]) PP.<+> colon PP.<+> integer (Mem.read 0x120 mem) PP.<+> colon PP.<+> hsep (map (\a-> integer $ Mem.read a mem) [pc..(pc+2)]) | 234 | false | true | 0 | 17 | 42 | 151 | 77 | 74 | null | null |
jsavatgy/hatupist | code/helperCanvas.hs | gpl-2.0 | qwertyColor letter =
if null as then Nothing else Just (areaColors !! (head as))
where
as = [a |(a,i) <- zip [0..] qwertyAreas, letter `elem` i] | 152 | qwertyColor letter =
if null as then Nothing else Just (areaColors !! (head as))
where
as = [a |(a,i) <- zip [0..] qwertyAreas, letter `elem` i] | 152 | qwertyColor letter =
if null as then Nothing else Just (areaColors !! (head as))
where
as = [a |(a,i) <- zip [0..] qwertyAreas, letter `elem` i] | 152 | false | false | 0 | 10 | 33 | 79 | 42 | 37 | null | null |
christiaanb/Idris-dev | src/IRTS/CLaSH/Util.hs | bsd-3-clause | splitForallTy :: C.Type -> ([C.TyVar],C.Type)
splitForallTy = go []
where
go args (C.ForAllTy b) = let (tv,ty) = unsafeUnbind b
in go (tv:args) ty
go args ty = (reverse args,ty) | 229 | splitForallTy :: C.Type -> ([C.TyVar],C.Type)
splitForallTy = go []
where
go args (C.ForAllTy b) = let (tv,ty) = unsafeUnbind b
in go (tv:args) ty
go args ty = (reverse args,ty) | 229 | splitForallTy = go []
where
go args (C.ForAllTy b) = let (tv,ty) = unsafeUnbind b
in go (tv:args) ty
go args ty = (reverse args,ty) | 183 | false | true | 1 | 9 | 81 | 107 | 55 | 52 | null | null |
TravisWhitaker/cpuinfo | src/System/CPU.hs | mit | parseFreq :: A.Parser Double
parseFreq = parsePair "cpu MHz" A.double | 69 | parseFreq :: A.Parser Double
parseFreq = parsePair "cpu MHz" A.double | 69 | parseFreq = parsePair "cpu MHz" A.double | 40 | false | true | 0 | 6 | 9 | 23 | 11 | 12 | null | null |
tjakway/ghcjvm | compiler/types/Coercion.hs | bsd-3-clause | mkUnbranchedAxInstLHS :: CoAxiom Unbranched -> [Type] -> [Coercion] -> Type
mkUnbranchedAxInstLHS ax = mkAxInstLHS ax 0 | 119 | mkUnbranchedAxInstLHS :: CoAxiom Unbranched -> [Type] -> [Coercion] -> Type
mkUnbranchedAxInstLHS ax = mkAxInstLHS ax 0 | 119 | mkUnbranchedAxInstLHS ax = mkAxInstLHS ax 0 | 43 | false | true | 0 | 9 | 15 | 45 | 21 | 24 | null | null |
thomaslecointre/Distributed-Haskell | slave/PorterStemmer.hs | mit | step1b :: String -> String
step1b = either id afterStep1b . beforeStep1b | 72 | step1b :: String -> String
step1b = either id afterStep1b . beforeStep1b | 72 | step1b = either id afterStep1b . beforeStep1b | 45 | false | true | 0 | 6 | 11 | 24 | 12 | 12 | null | null |
erochest/popvox-scrape | src/PopVox/Ranks.hs | apache-2.0 | getAllSponsors :: BillSponsors s -> [s]
getAllSponsors (BillSponsors _ s ss) = maybeToList s ++ ss | 98 | getAllSponsors :: BillSponsors s -> [s]
getAllSponsors (BillSponsors _ s ss) = maybeToList s ++ ss | 98 | getAllSponsors (BillSponsors _ s ss) = maybeToList s ++ ss | 58 | false | true | 0 | 7 | 15 | 41 | 20 | 21 | null | null |
sushantmahajan/programs | haskell-work/haskell/parser_.hs | cc0-1.0 | fundef::Parser Char Fundef
fundef = identifier <*> fargs <*> (feqtoken *> expr) <@ f
where f (x,(y,z)) = Fun x y z
-- ---------------program | 237 | fundef::Parser Char Fundef
fundef = identifier <*> fargs <*> (feqtoken *> expr) <@ f
where f (x,(y,z)) = Fun x y z
-- ---------------program | 186 | fundef = identifier <*> fargs <*> (feqtoken *> expr) <@ f
where f (x,(y,z)) = Fun x y z
-- ---------------program | 159 | false | true | 1 | 8 | 120 | 72 | 35 | 37 | null | null |
wks/algorithmic-junks | select/mom-select.hs | mit | group5 :: (Ord a) => [a] -> [[a]]
group5 [] = [] | 48 | group5 :: (Ord a) => [a] -> [[a]]
group5 [] = [] | 48 | group5 [] = [] | 14 | false | true | 0 | 10 | 11 | 46 | 23 | 23 | null | null |
snoyberg/ghc | testsuite/tests/typecheck/should_compile/tc232.hs | bsd-3-clause | zork :: (Monad m) => a -> L m ()
zork = undefined | 49 | zork :: (Monad m) => a -> L m ()
zork = undefined | 49 | zork = undefined | 16 | false | true | 0 | 9 | 12 | 37 | 17 | 20 | null | null |
brendanhay/gogol | gogol-sqladmin/gen/Network/Google/Resource/SQL/Instances/AddServerCa.hs | mpl-2.0 | -- | Cloud SQL instance ID. This does not include the project ID.
iascInstance :: Lens' InstancesAddServerCa Text
iascInstance
= lens _iascInstance (\ s a -> s{_iascInstance = a}) | 181 | iascInstance :: Lens' InstancesAddServerCa Text
iascInstance
= lens _iascInstance (\ s a -> s{_iascInstance = a}) | 115 | iascInstance
= lens _iascInstance (\ s a -> s{_iascInstance = a}) | 67 | true | true | 1 | 9 | 30 | 46 | 22 | 24 | null | null |
jsavatgy/dit-doo | too-old/too-old-01.hs | gpl-2.0 | lastN n xs = reverse (take n (reverse xs)) | 42 | lastN n xs = reverse (take n (reverse xs)) | 42 | lastN n xs = reverse (take n (reverse xs)) | 42 | false | false | 0 | 9 | 8 | 28 | 13 | 15 | null | null |
ekmett/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | -- Double ops
translateOp _ DoubleEqOp = Just (MO_F_Eq W64) | 69 | translateOp _ DoubleEqOp = Just (MO_F_Eq W64) | 54 | translateOp _ DoubleEqOp = Just (MO_F_Eq W64) | 54 | true | false | 0 | 7 | 19 | 21 | 10 | 11 | null | null |
quyse/flaw | flaw-font/Flaw/Graphics/Font/Script.hs | mit | fontScriptPsalterPahlavi :: FontScript
fontScriptPsalterPahlavi = fontScript "Phlp" | 96 | fontScriptPsalterPahlavi :: FontScript
fontScriptPsalterPahlavi = fontScript "Phlp" | 96 | fontScriptPsalterPahlavi = fontScript "Phlp" | 51 | false | true | 0 | 5 | 19 | 14 | 7 | 7 | null | null |
Vierkantor/TexMixFix | mixfix.hs | mit | (~>) :: Parser s a -> Parser s [a] -> Parser s [a]
(~>) p q = (:) <$> p <*> q | 77 | (~>) :: Parser s a -> Parser s [a] -> Parser s [a]
(~>) p q = (:) <$> p <*> q | 77 | (~>) p q = (:) <$> p <*> q | 26 | false | true | 0 | 9 | 21 | 64 | 33 | 31 | null | null |
dysinger/amazonka | amazonka-elastictranscoder/gen/Network/AWS/ElasticTranscoder/TestRole.hs | mpl-2.0 | -- | 'TestRoleResponse' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'trrMessages' @::@ ['Text']
--
-- * 'trrSuccess' @::@ 'Maybe' 'Text'
--
testRoleResponse :: TestRoleResponse
testRoleResponse = TestRoleResponse
{ _trrSuccess = Nothing
, _trrMessages = mempty
} | 314 | testRoleResponse :: TestRoleResponse
testRoleResponse = TestRoleResponse
{ _trrSuccess = Nothing
, _trrMessages = mempty
} | 135 | testRoleResponse = TestRoleResponse
{ _trrSuccess = Nothing
, _trrMessages = mempty
} | 98 | true | true | 0 | 6 | 54 | 33 | 23 | 10 | null | null |
etcinit/craze | src/Network/Craze.hs | bsd-3-clause | defaultRacer :: Racer [(String,String)] ByteString ByteString
defaultRacer = def | 80 | defaultRacer :: Racer [(String,String)] ByteString ByteString
defaultRacer = def | 80 | defaultRacer = def | 18 | false | true | 0 | 7 | 8 | 27 | 15 | 12 | null | null |
Gabriel439/Haskell-Pipes-Library | src/Pipes/Lift.hs | bsd-3-clause | distribute
:: ( Monad m
, MonadTrans t
, MFunctor t
, Monad (t m)
, Monad (t (Proxy a' a b' b m))
)
=> Proxy a' a b' b (t m) r
-- ^
-> t (Proxy a' a b' b m) r
-- ^
distribute p = runEffect $ request' >\\ unsafeHoist (hoist lift) p //> respond'
where
request' = lift . lift . request
respond' = lift . lift . respond
| 390 | distribute
:: ( Monad m
, MonadTrans t
, MFunctor t
, Monad (t m)
, Monad (t (Proxy a' a b' b m))
)
=> Proxy a' a b' b (t m) r
-- ^
-> t (Proxy a' a b' b m) r
distribute p = runEffect $ request' >\\ unsafeHoist (hoist lift) p //> respond'
where
request' = lift . lift . request
respond' = lift . lift . respond
| 380 | distribute p = runEffect $ request' >\\ unsafeHoist (hoist lift) p //> respond'
where
request' = lift . lift . request
respond' = lift . lift . respond
| 163 | true | true | 0 | 11 | 149 | 173 | 86 | 87 | null | null |
michalt/cvector | Data/CVector.hs | bsd-3-clause | --
-- Parititioning
--
partition :: (a -> Bool) -> CVector a -> (CVector a, CVector a)
partition = G.partition | 111 | partition :: (a -> Bool) -> CVector a -> (CVector a, CVector a)
partition = G.partition | 87 | partition = G.partition | 23 | true | true | 0 | 8 | 20 | 46 | 25 | 21 | null | null |
Heather/stack | src/Stack/Build/Target.hs | bsd-3-clause | isCompNamed :: Text -> NamedComponent -> Bool
isCompNamed _ CLib = False | 72 | isCompNamed :: Text -> NamedComponent -> Bool
isCompNamed _ CLib = False | 72 | isCompNamed _ CLib = False | 26 | false | true | 0 | 6 | 11 | 24 | 12 | 12 | null | null |
Botje/crystal | Crystal/JSON.hs | gpl-2.0 | obj :: String -> [Pair] -> Value
obj typ pairs = object ("type" .= typ : pairs ) | 80 | obj :: String -> [Pair] -> Value
obj typ pairs = object ("type" .= typ : pairs ) | 80 | obj typ pairs = object ("type" .= typ : pairs ) | 47 | false | true | 0 | 8 | 17 | 45 | 22 | 23 | null | null |
bgwines/project-euler | src/solved/problem78.hs | bsd-3-clause | p :: Integer -> Integer
p = Memo.integral p' | 44 | p :: Integer -> Integer
p = Memo.integral p' | 44 | p = Memo.integral p' | 20 | false | true | 0 | 7 | 8 | 26 | 11 | 15 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2016/M08/D29/Exercise.hs | mit | {--
Now for something completely different.
My daughter, EM, posed this #math problem to me. Can you solve it?
WHAT IS THE NEXT NUMBER?
3
13
1113
3113
132113
?
--}
series :: [Integer]
series = map read (words "3 13 1113 3113 132113") | 236 | series :: [Integer]
series = map read (words "3 13 1113 3113 132113") | 69 | series = map read (words "3 13 1113 3113 132113") | 49 | true | true | 0 | 7 | 46 | 33 | 15 | 18 | null | null |
deontologician/orbRPG | Game/OrbRPG/Combinations.hs | gpl-3.0 | E Erbium @>> L Lambda = E Cesium | 32 | E Erbium @>> L Lambda = E Cesium | 32 | E Erbium @>> L Lambda = E Cesium | 32 | false | false | 0 | 6 | 7 | 21 | 8 | 13 | null | null |
farrellm/advent | src/Day12.hs | mit | p2 = (sum . numbers2 . Object) <$> ((fromJust . decode . B.pack) <$> input :: IO Object) | 88 | p2 = (sum . numbers2 . Object) <$> ((fromJust . decode . B.pack) <$> input :: IO Object) | 88 | p2 = (sum . numbers2 . Object) <$> ((fromJust . decode . B.pack) <$> input :: IO Object) | 88 | false | false | 1 | 11 | 17 | 51 | 25 | 26 | null | null |
roberth/uu-helium | test/simple/runtimeerrors/CatchBug.hs | gpl-3.0 | main = catch (do { [x] <- return [1, 2, 3]; return () })
(\err -> putStrLn "The exception has been caught") | 121 | main = catch (do { [x] <- return [1, 2, 3]; return () })
(\err -> putStrLn "The exception has been caught") | 121 | main = catch (do { [x] <- return [1, 2, 3]; return () })
(\err -> putStrLn "The exception has been caught") | 121 | false | false | 1 | 10 | 35 | 63 | 31 | 32 | null | null |
Bratiakina/sudoku-hs | src/Model/Parser.hs | bsd-3-clause | charToDigit '2' = Just D2 | 25 | charToDigit '2' = Just D2 | 25 | charToDigit '2' = Just D2 | 25 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
christianlavoie/origami-computational-model | src/Main.hs | bsd-3-clause | compilerOpts :: [String] -> IO (Options, [String])
compilerOpts argv =
case GetOpt.getOpt GetOpt.Permute options argv of
(o,n,[] ) -> return (foldl (flip id) defaultOptions o, n)
(_,_,errs) -> ioError (userError (concat errs ++ GetOpt.usageInfo header options))
where header = "Usage: ic [OPTION...] files..."
-- Actual program | 346 | compilerOpts :: [String] -> IO (Options, [String])
compilerOpts argv =
case GetOpt.getOpt GetOpt.Permute options argv of
(o,n,[] ) -> return (foldl (flip id) defaultOptions o, n)
(_,_,errs) -> ioError (userError (concat errs ++ GetOpt.usageInfo header options))
where header = "Usage: ic [OPTION...] files..."
-- Actual program | 346 | compilerOpts argv =
case GetOpt.getOpt GetOpt.Permute options argv of
(o,n,[] ) -> return (foldl (flip id) defaultOptions o, n)
(_,_,errs) -> ioError (userError (concat errs ++ GetOpt.usageInfo header options))
where header = "Usage: ic [OPTION...] files..."
-- Actual program | 295 | false | true | 0 | 14 | 64 | 137 | 72 | 65 | null | null |
robdockins/edison | edison-api/src/Data/Edison/Sym.hs | mit | -- | Lookup an element in a sequence. Identical to 'S.lookup' with
-- reversed arguments.
(!) :: S.Sequence seq => seq a -> P.Int -> a
(!) = P.flip S.lookup | 159 | (!) :: S.Sequence seq => seq a -> P.Int -> a
(!) = P.flip S.lookup | 66 | (!) = P.flip S.lookup | 21 | true | true | 0 | 8 | 32 | 46 | 25 | 21 | null | null |
bitemyapp/ganeti | src/Ganeti/HTools/Backend/IAlloc.hs | bsd-2-clause | -- | Main iallocator pipeline.
runIAllocator :: AlgorithmOptions
-> Request -> (Maybe (Node.List, Instance.List), String)
runIAllocator opts request = formatIAllocResult $ processRequest opts request | 213 | runIAllocator :: AlgorithmOptions
-> Request -> (Maybe (Node.List, Instance.List), String)
runIAllocator opts request = formatIAllocResult $ processRequest opts request | 182 | runIAllocator opts request = formatIAllocResult $ processRequest opts request | 77 | true | true | 0 | 10 | 37 | 53 | 28 | 25 | null | null |
GaloisInc/saw-script | saw-core/src/Verifier/SAW/Prim.hs | bsd-3-clause | -- | For division by 0.
divideByZero :: a
divideByZero = X.throw DivideByZero | 77 | divideByZero :: a
divideByZero = X.throw DivideByZero | 53 | divideByZero = X.throw DivideByZero | 35 | true | true | 0 | 6 | 12 | 17 | 9 | 8 | null | null |
mpickering/HaRe | test/testdata/Renaming/ConflictExport_TokOut.hs | bsd-3-clause | myFringe (Branch left right) = myFringe right | 45 | myFringe (Branch left right) = myFringe right | 45 | myFringe (Branch left right) = myFringe right | 45 | false | false | 0 | 7 | 6 | 20 | 9 | 11 | null | null |
brendanhay/gogol | gogol-dataproc/gen/Network/Google/Resource/Dataproc/Projects/Regions/Operations/Cancel.hs | mpl-2.0 | -- | OAuth access token.
procAccessToken :: Lens' ProjectsRegionsOperationsCancel (Maybe Text)
procAccessToken
= lens _procAccessToken
(\ s a -> s{_procAccessToken = a}) | 177 | procAccessToken :: Lens' ProjectsRegionsOperationsCancel (Maybe Text)
procAccessToken
= lens _procAccessToken
(\ s a -> s{_procAccessToken = a}) | 152 | procAccessToken
= lens _procAccessToken
(\ s a -> s{_procAccessToken = a}) | 82 | true | true | 0 | 9 | 29 | 48 | 25 | 23 | null | null |
iblumenfeld/cryptol | src/Cryptol/Parser/NoPat.hs | bsd-3-clause | checkSigs :: QName -> [Located Schema] -> NoPatM (Maybe Schema)
checkSigs _ [] = return Nothing | 107 | checkSigs :: QName -> [Located Schema] -> NoPatM (Maybe Schema)
checkSigs _ [] = return Nothing | 107 | checkSigs _ [] = return Nothing | 43 | false | true | 0 | 10 | 27 | 48 | 22 | 26 | null | null |
sdiehl/ghc | compiler/utils/UniqDFM.hs | bsd-3-clause | taggedSnd :: TaggedVal val -> Int
taggedSnd (TaggedVal _ i) = i | 63 | taggedSnd :: TaggedVal val -> Int
taggedSnd (TaggedVal _ i) = i | 63 | taggedSnd (TaggedVal _ i) = i | 29 | false | true | 0 | 9 | 11 | 35 | 15 | 20 | null | null |
danr/hipspec | testsuite/prod/zeno_version/PropT42.hs | gpl-3.0 | (+) :: Nat -> Nat -> Nat
Z + y = y | 34 | (+) :: Nat -> Nat -> Nat
Z + y = y | 34 | Z + y = y | 9 | false | true | 0 | 9 | 11 | 32 | 15 | 17 | null | null |
grayjay/hackage-server | Distribution/Server/Pages/Package.hs | bsd-3-clause | paragraphs :: String -> [String]
paragraphs = map unlines . paras . lines
where paras xs = case dropWhile null xs of
[] -> []
xs' -> case break null xs' of
(para, xs'') -> para : paras xs'' | 247 | paragraphs :: String -> [String]
paragraphs = map unlines . paras . lines
where paras xs = case dropWhile null xs of
[] -> []
xs' -> case break null xs' of
(para, xs'') -> para : paras xs'' | 247 | paragraphs = map unlines . paras . lines
where paras xs = case dropWhile null xs of
[] -> []
xs' -> case break null xs' of
(para, xs'') -> para : paras xs'' | 214 | false | true | 0 | 12 | 96 | 92 | 46 | 46 | null | null |
tolysz/prepare-ghcjs | spec-lts8/cabal/Cabal/Distribution/Simple/Program/Script.hs | bsd-3-clause | -- | Generate a POSIX shell script that invokes a program.
--
invocationAsShellScript :: ProgramInvocation -> String
invocationAsShellScript
ProgramInvocation {
progInvokePath = path,
progInvokeArgs = args,
progInvokeEnv = envExtra,
progInvokeCwd = mcwd,
progInvokeInput = minput
} = unlines $
[ "#!/bin/sh" ]
++ concatMap setEnv envExtra
++ [ "cd " ++ quote cwd | cwd <- maybeToList mcwd ]
++ [ (case minput of
Nothing -> ""
Just input -> "echo " ++ quote input ++ " | ")
++ unwords (map quote $ path : args) ++ " \"$@\""]
where
setEnv (var, Nothing) = ["unset " ++ var, "export " ++ var]
setEnv (var, Just val) = ["export " ++ var ++ "=" ++ quote val]
quote :: String -> String
quote s = "'" ++ escape s ++ "'"
escape [] = []
escape ('\'':cs) = "'\\''" ++ escape cs
escape (c :cs) = c : escape cs
-- | Generate a Windows batch file that invokes a program.
-- | 1,013 | invocationAsShellScript :: ProgramInvocation -> String
invocationAsShellScript
ProgramInvocation {
progInvokePath = path,
progInvokeArgs = args,
progInvokeEnv = envExtra,
progInvokeCwd = mcwd,
progInvokeInput = minput
} = unlines $
[ "#!/bin/sh" ]
++ concatMap setEnv envExtra
++ [ "cd " ++ quote cwd | cwd <- maybeToList mcwd ]
++ [ (case minput of
Nothing -> ""
Just input -> "echo " ++ quote input ++ " | ")
++ unwords (map quote $ path : args) ++ " \"$@\""]
where
setEnv (var, Nothing) = ["unset " ++ var, "export " ++ var]
setEnv (var, Just val) = ["export " ++ var ++ "=" ++ quote val]
quote :: String -> String
quote s = "'" ++ escape s ++ "'"
escape [] = []
escape ('\'':cs) = "'\\''" ++ escape cs
escape (c :cs) = c : escape cs
-- | Generate a Windows batch file that invokes a program.
-- | 951 | invocationAsShellScript
ProgramInvocation {
progInvokePath = path,
progInvokeArgs = args,
progInvokeEnv = envExtra,
progInvokeCwd = mcwd,
progInvokeInput = minput
} = unlines $
[ "#!/bin/sh" ]
++ concatMap setEnv envExtra
++ [ "cd " ++ quote cwd | cwd <- maybeToList mcwd ]
++ [ (case minput of
Nothing -> ""
Just input -> "echo " ++ quote input ++ " | ")
++ unwords (map quote $ path : args) ++ " \"$@\""]
where
setEnv (var, Nothing) = ["unset " ++ var, "export " ++ var]
setEnv (var, Just val) = ["export " ++ var ++ "=" ++ quote val]
quote :: String -> String
quote s = "'" ++ escape s ++ "'"
escape [] = []
escape ('\'':cs) = "'\\''" ++ escape cs
escape (c :cs) = c : escape cs
-- | Generate a Windows batch file that invokes a program.
-- | 896 | true | true | 11 | 19 | 314 | 324 | 163 | 161 | null | null |
ghcjs/diagrams-ghcjs | src/Graphics/Rendering/GHCJS.hs | bsd-3-clause | strokeColor :: (Color c) => c -> Render ()
strokeColor c = ctx (C.strokeStyle r g b a)
where (r,g,b,a) = colorToJSRGBA c | 124 | strokeColor :: (Color c) => c -> Render ()
strokeColor c = ctx (C.strokeStyle r g b a)
where (r,g,b,a) = colorToJSRGBA c | 124 | strokeColor c = ctx (C.strokeStyle r g b a)
where (r,g,b,a) = colorToJSRGBA c | 81 | false | true | 0 | 9 | 26 | 77 | 38 | 39 | null | null |
allanderek/ipclib | Ipc/Ipc.hs | gpl-2.0 | compileForDot :: CliOptions a -> FilePath -> IO ExitCode
compileForDot options file =
parseAndMain options file (getStatesSpaceResult options) postAction
where
-- The post action writes out the state space to a
-- dot file and runs dot over it.
postAction :: StateResult -> IO ExitCode
postAction spaces =
do writeFile dotFile $ stateSpaceToDot space
system $ unwords [ "dot", "-Tsvg", "-o", svgFile, dotFile ]
where
-- The state space to draw a graph of
space = chooseSpace options spaces
-- The dot file to output the state space to
dotFile = getDotFile options file
-- The svg file to convert the dot file to.
svgFile = Utils.switchExtension ".dot" ".svg" dotFile | 721 | compileForDot :: CliOptions a -> FilePath -> IO ExitCode
compileForDot options file =
parseAndMain options file (getStatesSpaceResult options) postAction
where
-- The post action writes out the state space to a
-- dot file and runs dot over it.
postAction :: StateResult -> IO ExitCode
postAction spaces =
do writeFile dotFile $ stateSpaceToDot space
system $ unwords [ "dot", "-Tsvg", "-o", svgFile, dotFile ]
where
-- The state space to draw a graph of
space = chooseSpace options spaces
-- The dot file to output the state space to
dotFile = getDotFile options file
-- The svg file to convert the dot file to.
svgFile = Utils.switchExtension ".dot" ".svg" dotFile | 721 | compileForDot options file =
parseAndMain options file (getStatesSpaceResult options) postAction
where
-- The post action writes out the state space to a
-- dot file and runs dot over it.
postAction :: StateResult -> IO ExitCode
postAction spaces =
do writeFile dotFile $ stateSpaceToDot space
system $ unwords [ "dot", "-Tsvg", "-o", svgFile, dotFile ]
where
-- The state space to draw a graph of
space = chooseSpace options spaces
-- The dot file to output the state space to
dotFile = getDotFile options file
-- The svg file to convert the dot file to.
svgFile = Utils.switchExtension ".dot" ".svg" dotFile | 664 | false | true | 0 | 9 | 164 | 148 | 74 | 74 | null | null |
ant0nsc/bond | compiler/src/Language/Bond/Codegen/TypeMapping.hs | mit | -- C++ type mapping
cppType :: Type -> TypeNameBuilder
cppType BT_Int8 = pure "int8_t" | 86 | cppType :: Type -> TypeNameBuilder
cppType BT_Int8 = pure "int8_t" | 66 | cppType BT_Int8 = pure "int8_t" | 31 | true | true | 0 | 7 | 13 | 28 | 12 | 16 | null | null |
nakamuray/htig | HTIG/Core.hs | bsd-3-clause | -- | twitter oauth application
htigApp :: Application
htigApp = Application "HQw2EU5rwjzBPsP8DnpOZA" "4u2sHLcpSfyo4u4iLm945lv0irBU12YEPXVqPfPNSsY" OOB | 150 | htigApp :: Application
htigApp = Application "HQw2EU5rwjzBPsP8DnpOZA" "4u2sHLcpSfyo4u4iLm945lv0irBU12YEPXVqPfPNSsY" OOB | 119 | htigApp = Application "HQw2EU5rwjzBPsP8DnpOZA" "4u2sHLcpSfyo4u4iLm945lv0irBU12YEPXVqPfPNSsY" OOB | 96 | true | true | 0 | 5 | 13 | 19 | 10 | 9 | null | null |
csabahruska/q3demo | src/Q3Demo/Graphics/GLBackend.hs | bsd-3-clause | -- this is for setting up uniforms in action
renderGLMesh'D :: GLProgram -> GLMesh -> IO Bool -> IO Bool
renderGLMesh'D p (GLMesh al pr) setup = withGLProgram p $ do
ok <- setup
if not ok then return False else
withGLAttributes p [a | a@(_,name) <- al, hasAttr name] $ renderGLPrimitive pr s
where
s = glaSize $ fst $ head al
hasAttr n = T.member n (glpAttributes p) | 392 | renderGLMesh'D :: GLProgram -> GLMesh -> IO Bool -> IO Bool
renderGLMesh'D p (GLMesh al pr) setup = withGLProgram p $ do
ok <- setup
if not ok then return False else
withGLAttributes p [a | a@(_,name) <- al, hasAttr name] $ renderGLPrimitive pr s
where
s = glaSize $ fst $ head al
hasAttr n = T.member n (glpAttributes p) | 347 | renderGLMesh'D p (GLMesh al pr) setup = withGLProgram p $ do
ok <- setup
if not ok then return False else
withGLAttributes p [a | a@(_,name) <- al, hasAttr name] $ renderGLPrimitive pr s
where
s = glaSize $ fst $ head al
hasAttr n = T.member n (glpAttributes p) | 287 | true | true | 0 | 15 | 95 | 157 | 76 | 81 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.