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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
kumasento/accelerate | Data/Array/Accelerate/Trafo/Algebra.hs | bsd-3-clause | -- Logical operators
-- -----------------
evalLAnd :: (Bool,Bool) :-> Bool
evalLAnd (untup2 -> Just (x,y)) env
| Just a <- propagate env x
= Just $ if a then Stats.ruleFired "True &&" y
else Stats.ruleFired "False &&" $ Const (fromElt False) | 267 | evalLAnd :: (Bool,Bool) :-> Bool
evalLAnd (untup2 -> Just (x,y)) env
| Just a <- propagate env x
= Just $ if a then Stats.ruleFired "True &&" y
else Stats.ruleFired "False &&" $ Const (fromElt False) | 224 | evalLAnd (untup2 -> Just (x,y)) env
| Just a <- propagate env x
= Just $ if a then Stats.ruleFired "True &&" y
else Stats.ruleFired "False &&" $ Const (fromElt False) | 191 | true | true | 0 | 11 | 66 | 99 | 50 | 49 | null | null |
brendanhay/gogol | gogol-blogger/gen/Network/Google/Resource/Blogger/Blogs/Get.hs | mpl-2.0 | -- | V1 error format.
bgXgafv :: Lens' BlogsGet (Maybe Xgafv)
bgXgafv = lens _bgXgafv (\ s a -> s{_bgXgafv = a}) | 112 | bgXgafv :: Lens' BlogsGet (Maybe Xgafv)
bgXgafv = lens _bgXgafv (\ s a -> s{_bgXgafv = a}) | 90 | bgXgafv = lens _bgXgafv (\ s a -> s{_bgXgafv = a}) | 50 | true | true | 0 | 9 | 21 | 46 | 25 | 21 | null | null |
brendanhay/gogol | gogol-android-enterprise/gen/Network/Google/Resource/AndroidEnterprise/Products/UnApprove.hs | mpl-2.0 | -- | Creates a value of 'ProductsUnApprove' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'puaXgafv'
--
-- * 'puaUploadProtocol'
--
-- * 'puaEnterpriseId'
--
-- * 'puaAccessToken'
--
-- * 'puaUploadType'
--
-- * 'puaProductId'
--
-- * 'puaCallback'
productsUnApprove
:: Text -- ^ 'puaEnterpriseId'
-> Text -- ^ 'puaProductId'
-> ProductsUnApprove
productsUnApprove pPuaEnterpriseId_ pPuaProductId_ =
ProductsUnApprove'
{ _puaXgafv = Nothing
, _puaUploadProtocol = Nothing
, _puaEnterpriseId = pPuaEnterpriseId_
, _puaAccessToken = Nothing
, _puaUploadType = Nothing
, _puaProductId = pPuaProductId_
, _puaCallback = Nothing
} | 758 | productsUnApprove
:: Text -- ^ 'puaEnterpriseId'
-> Text -- ^ 'puaProductId'
-> ProductsUnApprove
productsUnApprove pPuaEnterpriseId_ pPuaProductId_ =
ProductsUnApprove'
{ _puaXgafv = Nothing
, _puaUploadProtocol = Nothing
, _puaEnterpriseId = pPuaEnterpriseId_
, _puaAccessToken = Nothing
, _puaUploadType = Nothing
, _puaProductId = pPuaProductId_
, _puaCallback = Nothing
} | 422 | productsUnApprove pPuaEnterpriseId_ pPuaProductId_ =
ProductsUnApprove'
{ _puaXgafv = Nothing
, _puaUploadProtocol = Nothing
, _puaEnterpriseId = pPuaEnterpriseId_
, _puaAccessToken = Nothing
, _puaUploadType = Nothing
, _puaProductId = pPuaProductId_
, _puaCallback = Nothing
} | 312 | true | true | 0 | 8 | 150 | 96 | 62 | 34 | null | null |
jacekszymanski/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | -- end enum wxAuiNotebookOption
-- enum wxAuiPaneInsertLevel
wxAUI_INSERT_PANE :: Int
wxAUI_INSERT_PANE = 0 | 108 | wxAUI_INSERT_PANE :: Int
wxAUI_INSERT_PANE = 0 | 46 | wxAUI_INSERT_PANE = 0 | 21 | true | true | 0 | 4 | 13 | 13 | 8 | 5 | null | null |
helino/espresso | src/Espresso/Parser.hs | bsd-3-clause | keyword :: String -> Parser Char
keyword = token . string | 57 | keyword :: String -> Parser Char
keyword = token . string | 57 | keyword = token . string | 24 | false | true | 0 | 7 | 10 | 28 | 12 | 16 | null | null |
dzamkov/Oedel | doc/examples/PlanetChecker.hs | mit | ordinal n = show n ++ "th" | 26 | ordinal n = show n ++ "th" | 26 | ordinal n = show n ++ "th" | 26 | false | false | 3 | 5 | 6 | 21 | 7 | 14 | null | null |
rleshchinskiy/vector | Data/Vector/Fusion/Stream/Monadic.hs | bsd-3-clause | indexedR m (Stream step s) = Stream step' (s,m)
where
{-# INLINE_INNER step' #-}
step' (s,i) = i `seq`
do
r <- step s
case r of
Yield x s' -> let i' = i-1
in
return $ Yield (i',x) (s', i')
Skip s' -> return $ Skip (s', i)
Done -> return Done
-- | Zip two 'Stream's with the given monadic function | 520 | indexedR m (Stream step s) = Stream step' (s,m)
where
{-# INLINE_INNER step' #-}
step' (s,i) = i `seq`
do
r <- step s
case r of
Yield x s' -> let i' = i-1
in
return $ Yield (i',x) (s', i')
Skip s' -> return $ Skip (s', i)
Done -> return Done
-- | Zip two 'Stream's with the given monadic function | 520 | indexedR m (Stream step s) = Stream step' (s,m)
where
{-# INLINE_INNER step' #-}
step' (s,i) = i `seq`
do
r <- step s
case r of
Yield x s' -> let i' = i-1
in
return $ Yield (i',x) (s', i')
Skip s' -> return $ Skip (s', i)
Done -> return Done
-- | Zip two 'Stream's with the given monadic function | 520 | false | false | 0 | 15 | 287 | 153 | 76 | 77 | null | null |
jprider63/yesod | yesod-core/Yesod/Core/Handler.hs | mit | -- | Returns a function that runs 'HandlerT' actions inside @IO@.
--
-- Sometimes you want to run an inner 'HandlerT' action outside
-- the control flow of an HTTP request (on the outer 'HandlerT'
-- action). For example, you may want to spawn a new thread:
--
-- @
-- getFooR :: Handler RepHtml
-- getFooR = do
-- runInnerHandler <- handlerToIO
-- liftIO $ forkIO $ runInnerHandler $ do
-- /Code here runs inside GHandler but on a new thread./
-- /This is the inner GHandler./
-- ...
-- /Code here runs inside the request's control flow./
-- /This is the outer GHandler./
-- ...
-- @
--
-- Another use case for this function is creating a stream of
-- server-sent events using 'GHandler' actions (see
-- @yesod-eventsource@).
--
-- Most of the environment from the outer 'GHandler' is preserved
-- on the inner 'GHandler', however:
--
-- * The request body is cleared (otherwise it would be very
-- difficult to prevent huge memory leaks).
--
-- * The cache is cleared (see 'CacheKey').
--
-- Changes to the response made inside the inner 'GHandler' are
-- ignored (e.g., session variables, cookies, response headers).
-- This allows the inner 'GHandler' to outlive the outer
-- 'GHandler' (e.g., on the @forkIO@ example above, a response
-- may be sent to the client without killing the new thread).
handlerToIO :: MonadIO m => HandlerFor site (HandlerFor site a -> m a)
handlerToIO =
HandlerFor $ \oldHandlerData -> do
-- Take just the bits we need from oldHandlerData.
let newReq = oldReq { reqWaiRequest = newWaiReq }
where
oldReq = handlerRequest oldHandlerData
oldWaiReq = reqWaiRequest oldReq
newWaiReq = oldWaiReq { W.requestBody = return mempty
, W.requestBodyLength = W.KnownLength 0
}
oldEnv = handlerEnv oldHandlerData
newState <- liftIO $ do
oldState <- I.readIORef (handlerState oldHandlerData)
return $ oldState { ghsRBC = Nothing
, ghsIdent = 1
, ghsCache = mempty
, ghsCacheBy = mempty
, ghsHeaders = mempty }
-- xx From this point onwards, no references to oldHandlerData xx
liftIO $ evaluate (newReq `seq` oldEnv `seq` newState `seq` ())
-- Return GHandler running function.
return $ \(HandlerFor f) ->
liftIO $
runResourceT $ withInternalState $ \resState -> do
-- The state IORef needs to be created here, otherwise it
-- will be shared by different invocations of this function.
newStateIORef <- liftIO (I.newIORef newState)
let newHandlerData =
HandlerData
{ handlerRequest = newReq
, handlerEnv = oldEnv
, handlerState = newStateIORef
, handlerResource = resState
}
liftIO (f newHandlerData)
-- | forkIO for a Handler (run an action in the background)
--
-- Uses 'handlerToIO', liftResourceT, and resourceForkIO
-- for correctness and efficiency
--
-- @since 1.2.8 | 3,136 | handlerToIO :: MonadIO m => HandlerFor site (HandlerFor site a -> m a)
handlerToIO =
HandlerFor $ \oldHandlerData -> do
-- Take just the bits we need from oldHandlerData.
let newReq = oldReq { reqWaiRequest = newWaiReq }
where
oldReq = handlerRequest oldHandlerData
oldWaiReq = reqWaiRequest oldReq
newWaiReq = oldWaiReq { W.requestBody = return mempty
, W.requestBodyLength = W.KnownLength 0
}
oldEnv = handlerEnv oldHandlerData
newState <- liftIO $ do
oldState <- I.readIORef (handlerState oldHandlerData)
return $ oldState { ghsRBC = Nothing
, ghsIdent = 1
, ghsCache = mempty
, ghsCacheBy = mempty
, ghsHeaders = mempty }
-- xx From this point onwards, no references to oldHandlerData xx
liftIO $ evaluate (newReq `seq` oldEnv `seq` newState `seq` ())
-- Return GHandler running function.
return $ \(HandlerFor f) ->
liftIO $
runResourceT $ withInternalState $ \resState -> do
-- The state IORef needs to be created here, otherwise it
-- will be shared by different invocations of this function.
newStateIORef <- liftIO (I.newIORef newState)
let newHandlerData =
HandlerData
{ handlerRequest = newReq
, handlerEnv = oldEnv
, handlerState = newStateIORef
, handlerResource = resState
}
liftIO (f newHandlerData)
-- | forkIO for a Handler (run an action in the background)
--
-- Uses 'handlerToIO', liftResourceT, and resourceForkIO
-- for correctness and efficiency
--
-- @since 1.2.8 | 1,808 | handlerToIO =
HandlerFor $ \oldHandlerData -> do
-- Take just the bits we need from oldHandlerData.
let newReq = oldReq { reqWaiRequest = newWaiReq }
where
oldReq = handlerRequest oldHandlerData
oldWaiReq = reqWaiRequest oldReq
newWaiReq = oldWaiReq { W.requestBody = return mempty
, W.requestBodyLength = W.KnownLength 0
}
oldEnv = handlerEnv oldHandlerData
newState <- liftIO $ do
oldState <- I.readIORef (handlerState oldHandlerData)
return $ oldState { ghsRBC = Nothing
, ghsIdent = 1
, ghsCache = mempty
, ghsCacheBy = mempty
, ghsHeaders = mempty }
-- xx From this point onwards, no references to oldHandlerData xx
liftIO $ evaluate (newReq `seq` oldEnv `seq` newState `seq` ())
-- Return GHandler running function.
return $ \(HandlerFor f) ->
liftIO $
runResourceT $ withInternalState $ \resState -> do
-- The state IORef needs to be created here, otherwise it
-- will be shared by different invocations of this function.
newStateIORef <- liftIO (I.newIORef newState)
let newHandlerData =
HandlerData
{ handlerRequest = newReq
, handlerEnv = oldEnv
, handlerState = newStateIORef
, handlerResource = resState
}
liftIO (f newHandlerData)
-- | forkIO for a Handler (run an action in the background)
--
-- Uses 'handlerToIO', liftResourceT, and resourceForkIO
-- for correctness and efficiency
--
-- @since 1.2.8 | 1,737 | true | true | 0 | 19 | 893 | 369 | 217 | 152 | null | null |
ksaveljev/hake-2 | src/Client/CLTEnt.hs | bsd-3-clause | splashColor :: UV.Vector Int
splashColor = UV.fromList [ 0x00, 0xe0, 0xb0, 0x50, 0xd0, 0xe0, 0xe8 ] | 99 | splashColor :: UV.Vector Int
splashColor = UV.fromList [ 0x00, 0xe0, 0xb0, 0x50, 0xd0, 0xe0, 0xe8 ] | 99 | splashColor = UV.fromList [ 0x00, 0xe0, 0xb0, 0x50, 0xd0, 0xe0, 0xe8 ] | 70 | false | true | 1 | 6 | 15 | 45 | 24 | 21 | null | null |
silkapp/json-schema | src/Data/JSON/Schema/Combinators.hs | bsd-3-clause | v1 <|> v2 = Choice $ [v1, v2] | 47 | v1 <|> v2 = Choice $ [v1, v2] | 47 | v1 <|> v2 = Choice $ [v1, v2] | 47 | false | false | 0 | 6 | 25 | 22 | 11 | 11 | null | null |
codemac/yi-editor | src/Yi/Core.hs | gpl-2.0 | withSyntax :: (Show x, YiAction a x) => (forall syntax. Mode syntax -> syntax -> a) -> YiM ()
withSyntax f = do
b <- gets currentBuffer
act <- withGivenBuffer b $ withSyntaxB f
runAction $ makeAction $ act | 241 | withSyntax :: (Show x, YiAction a x) => (forall syntax. Mode syntax -> syntax -> a) -> YiM ()
withSyntax f = do
b <- gets currentBuffer
act <- withGivenBuffer b $ withSyntaxB f
runAction $ makeAction $ act | 241 | withSyntax f = do
b <- gets currentBuffer
act <- withGivenBuffer b $ withSyntaxB f
runAction $ makeAction $ act | 147 | false | true | 0 | 10 | 74 | 97 | 46 | 51 | null | null |
urbanslug/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | mkTcEqPred :: TcType -> TcType -> Type
-- During type checking we build equalities between
-- type variables with OpenKind or ArgKind. Ultimately
-- they will all settle, but we want the equality predicate
-- itself to have kind '*'. I think.
--
-- But for now we call mkTyConApp, not mkEqPred, because the invariants
-- of the latter might not be satisfied during type checking.
-- Notably when we form an equalty (a : OpenKind) ~ (Int : *)
--
-- But this is horribly delicate: what about type variables
-- that turn out to be bound to Int#?
mkTcEqPred ty1 ty2
= mkTyConApp eqTyCon [k, ty1, ty2]
where
k = typeKind ty1
-- | Make a representational equality predicate | 680 | mkTcEqPred :: TcType -> TcType -> Type
mkTcEqPred ty1 ty2
= mkTyConApp eqTyCon [k, ty1, ty2]
where
k = typeKind ty1
-- | Make a representational equality predicate | 172 | mkTcEqPred ty1 ty2
= mkTyConApp eqTyCon [k, ty1, ty2]
where
k = typeKind ty1
-- | Make a representational equality predicate | 133 | true | true | 1 | 6 | 133 | 64 | 37 | 27 | null | null |
ssaavedra/liquidhaskell | benchmarks/llrbtree-0.1.1/Data/Set/RBTree0.hs | bsd-3-clause | balanceL' h (Node R _ a x (Node R _ b y c)) z d =
Node R (h+1) (Node B h a x b) y (Node B h c z d) | 102 | balanceL' h (Node R _ a x (Node R _ b y c)) z d =
Node R (h+1) (Node B h a x b) y (Node B h c z d) | 102 | balanceL' h (Node R _ a x (Node R _ b y c)) z d =
Node R (h+1) (Node B h a x b) y (Node B h c z d) | 102 | false | false | 0 | 9 | 35 | 89 | 44 | 45 | null | null |
jacendfeng/OpenJDK-7U-Research | src/macosx/native/jobjc/src/core/PrimitiveCoder.hs | gpl-2.0 | -- Given an Width and NType, return the Java code for writing said NType to memory.
pushAddr :: Width -> NType -> String
pushAddr _ NBOOL = "rt.unsafe.putByte(addr, (byte) (x ? 1 : 0));" | 188 | pushAddr :: Width -> NType -> String
pushAddr _ NBOOL = "rt.unsafe.putByte(addr, (byte) (x ? 1 : 0));" | 104 | pushAddr _ NBOOL = "rt.unsafe.putByte(addr, (byte) (x ? 1 : 0));" | 67 | true | true | 0 | 6 | 35 | 25 | 13 | 12 | null | null |
rahulmutt/codec-jvm | src/Codec/JVM/Internal.hs | apache-2.0 | cast :: (MArray (STUArray s) a (ST s),
MArray (STUArray s) b (ST s)) => a -> ST s b
cast x = newArray (0 :: Int, 0) x >>= castSTUArray >>= flip readArray 0 | 164 | cast :: (MArray (STUArray s) a (ST s),
MArray (STUArray s) b (ST s)) => a -> ST s b
cast x = newArray (0 :: Int, 0) x >>= castSTUArray >>= flip readArray 0 | 164 | cast x = newArray (0 :: Int, 0) x >>= castSTUArray >>= flip readArray 0 | 71 | false | true | 0 | 8 | 43 | 97 | 49 | 48 | null | null |
wangwangwar/cis194 | src/ch12/Ch12.hs | bsd-3-clause | -- Monad combinators
-- First, sequence takes a list of monadic values and produces a single monadic
-- value which collects the results. What this means depends on the particular
-- monad.
--
-- sequence :: Monad m => [m a] -> m [a]
-- sequence [] = return []
-- sequence (ma:mas) =
-- ma >>= \a -> sequence mas >>= \as -> return a:as
replicateM :: Monad m => Int -> m a -> m [a]
replicateM n m = sequence (replicate n m) | 426 | replicateM :: Monad m => Int -> m a -> m [a]
replicateM n m = sequence (replicate n m) | 86 | replicateM n m = sequence (replicate n m) | 41 | true | true | 0 | 10 | 89 | 64 | 34 | 30 | null | null |
kajigor/uKanren_transformations | test/resources/Program/List.hs | bsd-3-clause | b :: Term a
b = lit "b" | 23 | b :: Term a
b = lit "b" | 23 | b = lit "b" | 11 | false | true | 0 | 6 | 7 | 23 | 9 | 14 | null | null |
pbevin/toycss | src/html/HtmlNode.hs | gpl-2.0 | nodeId (Text _) = Nothing | 25 | nodeId (Text _) = Nothing | 25 | nodeId (Text _) = Nothing | 25 | false | false | 0 | 7 | 4 | 15 | 7 | 8 | null | null |
Daniel-Diaz/Wavy-Draw | Data/Sound/Draw.hs | bsd-3-clause | renderSound :: Sound -> Render ()
renderSound = renderSoundWith defaultConfig | 77 | renderSound :: Sound -> Render ()
renderSound = renderSoundWith defaultConfig | 77 | renderSound = renderSoundWith defaultConfig | 43 | false | true | 0 | 7 | 9 | 23 | 11 | 12 | null | null |
sdiehl/ghc | compiler/simplCore/OccurAnal.hs | bsd-3-clause | isEmptyDetails :: UsageDetails -> Bool
isEmptyDetails = isEmptyVarEnv . ud_env | 78 | isEmptyDetails :: UsageDetails -> Bool
isEmptyDetails = isEmptyVarEnv . ud_env | 78 | isEmptyDetails = isEmptyVarEnv . ud_env | 39 | false | true | 0 | 5 | 9 | 19 | 10 | 9 | null | null |
slon1024/functional_programming | haskell/List.hs | mit | {- takes three lists and returns a list of triples, analogous to zip.
-}
zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
zip3 [] _ _ = [] | 165 | zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
zip3 [] _ _ = [] | 92 | zip3 [] _ _ = [] | 30 | true | true | 0 | 11 | 65 | 58 | 32 | 26 | null | null |
rueshyna/gogol | gogol-proximitybeacon/gen/Network/Google/ProximityBeacon/Types/Product.hs | mpl-2.0 | -- | An initial ephemeral ID calculated using the clock value submitted as
-- \`initial_clock_value\`, and the secret key generated by the
-- Diffie-Hellman key exchange using \`service_ecdh_public_key\` and
-- \`service_ecdh_public_key\`. This initial EID value will be used by the
-- service to confirm that the key exchange process was successful.
eirInitialEid :: Lens' EphemeralIdRegistration (Maybe ByteString)
eirInitialEid
= lens _eirInitialEid
(\ s a -> s{_eirInitialEid = a})
. mapping _Bytes | 516 | eirInitialEid :: Lens' EphemeralIdRegistration (Maybe ByteString)
eirInitialEid
= lens _eirInitialEid
(\ s a -> s{_eirInitialEid = a})
. mapping _Bytes | 165 | eirInitialEid
= lens _eirInitialEid
(\ s a -> s{_eirInitialEid = a})
. mapping _Bytes | 99 | true | true | 2 | 8 | 84 | 63 | 32 | 31 | null | null |
dsaenztagarro/haskellbook | src/chapter9/MyStandardFunctions.hs | bsd-3-clause | squishMap f (x:xs) = f x ++ squishMap f xs | 42 | squishMap f (x:xs) = f x ++ squishMap f xs | 42 | squishMap f (x:xs) = f x ++ squishMap f xs | 42 | false | false | 0 | 6 | 9 | 32 | 14 | 18 | null | null |
duboisf/hexif | src/Data/Exif/Parser.hs | bsd-3-clause | -- functions to simplify parsing expected bytes
satisfy :: (Show a, Eq a, Integral a) => String -> a -> a -> Parser a
satisfy desc expected actual =
if actual == expected
then return actual
else throwError (Unsatisfied errorMsg)
where
msgList = ["Expected", desc, expectedString, "got", toHex actual]
expectedString = "(" ++ toHex expected ++ ")"
errorMsg = unwords msgList | 397 | satisfy :: (Show a, Eq a, Integral a) => String -> a -> a -> Parser a
satisfy desc expected actual =
if actual == expected
then return actual
else throwError (Unsatisfied errorMsg)
where
msgList = ["Expected", desc, expectedString, "got", toHex actual]
expectedString = "(" ++ toHex expected ++ ")"
errorMsg = unwords msgList | 349 | satisfy desc expected actual =
if actual == expected
then return actual
else throwError (Unsatisfied errorMsg)
where
msgList = ["Expected", desc, expectedString, "got", toHex actual]
expectedString = "(" ++ toHex expected ++ ")"
errorMsg = unwords msgList | 279 | true | true | 0 | 9 | 84 | 133 | 68 | 65 | null | null |
uProxy/uproxy-idl-compiler | Parse/Pretty.hs | apache-2.0 | typeAnnotation :: Type -> Doc
typeAnnotation t = colon <+> _type t | 66 | typeAnnotation :: Type -> Doc
typeAnnotation t = colon <+> _type t | 66 | typeAnnotation t = colon <+> _type t | 36 | false | true | 0 | 6 | 11 | 25 | 12 | 13 | null | null |
joeyinbox/space-invaders-haskell | src/Attacker.hs | gpl-2.0 | -- (re-)Initialise the list of attackers position
resetAttackerPositionList :: [(Int, Position)]
resetAttackerPositionList = do
-- Horizontal positions
let x = (Prelude.map (+90) (Prelude.map (*60) [1..11])) ++ (Prelude.map (+85) (take 44 (cycle (Prelude.map (*60) [1..11]))))
-- Vertical positions
let y = (take 11 [160,160..]) ++ (take 11 [220,220..]) ++ (take 11 [280,280..]) ++ (take 11 [340,340..]) ++ (take 11 [400,400..])
-- Combine both x and y then map it to all identifiers
attackerIdList `zip` (addPosition x y)
-- (re-)Initialise attackers direction | 588 | resetAttackerPositionList :: [(Int, Position)]
resetAttackerPositionList = do
-- Horizontal positions
let x = (Prelude.map (+90) (Prelude.map (*60) [1..11])) ++ (Prelude.map (+85) (take 44 (cycle (Prelude.map (*60) [1..11]))))
-- Vertical positions
let y = (take 11 [160,160..]) ++ (take 11 [220,220..]) ++ (take 11 [280,280..]) ++ (take 11 [340,340..]) ++ (take 11 [400,400..])
-- Combine both x and y then map it to all identifiers
attackerIdList `zip` (addPosition x y)
-- (re-)Initialise attackers direction | 538 | resetAttackerPositionList = do
-- Horizontal positions
let x = (Prelude.map (+90) (Prelude.map (*60) [1..11])) ++ (Prelude.map (+85) (take 44 (cycle (Prelude.map (*60) [1..11]))))
-- Vertical positions
let y = (take 11 [160,160..]) ++ (take 11 [220,220..]) ++ (take 11 [280,280..]) ++ (take 11 [340,340..]) ++ (take 11 [400,400..])
-- Combine both x and y then map it to all identifiers
attackerIdList `zip` (addPosition x y)
-- (re-)Initialise attackers direction | 491 | true | true | 0 | 19 | 106 | 237 | 130 | 107 | null | null |
dermesser/Yadoku | sudoku9nd.hs | mit | putHelp = putStrLn "Usage: $ sudoku <9x9-system>" >> exitFailure | 64 | putHelp = putStrLn "Usage: $ sudoku <9x9-system>" >> exitFailure | 64 | putHelp = putStrLn "Usage: $ sudoku <9x9-system>" >> exitFailure | 64 | false | false | 0 | 6 | 8 | 13 | 6 | 7 | null | null |
giogadi/hs-motion-planning | lib-src/Planners/RRT.hs | mit | getInterp :: RRT s n -> s -> s -> Double -> s
getInterp = _interpolate . _space | 79 | getInterp :: RRT s n -> s -> s -> Double -> s
getInterp = _interpolate . _space | 79 | getInterp = _interpolate . _space | 33 | false | true | 0 | 8 | 17 | 36 | 18 | 18 | null | null |
zakharvoit/discrete-math-labs | Season2/PriorityQueues/IsHeap/IsHeap.hs | gpl-3.0 | boolYes False = "NO" | 20 | boolYes False = "NO" | 20 | boolYes False = "NO" | 20 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
scslab/iterIO | Examples/reliable/NetSim.hs | bsd-3-clause | reorderer :: Float -> NetSim a
reorderer prob = mkInumAutoM $ headLI >>= oldOrNew
where
oldOrNew old = do
new <- headLI
b <- liftI $ rndBoolI prob
if b then ifeed [old] >> oldOrNew new
else ifeed [new] >> oldOrNew old | 252 | reorderer :: Float -> NetSim a
reorderer prob = mkInumAutoM $ headLI >>= oldOrNew
where
oldOrNew old = do
new <- headLI
b <- liftI $ rndBoolI prob
if b then ifeed [old] >> oldOrNew new
else ifeed [new] >> oldOrNew old | 252 | reorderer prob = mkInumAutoM $ headLI >>= oldOrNew
where
oldOrNew old = do
new <- headLI
b <- liftI $ rndBoolI prob
if b then ifeed [old] >> oldOrNew new
else ifeed [new] >> oldOrNew old | 221 | false | true | 0 | 10 | 76 | 97 | 46 | 51 | null | null |
helino/wham | src/Wham/SignExc.hs | bsd-3-clause | Zero `div` NonZero = Zero | 25 | Zero `div` NonZero = Zero | 25 | Zero `div` NonZero = Zero | 25 | false | false | 0 | 5 | 4 | 14 | 7 | 7 | null | null |
mainland/nikola | tests/unit/Main.hs | bsd-3-clause | main :: IO ()
main = do
N.initializeCUDACtx
defaultMain tests | 66 | main :: IO ()
main = do
N.initializeCUDACtx
defaultMain tests | 66 | main = do
N.initializeCUDACtx
defaultMain tests | 52 | false | true | 0 | 8 | 14 | 33 | 13 | 20 | null | null |
hvr/hoopl | src/Compiler/Hoopl/Passes/Live.hs | bsd-3-clause | kill = foldVarsDefd delFromVarSet | 33 | kill = foldVarsDefd delFromVarSet | 33 | kill = foldVarsDefd delFromVarSet | 33 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
conal/TV | src/Interface/TV/TestAF.hs | bsd-3-clause | present' :: (Applicative f, Pair cof, Lambda f cof, Present f, Present cof) =>
Output' f cof a -> cof a
present' (OPrim' p) = p | 136 | present' :: (Applicative f, Pair cof, Lambda f cof, Present f, Present cof) =>
Output' f cof a -> cof a
present' (OPrim' p) = p | 135 | present' (OPrim' p) = p | 29 | false | true | 0 | 7 | 34 | 69 | 34 | 35 | null | null |
sdiehl/ghc | compiler/prelude/TysPrim.hs | bsd-3-clause | word8PrimTyCon :: TyCon
word8PrimTyCon = pcPrimTyCon0 word8PrimTyConName Word8Rep | 82 | word8PrimTyCon :: TyCon
word8PrimTyCon = pcPrimTyCon0 word8PrimTyConName Word8Rep | 82 | word8PrimTyCon = pcPrimTyCon0 word8PrimTyConName Word8Rep | 58 | false | true | 0 | 6 | 8 | 23 | 9 | 14 | null | null |
konn/konnfav | Settings.hs | bsd-2-clause | -- The rest of this file contains settings which rarely need changing by a
-- user.
-- The following three functions are used for calling HTML, CSS and
-- Javascript templates from your Haskell code. During development,
-- the "Debug" versions of these functions are used so that changes to
-- the templates are immediately reflected in an already running
-- application. When making a production compile, the non-debug version
-- is used for increased performance.
--
-- You can see an example of how to call these functions in Handler/Root.hs
--
-- Note: due to polymorphic Hamlet templates, hamletFileDebug is no longer
-- used; to get the same auto-loading effect, it is recommended that you
-- use the devel server.
toHamletFile, toCassiusFile, toJuliusFile :: String -> FilePath
toHamletFile x = "hamlet/" ++ x ++ ".hamlet" | 831 | toHamletFile, toCassiusFile, toJuliusFile :: String -> FilePath
toHamletFile x = "hamlet/" ++ x ++ ".hamlet" | 108 | toHamletFile x = "hamlet/" ++ x ++ ".hamlet" | 44 | true | true | 0 | 6 | 137 | 44 | 31 | 13 | null | null |
imuli/gitit | Network/Gitit/Handlers.hs | gpl-2.0 | showHistory :: String -> String -> Params -> Handler
showHistory file page params = do
fs <- getFileStore
hist <- liftIO $ history fs [file] (TimeRange Nothing Nothing)
(Just $ pLimit params)
base' <- getWikiBase
let versionToHtml rev pos = li ! [theclass "difflink", intAttr "order" pos,
strAttr "revision" (revId rev),
strAttr "diffurl" (base' ++ "/_diff/" ++ page)] <<
[ thespan ! [theclass "date"] << (show $ revDateTime rev)
, stringToHtml " ("
, thespan ! [theclass "author"] << anchor ! [href $ base' ++ "/_activity?" ++
urlEncodeVars [("forUser", authorName $ revAuthor rev)]] <<
(authorName $ revAuthor rev)
, stringToHtml "): "
, anchor ! [href (base' ++ urlForPage page ++ "?revision=" ++ revId rev)] <<
thespan ! [theclass "subject"] << revDescription rev
, noscript <<
([ stringToHtml " [compare with "
, anchor ! [href $ base' ++ "/_diff" ++ urlForPage page ++ "?to=" ++ revId rev] <<
"previous" ] ++
(if pos /= 1
then [ primHtmlChar "nbsp"
, primHtmlChar "bull"
, primHtmlChar "nbsp"
, anchor ! [href $ base' ++ "/_diff" ++ urlForPage page ++ "?from=" ++
revId rev] << "current"
]
else []) ++
[stringToHtml "]"])
]
let contents = if null hist
then noHtml
else ulist ! [theclass "history"] <<
zipWith versionToHtml hist
[length hist, (length hist - 1)..1]
let more = if length hist == pLimit params
then anchor ! [href $ base' ++ "/_history" ++ urlForPage page
++ "?limit=" ++ show (pLimit params + 100)] <<
"Show more..."
else noHtml
let tabs = if file == page -- source file, not wiki page
then [ViewTab,HistoryTab]
else pgTabs defaultPageLayout
formattedPage defaultPageLayout{
pgPageName = page,
pgMessages = pMessages params,
pgScripts = ["dragdiff.js"],
pgTabs = tabs,
pgSelectedTab = HistoryTab,
pgTitle = ("Changes to " ++ page)
} $ contents +++ more | 2,556 | showHistory :: String -> String -> Params -> Handler
showHistory file page params = do
fs <- getFileStore
hist <- liftIO $ history fs [file] (TimeRange Nothing Nothing)
(Just $ pLimit params)
base' <- getWikiBase
let versionToHtml rev pos = li ! [theclass "difflink", intAttr "order" pos,
strAttr "revision" (revId rev),
strAttr "diffurl" (base' ++ "/_diff/" ++ page)] <<
[ thespan ! [theclass "date"] << (show $ revDateTime rev)
, stringToHtml " ("
, thespan ! [theclass "author"] << anchor ! [href $ base' ++ "/_activity?" ++
urlEncodeVars [("forUser", authorName $ revAuthor rev)]] <<
(authorName $ revAuthor rev)
, stringToHtml "): "
, anchor ! [href (base' ++ urlForPage page ++ "?revision=" ++ revId rev)] <<
thespan ! [theclass "subject"] << revDescription rev
, noscript <<
([ stringToHtml " [compare with "
, anchor ! [href $ base' ++ "/_diff" ++ urlForPage page ++ "?to=" ++ revId rev] <<
"previous" ] ++
(if pos /= 1
then [ primHtmlChar "nbsp"
, primHtmlChar "bull"
, primHtmlChar "nbsp"
, anchor ! [href $ base' ++ "/_diff" ++ urlForPage page ++ "?from=" ++
revId rev] << "current"
]
else []) ++
[stringToHtml "]"])
]
let contents = if null hist
then noHtml
else ulist ! [theclass "history"] <<
zipWith versionToHtml hist
[length hist, (length hist - 1)..1]
let more = if length hist == pLimit params
then anchor ! [href $ base' ++ "/_history" ++ urlForPage page
++ "?limit=" ++ show (pLimit params + 100)] <<
"Show more..."
else noHtml
let tabs = if file == page -- source file, not wiki page
then [ViewTab,HistoryTab]
else pgTabs defaultPageLayout
formattedPage defaultPageLayout{
pgPageName = page,
pgMessages = pMessages params,
pgScripts = ["dragdiff.js"],
pgTabs = tabs,
pgSelectedTab = HistoryTab,
pgTitle = ("Changes to " ++ page)
} $ contents +++ more | 2,556 | showHistory file page params = do
fs <- getFileStore
hist <- liftIO $ history fs [file] (TimeRange Nothing Nothing)
(Just $ pLimit params)
base' <- getWikiBase
let versionToHtml rev pos = li ! [theclass "difflink", intAttr "order" pos,
strAttr "revision" (revId rev),
strAttr "diffurl" (base' ++ "/_diff/" ++ page)] <<
[ thespan ! [theclass "date"] << (show $ revDateTime rev)
, stringToHtml " ("
, thespan ! [theclass "author"] << anchor ! [href $ base' ++ "/_activity?" ++
urlEncodeVars [("forUser", authorName $ revAuthor rev)]] <<
(authorName $ revAuthor rev)
, stringToHtml "): "
, anchor ! [href (base' ++ urlForPage page ++ "?revision=" ++ revId rev)] <<
thespan ! [theclass "subject"] << revDescription rev
, noscript <<
([ stringToHtml " [compare with "
, anchor ! [href $ base' ++ "/_diff" ++ urlForPage page ++ "?to=" ++ revId rev] <<
"previous" ] ++
(if pos /= 1
then [ primHtmlChar "nbsp"
, primHtmlChar "bull"
, primHtmlChar "nbsp"
, anchor ! [href $ base' ++ "/_diff" ++ urlForPage page ++ "?from=" ++
revId rev] << "current"
]
else []) ++
[stringToHtml "]"])
]
let contents = if null hist
then noHtml
else ulist ! [theclass "history"] <<
zipWith versionToHtml hist
[length hist, (length hist - 1)..1]
let more = if length hist == pLimit params
then anchor ! [href $ base' ++ "/_history" ++ urlForPage page
++ "?limit=" ++ show (pLimit params + 100)] <<
"Show more..."
else noHtml
let tabs = if file == page -- source file, not wiki page
then [ViewTab,HistoryTab]
else pgTabs defaultPageLayout
formattedPage defaultPageLayout{
pgPageName = page,
pgMessages = pMessages params,
pgScripts = ["dragdiff.js"],
pgTabs = tabs,
pgSelectedTab = HistoryTab,
pgTitle = ("Changes to " ++ page)
} $ contents +++ more | 2,503 | false | true | 0 | 26 | 1,078 | 694 | 355 | 339 | null | null |
WraithM/network-bitcoin | src/Network/Bitcoin/Wallet.hs | bsd-3-clause | -- | List the amount received by each of our addresses, counting only
-- transactions with the given minimum number of confirmations.
listReceivedByAddress' :: Client
-> Int
-- ^ The minimum number of confirmations before a
-- transaction counts toward the total amount
-- received.
-> Bool
-- ^ Should we include addresses with no money
-- received?
-> IO (Vector ReceivedByAddress)
listReceivedByAddress' client minconf includeEmpty =
callApi client "listreceivedbyaddress" [ tj minconf, tj includeEmpty ] | 703 | listReceivedByAddress' :: Client
-> Int
-- ^ The minimum number of confirmations before a
-- transaction counts toward the total amount
-- received.
-> Bool
-- ^ Should we include addresses with no money
-- received?
-> IO (Vector ReceivedByAddress)
listReceivedByAddress' client minconf includeEmpty =
callApi client "listreceivedbyaddress" [ tj minconf, tj includeEmpty ] | 567 | listReceivedByAddress' client minconf includeEmpty =
callApi client "listreceivedbyaddress" [ tj minconf, tj includeEmpty ] | 127 | true | true | 0 | 11 | 271 | 71 | 36 | 35 | null | null |
kemskems/cis194-spring13 | src/HW04/HW04Tests.hs | bsd-3-clause | fun2 n
| even n = n + fun2 (n `div` 2)
| otherwise = fun2 (3 * n + 1) | 80 | fun2 n
| even n = n + fun2 (n `div` 2)
| otherwise = fun2 (3 * n + 1) | 80 | fun2 n
| even n = n + fun2 (n `div` 2)
| otherwise = fun2 (3 * n + 1) | 80 | false | false | 2 | 8 | 31 | 54 | 27 | 27 | null | null |
albertov/hs-mapnik | bindings/src/Mapnik/Bindings/Map.hs | bsd-3-clause | zoomToBox :: Map -> Box -> IO ()
zoomToBox m box = with box $ \boxPtr ->
[C.block|void {$fptr-ptr:(Map *m)->zoom_to_box(*$(bbox *boxPtr));}|] | 143 | zoomToBox :: Map -> Box -> IO ()
zoomToBox m box = with box $ \boxPtr ->
[C.block|void {$fptr-ptr:(Map *m)->zoom_to_box(*$(bbox *boxPtr));}|] | 143 | zoomToBox m box = with box $ \boxPtr ->
[C.block|void {$fptr-ptr:(Map *m)->zoom_to_box(*$(bbox *boxPtr));}|] | 110 | false | true | 0 | 8 | 22 | 47 | 25 | 22 | null | null |
tibbe/event | src/System/Event/IntMap.hs | bsd-2-clause | nomatch :: Key -> Prefix -> Mask -> Bool
nomatch i p m = (mask i m) /= p | 72 | nomatch :: Key -> Prefix -> Mask -> Bool
nomatch i p m = (mask i m) /= p | 72 | nomatch i p m = (mask i m) /= p | 31 | false | true | 0 | 7 | 18 | 42 | 21 | 21 | null | null |
mfpi/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Core31/Tokens.hs | bsd-3-clause | gl_UNSIGNED_INT_SAMPLER_BUFFER :: GLenum
gl_UNSIGNED_INT_SAMPLER_BUFFER = 0x8DD8 | 80 | gl_UNSIGNED_INT_SAMPLER_BUFFER :: GLenum
gl_UNSIGNED_INT_SAMPLER_BUFFER = 0x8DD8 | 80 | gl_UNSIGNED_INT_SAMPLER_BUFFER = 0x8DD8 | 39 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
maoe/hatena | src/Web/Hatena/Star.hs | bsd-3-clause | getStarCount :: (ResourceIO m, Failure HttpException m)
=> Ascii -> HatenaT noauth m StarCount
getStarCount uri = do
req <- lift $ parseUrl $ "http://s.hatena.ne.jp/blog.json/" ++ BS.unpack uri
json <- jsonResponse req
case A.fromJSON json of
A.Success count -> return count
A.Error reason -> fail reason | 332 | getStarCount :: (ResourceIO m, Failure HttpException m)
=> Ascii -> HatenaT noauth m StarCount
getStarCount uri = do
req <- lift $ parseUrl $ "http://s.hatena.ne.jp/blog.json/" ++ BS.unpack uri
json <- jsonResponse req
case A.fromJSON json of
A.Success count -> return count
A.Error reason -> fail reason | 332 | getStarCount uri = do
req <- lift $ parseUrl $ "http://s.hatena.ne.jp/blog.json/" ++ BS.unpack uri
json <- jsonResponse req
case A.fromJSON json of
A.Success count -> return count
A.Error reason -> fail reason | 224 | false | true | 0 | 11 | 73 | 116 | 53 | 63 | null | null |
markuspf/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | raw_unapply :: Raw -> (Raw, [Raw])
raw_unapply t = ua [] t where
ua args (RApp f a) = ua (a:args) f
ua args t = (t, args)
-- WELL TYPED TERMS --------------------------------------------------------- | 217 | raw_unapply :: Raw -> (Raw, [Raw])
raw_unapply t = ua [] t where
ua args (RApp f a) = ua (a:args) f
ua args t = (t, args)
-- WELL TYPED TERMS --------------------------------------------------------- | 217 | raw_unapply t = ua [] t where
ua args (RApp f a) = ua (a:args) f
ua args t = (t, args)
-- WELL TYPED TERMS --------------------------------------------------------- | 182 | false | true | 0 | 9 | 50 | 93 | 45 | 48 | null | null |
mstksg/hledger | bin/hledger-check.hs | gpl-3.0 | -- | Get the closing balances of every account referenced by a group
-- of postings.
closingBalances' :: [H.Posting] -> [(H.AccountName, H.MixedAmount)]
closingBalances' postings =
let postingsByAccount =
groupBy ((==) `on` H.paccount) . sortOn H.paccount $ postings
in map (\ps@(p:_) -> (H.paccount p, H.sumPostings ps)) postingsByAccount | 351 | closingBalances' :: [H.Posting] -> [(H.AccountName, H.MixedAmount)]
closingBalances' postings =
let postingsByAccount =
groupBy ((==) `on` H.paccount) . sortOn H.paccount $ postings
in map (\ps@(p:_) -> (H.paccount p, H.sumPostings ps)) postingsByAccount | 266 | closingBalances' postings =
let postingsByAccount =
groupBy ((==) `on` H.paccount) . sortOn H.paccount $ postings
in map (\ps@(p:_) -> (H.paccount p, H.sumPostings ps)) postingsByAccount | 198 | true | true | 0 | 14 | 57 | 117 | 64 | 53 | null | null |
siddhanathan/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | divIntegerIdKey = mkPreludeMiscIdUnique 81 | 56 | divIntegerIdKey = mkPreludeMiscIdUnique 81 | 56 | divIntegerIdKey = mkPreludeMiscIdUnique 81 | 56 | false | false | 0 | 5 | 17 | 9 | 4 | 5 | null | null |
garrettoreilly/doompiler | src/Parser.hs | mit | getOpenParen xs = Token Error "Error! Expected open paren, received " 0 0 : xs | 78 | getOpenParen xs = Token Error "Error! Expected open paren, received " 0 0 : xs | 78 | getOpenParen xs = Token Error "Error! Expected open paren, received " 0 0 : xs | 78 | false | false | 1 | 6 | 14 | 25 | 10 | 15 | null | null |
swift-nav/plover | src/Language/Plover/Convert.hs | mit | makeType :: Expr -> Either ConvertError T.Type
makeType exp@(PExpr pos e') = case e' of
Index a (PExpr _ (Tuple idxs)) -> T.VecType T.DenseMatrix <$> mapM makeExpr idxs <*> makeType a
Index a b -> T.VecType T.DenseMatrix <$> (return <$> makeExpr b) <*> makeType a
App (PExpr _ (Ref v)) args -> makeTypeFunc (makePos exp) v args
-- (no way to write the type of a function.)
Ref v -> case v of
"u8" -> return $ T.IntType T.U8
"s8" -> return $ T.IntType T.S8
"u16" -> return $ T.IntType T.U16
"s16" -> return $ T.IntType T.S16
"u32" -> return $ T.IntType T.U32
"s32" -> return $ T.IntType T.S32
"u64" -> return $ T.IntType T.U64
"s64" -> return $ T.IntType T.S64
"int" -> return $ T.IntType T.defaultIntType
"float" -> return $ T.FloatType T.Float
"double" -> return $ T.FloatType T.Double
"string" -> return $ T.StringType
"bool" -> return $ T.BoolType
_ -> return $ T.TypedefType (T.TypeHole Nothing) v
UnExpr Deref a -> T.PtrType <$> makeType a
Tuple xs -> T.TupleType <$> mapM makeType xs
Hole -> return $ T.TypeHole Nothing
NoisyHole -> return $ T.NoisyTypeHole pos
_ -> Left $ ConvertError (makePos exp) ["Expecting type"] | 1,201 | makeType :: Expr -> Either ConvertError T.Type
makeType exp@(PExpr pos e') = case e' of
Index a (PExpr _ (Tuple idxs)) -> T.VecType T.DenseMatrix <$> mapM makeExpr idxs <*> makeType a
Index a b -> T.VecType T.DenseMatrix <$> (return <$> makeExpr b) <*> makeType a
App (PExpr _ (Ref v)) args -> makeTypeFunc (makePos exp) v args
-- (no way to write the type of a function.)
Ref v -> case v of
"u8" -> return $ T.IntType T.U8
"s8" -> return $ T.IntType T.S8
"u16" -> return $ T.IntType T.U16
"s16" -> return $ T.IntType T.S16
"u32" -> return $ T.IntType T.U32
"s32" -> return $ T.IntType T.S32
"u64" -> return $ T.IntType T.U64
"s64" -> return $ T.IntType T.S64
"int" -> return $ T.IntType T.defaultIntType
"float" -> return $ T.FloatType T.Float
"double" -> return $ T.FloatType T.Double
"string" -> return $ T.StringType
"bool" -> return $ T.BoolType
_ -> return $ T.TypedefType (T.TypeHole Nothing) v
UnExpr Deref a -> T.PtrType <$> makeType a
Tuple xs -> T.TupleType <$> mapM makeType xs
Hole -> return $ T.TypeHole Nothing
NoisyHole -> return $ T.NoisyTypeHole pos
_ -> Left $ ConvertError (makePos exp) ["Expecting type"] | 1,201 | makeType exp@(PExpr pos e') = case e' of
Index a (PExpr _ (Tuple idxs)) -> T.VecType T.DenseMatrix <$> mapM makeExpr idxs <*> makeType a
Index a b -> T.VecType T.DenseMatrix <$> (return <$> makeExpr b) <*> makeType a
App (PExpr _ (Ref v)) args -> makeTypeFunc (makePos exp) v args
-- (no way to write the type of a function.)
Ref v -> case v of
"u8" -> return $ T.IntType T.U8
"s8" -> return $ T.IntType T.S8
"u16" -> return $ T.IntType T.U16
"s16" -> return $ T.IntType T.S16
"u32" -> return $ T.IntType T.U32
"s32" -> return $ T.IntType T.S32
"u64" -> return $ T.IntType T.U64
"s64" -> return $ T.IntType T.S64
"int" -> return $ T.IntType T.defaultIntType
"float" -> return $ T.FloatType T.Float
"double" -> return $ T.FloatType T.Double
"string" -> return $ T.StringType
"bool" -> return $ T.BoolType
_ -> return $ T.TypedefType (T.TypeHole Nothing) v
UnExpr Deref a -> T.PtrType <$> makeType a
Tuple xs -> T.TupleType <$> mapM makeType xs
Hole -> return $ T.TypeHole Nothing
NoisyHole -> return $ T.NoisyTypeHole pos
_ -> Left $ ConvertError (makePos exp) ["Expecting type"] | 1,154 | false | true | 76 | 9 | 269 | 492 | 247 | 245 | null | null |
diku-dk/futhark | src/Futhark/Optimise/Simplify/Engine.hs | isc | simplifyExp _ _ (Op op) = do
(op', stms) <- simplifyOp op
return (Op op', stms) | 83 | simplifyExp _ _ (Op op) = do
(op', stms) <- simplifyOp op
return (Op op', stms) | 83 | simplifyExp _ _ (Op op) = do
(op', stms) <- simplifyOp op
return (Op op', stms) | 83 | false | false | 0 | 9 | 19 | 50 | 24 | 26 | null | null |
Cordite-Studios/asteroid-core | src/Solar/Asteroid/Core/Valuable/Derive.hs | mit | deriveBinaryFromText :: Name -> Name -> Q [Dec]
deriveBinaryFromText val err = [d|
instance BinaryValuable $(conT val) $(conT err) where
encodeAsByteString = swapTextToByteString . encodeAsText
decodeFromByteString = decodeFromText . swapByteStringToText
|] | 281 | deriveBinaryFromText :: Name -> Name -> Q [Dec]
deriveBinaryFromText val err = [d|
instance BinaryValuable $(conT val) $(conT err) where
encodeAsByteString = swapTextToByteString . encodeAsText
decodeFromByteString = decodeFromText . swapByteStringToText
|] | 281 | deriveBinaryFromText val err = [d|
instance BinaryValuable $(conT val) $(conT err) where
encodeAsByteString = swapTextToByteString . encodeAsText
decodeFromByteString = decodeFromText . swapByteStringToText
|] | 233 | false | true | 0 | 8 | 54 | 34 | 19 | 15 | null | null |
phischu/fragnix | tests/packages/scotty/Network.Wai.Handler.Warp.Request.hs | bsd-3-clause | recvRequest :: Bool -- ^ first request on this connection?
-> Settings
-> Connection
-> InternalInfo1
-> SockAddr -- ^ Peer's address.
-> Source -- ^ Where HTTP request comes from.
-> IO (Request
,Maybe (I.IORef Int)
,IndexedHeader
,IO ByteString
,InternalInfo) -- ^
-- 'Request' passed to 'Application',
-- how many bytes remain to be consumed, if known
-- 'IndexedHeader' of HTTP request for internal use,
-- Body producing action used for flushing the request body
recvRequest firstRequest settings conn ii1 addr src = do
hdrlines <- headerLines firstRequest src
(method, unparsedPath, path, query, httpversion, hdr) <- parseHeaderLines hdrlines
let idxhdr = indexRequestHeader hdr
expect = idxhdr ! fromEnum ReqExpect
cl = idxhdr ! fromEnum ReqContentLength
te = idxhdr ! fromEnum ReqTransferEncoding
handle100Continue = handleExpect conn httpversion expect
rawPath = if settingsNoParsePath settings then unparsedPath else path
h = hashByteString rawPath
ii = toInternalInfo ii1 h
th = threadHandle ii
vaultValue = Vault.insert pauseTimeoutKey (Timeout.pause th)
$ Vault.insert getFileInfoKey (getFileInfo ii)
Vault.empty
(rbody, remainingRef, bodyLength) <- bodyAndSource src cl te
-- body producing function which will produce '100-continue', if needed
rbody' <- timeoutBody remainingRef th rbody handle100Continue
-- body producing function which will never produce 100-continue
rbodyFlush <- timeoutBody remainingRef th rbody (return ())
let req = Request {
requestMethod = method
, httpVersion = httpversion
, pathInfo = H.decodePathSegments path
, rawPathInfo = rawPath
, rawQueryString = query
, queryString = H.parseQuery query
, requestHeaders = hdr
, isSecure = False
, remoteHost = addr
, requestBody = rbody'
, vault = vaultValue
, requestBodyLength = bodyLength
, requestHeaderHost = idxhdr ! fromEnum ReqHost
, requestHeaderRange = idxhdr ! fromEnum ReqRange
, requestHeaderReferer = idxhdr ! fromEnum ReqReferer
, requestHeaderUserAgent = idxhdr ! fromEnum ReqUserAgent
}
return (req, remainingRef, idxhdr, rbodyFlush, ii)
---------------------------------------------------------------- | 2,706 | recvRequest :: Bool -- ^ first request on this connection?
-> Settings
-> Connection
-> InternalInfo1
-> SockAddr -- ^ Peer's address.
-> Source -- ^ Where HTTP request comes from.
-> IO (Request
,Maybe (I.IORef Int)
,IndexedHeader
,IO ByteString
,InternalInfo)
recvRequest firstRequest settings conn ii1 addr src = do
hdrlines <- headerLines firstRequest src
(method, unparsedPath, path, query, httpversion, hdr) <- parseHeaderLines hdrlines
let idxhdr = indexRequestHeader hdr
expect = idxhdr ! fromEnum ReqExpect
cl = idxhdr ! fromEnum ReqContentLength
te = idxhdr ! fromEnum ReqTransferEncoding
handle100Continue = handleExpect conn httpversion expect
rawPath = if settingsNoParsePath settings then unparsedPath else path
h = hashByteString rawPath
ii = toInternalInfo ii1 h
th = threadHandle ii
vaultValue = Vault.insert pauseTimeoutKey (Timeout.pause th)
$ Vault.insert getFileInfoKey (getFileInfo ii)
Vault.empty
(rbody, remainingRef, bodyLength) <- bodyAndSource src cl te
-- body producing function which will produce '100-continue', if needed
rbody' <- timeoutBody remainingRef th rbody handle100Continue
-- body producing function which will never produce 100-continue
rbodyFlush <- timeoutBody remainingRef th rbody (return ())
let req = Request {
requestMethod = method
, httpVersion = httpversion
, pathInfo = H.decodePathSegments path
, rawPathInfo = rawPath
, rawQueryString = query
, queryString = H.parseQuery query
, requestHeaders = hdr
, isSecure = False
, remoteHost = addr
, requestBody = rbody'
, vault = vaultValue
, requestBodyLength = bodyLength
, requestHeaderHost = idxhdr ! fromEnum ReqHost
, requestHeaderRange = idxhdr ! fromEnum ReqRange
, requestHeaderReferer = idxhdr ! fromEnum ReqReferer
, requestHeaderUserAgent = idxhdr ! fromEnum ReqUserAgent
}
return (req, remainingRef, idxhdr, rbodyFlush, ii)
---------------------------------------------------------------- | 2,451 | recvRequest firstRequest settings conn ii1 addr src = do
hdrlines <- headerLines firstRequest src
(method, unparsedPath, path, query, httpversion, hdr) <- parseHeaderLines hdrlines
let idxhdr = indexRequestHeader hdr
expect = idxhdr ! fromEnum ReqExpect
cl = idxhdr ! fromEnum ReqContentLength
te = idxhdr ! fromEnum ReqTransferEncoding
handle100Continue = handleExpect conn httpversion expect
rawPath = if settingsNoParsePath settings then unparsedPath else path
h = hashByteString rawPath
ii = toInternalInfo ii1 h
th = threadHandle ii
vaultValue = Vault.insert pauseTimeoutKey (Timeout.pause th)
$ Vault.insert getFileInfoKey (getFileInfo ii)
Vault.empty
(rbody, remainingRef, bodyLength) <- bodyAndSource src cl te
-- body producing function which will produce '100-continue', if needed
rbody' <- timeoutBody remainingRef th rbody handle100Continue
-- body producing function which will never produce 100-continue
rbodyFlush <- timeoutBody remainingRef th rbody (return ())
let req = Request {
requestMethod = method
, httpVersion = httpversion
, pathInfo = H.decodePathSegments path
, rawPathInfo = rawPath
, rawQueryString = query
, queryString = H.parseQuery query
, requestHeaders = hdr
, isSecure = False
, remoteHost = addr
, requestBody = rbody'
, vault = vaultValue
, requestBodyLength = bodyLength
, requestHeaderHost = idxhdr ! fromEnum ReqHost
, requestHeaderRange = idxhdr ! fromEnum ReqRange
, requestHeaderReferer = idxhdr ! fromEnum ReqReferer
, requestHeaderUserAgent = idxhdr ! fromEnum ReqUserAgent
}
return (req, remainingRef, idxhdr, rbodyFlush, ii)
---------------------------------------------------------------- | 2,045 | true | true | 0 | 16 | 893 | 503 | 271 | 232 | null | null |
roelvandijk/numerals-base | src/Text/Numeral/BigNum.hs | bsd-3-clause | quantityName ∷ s → s → PostfixRepr i s
quantityName s p _ ctx =
case ctx of
CtxMul _ (Lit 1) _ → s
CtxMul {} → p
_ → s | 166 | quantityName ∷ s → s → PostfixRepr i s
quantityName s p _ ctx =
case ctx of
CtxMul _ (Lit 1) _ → s
CtxMul {} → p
_ → s | 166 | quantityName s p _ ctx =
case ctx of
CtxMul _ (Lit 1) _ → s
CtxMul {} → p
_ → s | 127 | false | true | 0 | 10 | 79 | 77 | 36 | 41 | null | null |
ezyang/ghc | compiler/coreSyn/CoreSubst.hs | bsd-3-clause | substUnfolding subst df@(DFunUnfolding { df_bndrs = bndrs, df_args = args })
= df { df_bndrs = bndrs', df_args = args' }
where
(subst',bndrs') = substBndrs subst bndrs
args' = map (substExpr (text "subst-unf:dfun") subst') args | 249 | substUnfolding subst df@(DFunUnfolding { df_bndrs = bndrs, df_args = args })
= df { df_bndrs = bndrs', df_args = args' }
where
(subst',bndrs') = substBndrs subst bndrs
args' = map (substExpr (text "subst-unf:dfun") subst') args | 249 | substUnfolding subst df@(DFunUnfolding { df_bndrs = bndrs, df_args = args })
= df { df_bndrs = bndrs', df_args = args' }
where
(subst',bndrs') = substBndrs subst bndrs
args' = map (substExpr (text "subst-unf:dfun") subst') args | 249 | false | false | 8 | 9 | 56 | 107 | 50 | 57 | null | null |
vikraman/ghc | compiler/simplCore/CoreMonad.hs | bsd-3-clause | cmpEqTick (EtaReduction a) (EtaReduction b) = a `compare` b | 87 | cmpEqTick (EtaReduction a) (EtaReduction b) = a `compare` b | 87 | cmpEqTick (EtaReduction a) (EtaReduction b) = a `compare` b | 87 | false | false | 1 | 8 | 36 | 33 | 15 | 18 | null | null |
zaxtax/hakaru | haskell/Examples/Slam.hs | bsd-3-clause | -- ^ <L,H,a,b>
dimL, dimH, dimA, dimB :: (Base repr) => repr Dims -> repr H.Real
dimL v = H.index v 0 | 102 | dimL, dimH, dimA, dimB :: (Base repr) => repr Dims -> repr H.Real
dimL v = H.index v 0 | 86 | dimL v = H.index v 0 | 20 | true | true | 0 | 8 | 22 | 49 | 27 | 22 | null | null |
k-bx/snap-server | src/Snap/Internal/Http/Server/Parser.hs | bsd-3-clause | methodFromString "CONNECT" = CONNECT | 36 | methodFromString "CONNECT" = CONNECT | 36 | methodFromString "CONNECT" = CONNECT | 36 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
seereason/cabal | Cabal/Distribution/PackageDescription/Parse.hs | bsd-3-clause | stanzas :: [Field] -> [[Field]]
stanzas [] = [] | 47 | stanzas :: [Field] -> [[Field]]
stanzas [] = [] | 47 | stanzas [] = [] | 15 | false | true | 0 | 7 | 8 | 31 | 17 | 14 | null | null |
nushio3/ghc | utils/genprimopcode/Main.hs | bsd-3-clause | ppType (TyApp (TyCon "ArrayArray#") []) = "mkArrayArrayPrimTy" | 70 | ppType (TyApp (TyCon "ArrayArray#") []) = "mkArrayArrayPrimTy" | 70 | ppType (TyApp (TyCon "ArrayArray#") []) = "mkArrayArrayPrimTy" | 70 | false | false | 0 | 8 | 14 | 26 | 12 | 14 | null | null |
snoyberg/ghc | compiler/main/HscTypes.hs | bsd-3-clause | typeEnvDataCons env = [dc | AConLike (RealDataCon dc) <- typeEnvElts env] | 73 | typeEnvDataCons env = [dc | AConLike (RealDataCon dc) <- typeEnvElts env] | 73 | typeEnvDataCons env = [dc | AConLike (RealDataCon dc) <- typeEnvElts env] | 73 | false | false | 1 | 11 | 10 | 36 | 15 | 21 | null | null |
plietar/super-user-spark | src/Deployer.hs | mit | catErrors (s:ss) = case s of
Ready _ _ _ -> catErrors ss
AlreadyDone -> catErrors ss
Error str -> str : catErrors ss | 178 | catErrors (s:ss) = case s of
Ready _ _ _ -> catErrors ss
AlreadyDone -> catErrors ss
Error str -> str : catErrors ss | 178 | catErrors (s:ss) = case s of
Ready _ _ _ -> catErrors ss
AlreadyDone -> catErrors ss
Error str -> str : catErrors ss | 178 | false | false | 0 | 9 | 85 | 61 | 28 | 33 | null | null |
pascal-knodel/haskell-craft | _/links/E'4'37.hs | mit | testHowManyAboveAverage4 = TestCase ( assertEqual "for: howManyAboveAverage 0 1 2" 1 (howManyAboveAverage 0 1 2) ) | 115 | testHowManyAboveAverage4 = TestCase ( assertEqual "for: howManyAboveAverage 0 1 2" 1 (howManyAboveAverage 0 1 2) ) | 115 | testHowManyAboveAverage4 = TestCase ( assertEqual "for: howManyAboveAverage 0 1 2" 1 (howManyAboveAverage 0 1 2) ) | 115 | false | false | 0 | 9 | 16 | 29 | 14 | 15 | null | null |
oldmanmike/ghc | compiler/typecheck/TcEvidence.hs | bsd-3-clause | mk_co_app_fn :: (a -> HsWrapper) -> [a] -> HsWrapper
-- For applications, the *first* argument must
-- come *last* in the composition sequence
mk_co_app_fn f as = foldr (\x wrap -> wrap <.> f x) WpHole as | 204 | mk_co_app_fn :: (a -> HsWrapper) -> [a] -> HsWrapper
mk_co_app_fn f as = foldr (\x wrap -> wrap <.> f x) WpHole as | 114 | mk_co_app_fn f as = foldr (\x wrap -> wrap <.> f x) WpHole as | 61 | true | true | 0 | 9 | 36 | 60 | 32 | 28 | null | null |
stevejb71/xhaskell | custom-set/example.hs | mit | member x (Bin _s a l r) = case x `compare` a of
LT -> member x l
GT -> member x r
EQ -> True | 98 | member x (Bin _s a l r) = case x `compare` a of
LT -> member x l
GT -> member x r
EQ -> True | 98 | member x (Bin _s a l r) = case x `compare` a of
LT -> member x l
GT -> member x r
EQ -> True | 98 | false | false | 3 | 7 | 31 | 64 | 30 | 34 | null | null |
mikeplus64/Level-0 | src/Utils.hs | gpl-3.0 | while3 :: IO a -> (a -> Ternary) -> IO Bool
while3 action check = do
result <- action
case check result of
A -> return False
B -> return True
C -> while3 action check | 198 | while3 :: IO a -> (a -> Ternary) -> IO Bool
while3 action check = do
result <- action
case check result of
A -> return False
B -> return True
C -> while3 action check | 198 | while3 action check = do
result <- action
case check result of
A -> return False
B -> return True
C -> while3 action check | 154 | false | true | 0 | 10 | 67 | 83 | 38 | 45 | null | null |
sopvop/cabal | cabal-install/Distribution/Client/Setup.hs | bsd-3-clause | getCommand :: CommandUI GetFlags
getCommand = CommandUI {
commandName = "get",
commandSynopsis = "Download/Extract a package's source code (repository).",
commandDescription = Just $ \_ -> wrapText $
"Creates a local copy of a package's source code. By default it gets "
++ "the source\ntarball and unpacks it in a local subdirectory. "
++ "Alternatively, with -s it will\nget the code from the source "
++ "repository specified by the package.\n",
commandNotes = Just $ \pname ->
"Examples:\n"
++ " " ++ pname ++ " get hlint\n"
++ " Download the latest stable version of hlint;\n"
++ " " ++ pname ++ " get lens --source-repository=head\n"
++ " Download the source repository (i.e. git clone from github).\n",
commandUsage = usagePackages "get",
commandDefaultFlags = defaultGetFlags,
commandOptions = \_ -> [
optionVerbosity getVerbosity (\v flags -> flags { getVerbosity = v })
,option "d" ["destdir"]
"Where to place the package source, defaults to the current directory."
getDestDir (\v flags -> flags { getDestDir = v })
(reqArgFlag "PATH")
,option "s" ["source-repository"]
"Copy the package's source repository (ie git clone, darcs get, etc as appropriate)."
getSourceRepository (\v flags -> flags { getSourceRepository = v })
(optArg "[head|this|...]" (readP_to_E (const "invalid source-repository")
(fmap (toFlag . Just) parse))
(Flag Nothing)
(map (fmap show) . flagToList))
, option [] ["pristine"]
("Unpack the original pristine tarball, rather than updating the "
++ ".cabal file with the latest revision from the package archive.")
getPristine (\v flags -> flags { getPristine = v })
trueArg
]
} | 1,998 | getCommand :: CommandUI GetFlags
getCommand = CommandUI {
commandName = "get",
commandSynopsis = "Download/Extract a package's source code (repository).",
commandDescription = Just $ \_ -> wrapText $
"Creates a local copy of a package's source code. By default it gets "
++ "the source\ntarball and unpacks it in a local subdirectory. "
++ "Alternatively, with -s it will\nget the code from the source "
++ "repository specified by the package.\n",
commandNotes = Just $ \pname ->
"Examples:\n"
++ " " ++ pname ++ " get hlint\n"
++ " Download the latest stable version of hlint;\n"
++ " " ++ pname ++ " get lens --source-repository=head\n"
++ " Download the source repository (i.e. git clone from github).\n",
commandUsage = usagePackages "get",
commandDefaultFlags = defaultGetFlags,
commandOptions = \_ -> [
optionVerbosity getVerbosity (\v flags -> flags { getVerbosity = v })
,option "d" ["destdir"]
"Where to place the package source, defaults to the current directory."
getDestDir (\v flags -> flags { getDestDir = v })
(reqArgFlag "PATH")
,option "s" ["source-repository"]
"Copy the package's source repository (ie git clone, darcs get, etc as appropriate)."
getSourceRepository (\v flags -> flags { getSourceRepository = v })
(optArg "[head|this|...]" (readP_to_E (const "invalid source-repository")
(fmap (toFlag . Just) parse))
(Flag Nothing)
(map (fmap show) . flagToList))
, option [] ["pristine"]
("Unpack the original pristine tarball, rather than updating the "
++ ".cabal file with the latest revision from the package archive.")
getPristine (\v flags -> flags { getPristine = v })
trueArg
]
} | 1,998 | getCommand = CommandUI {
commandName = "get",
commandSynopsis = "Download/Extract a package's source code (repository).",
commandDescription = Just $ \_ -> wrapText $
"Creates a local copy of a package's source code. By default it gets "
++ "the source\ntarball and unpacks it in a local subdirectory. "
++ "Alternatively, with -s it will\nget the code from the source "
++ "repository specified by the package.\n",
commandNotes = Just $ \pname ->
"Examples:\n"
++ " " ++ pname ++ " get hlint\n"
++ " Download the latest stable version of hlint;\n"
++ " " ++ pname ++ " get lens --source-repository=head\n"
++ " Download the source repository (i.e. git clone from github).\n",
commandUsage = usagePackages "get",
commandDefaultFlags = defaultGetFlags,
commandOptions = \_ -> [
optionVerbosity getVerbosity (\v flags -> flags { getVerbosity = v })
,option "d" ["destdir"]
"Where to place the package source, defaults to the current directory."
getDestDir (\v flags -> flags { getDestDir = v })
(reqArgFlag "PATH")
,option "s" ["source-repository"]
"Copy the package's source repository (ie git clone, darcs get, etc as appropriate)."
getSourceRepository (\v flags -> flags { getSourceRepository = v })
(optArg "[head|this|...]" (readP_to_E (const "invalid source-repository")
(fmap (toFlag . Just) parse))
(Flag Nothing)
(map (fmap show) . flagToList))
, option [] ["pristine"]
("Unpack the original pristine tarball, rather than updating the "
++ ".cabal file with the latest revision from the package archive.")
getPristine (\v flags -> flags { getPristine = v })
trueArg
]
} | 1,965 | false | true | 0 | 17 | 635 | 347 | 192 | 155 | null | null |
ctford/Idris-Elba-dev | src/Idris/ParseHelpers.hs | bsd-3-clause | {- * Symbols, identifiers, names and operators -}
-- | Idris Style for parsing identifiers/reserved keywords
idrisStyle :: MonadicParsing m => IdentifierStyle m
idrisStyle = IdentifierStyle _styleName _styleStart _styleLetter _styleReserved Hi.Identifier Hi.ReservedIdentifier
where _styleName = "Idris"
_styleStart = satisfy isAlpha
_styleLetter = satisfy isAlphaNum <|> oneOf "_'" <|> (lchar '.')
_styleReserved = HS.fromList ["let", "in", "data", "codata", "record", "Type",
"do", "dsl", "import", "impossible",
"case", "of", "total", "partial", "mutual",
"infix", "infixl", "infixr", "rewrite",
"where", "with", "syntax", "proof", "postulate",
"using", "namespace", "class", "instance", "parameters",
"public", "private", "abstract", "implicit",
"quoteGoal"] | 1,056 | idrisStyle :: MonadicParsing m => IdentifierStyle m
idrisStyle = IdentifierStyle _styleName _styleStart _styleLetter _styleReserved Hi.Identifier Hi.ReservedIdentifier
where _styleName = "Idris"
_styleStart = satisfy isAlpha
_styleLetter = satisfy isAlphaNum <|> oneOf "_'" <|> (lchar '.')
_styleReserved = HS.fromList ["let", "in", "data", "codata", "record", "Type",
"do", "dsl", "import", "impossible",
"case", "of", "total", "partial", "mutual",
"infix", "infixl", "infixr", "rewrite",
"where", "with", "syntax", "proof", "postulate",
"using", "namespace", "class", "instance", "parameters",
"public", "private", "abstract", "implicit",
"quoteGoal"] | 945 | idrisStyle = IdentifierStyle _styleName _styleStart _styleLetter _styleReserved Hi.Identifier Hi.ReservedIdentifier
where _styleName = "Idris"
_styleStart = satisfy isAlpha
_styleLetter = satisfy isAlphaNum <|> oneOf "_'" <|> (lchar '.')
_styleReserved = HS.fromList ["let", "in", "data", "codata", "record", "Type",
"do", "dsl", "import", "impossible",
"case", "of", "total", "partial", "mutual",
"infix", "infixl", "infixr", "rewrite",
"where", "with", "syntax", "proof", "postulate",
"using", "namespace", "class", "instance", "parameters",
"public", "private", "abstract", "implicit",
"quoteGoal"] | 893 | true | true | 3 | 8 | 380 | 195 | 113 | 82 | null | null |
codemac/yi-editor | src/Yi/Syntax/Haskell.hs | gpl-2.0 | -- | Parse an expression, as a concatenation of elements.
pExprOrPattern :: Bool -> [Token] -> Parser TT [Exp TT]
pExprOrPattern isExpresssion at = pure []
<|> ((:) <$> pElem isExpresssion at <*> pExprOrPattern True at)
<|> ((:) <$> (TS <$> exact [ReservedOp DoubleColon] <*> pTypeExpr') <*> pure []) | 323 | pExprOrPattern :: Bool -> [Token] -> Parser TT [Exp TT]
pExprOrPattern isExpresssion at = pure []
<|> ((:) <$> pElem isExpresssion at <*> pExprOrPattern True at)
<|> ((:) <$> (TS <$> exact [ReservedOp DoubleColon] <*> pTypeExpr') <*> pure []) | 265 | pExprOrPattern isExpresssion at = pure []
<|> ((:) <$> pElem isExpresssion at <*> pExprOrPattern True at)
<|> ((:) <$> (TS <$> exact [ReservedOp DoubleColon] <*> pTypeExpr') <*> pure []) | 209 | true | true | 6 | 14 | 71 | 124 | 63 | 61 | null | null |
rueshyna/gogol | gogol-debugger/gen/Network/Google/Resource/CloudDebugger/Controller/Debuggees/Breakpoints/Update.hs | mpl-2.0 | -- | Identifies the debuggee being debugged.
cdbuDebuggeeId :: Lens' ControllerDebuggeesBreakpointsUpdate Text
cdbuDebuggeeId
= lens _cdbuDebuggeeId
(\ s a -> s{_cdbuDebuggeeId = a}) | 190 | cdbuDebuggeeId :: Lens' ControllerDebuggeesBreakpointsUpdate Text
cdbuDebuggeeId
= lens _cdbuDebuggeeId
(\ s a -> s{_cdbuDebuggeeId = a}) | 145 | cdbuDebuggeeId
= lens _cdbuDebuggeeId
(\ s a -> s{_cdbuDebuggeeId = a}) | 79 | true | true | 0 | 9 | 30 | 42 | 22 | 20 | null | null |
denisenkom/hspkcs11 | src/System/Crypto/Pkcs11.hs | mit | _findObjectsFinalEx :: Session -> IO ()
_findObjectsFinalEx (Session sessionHandle functionListPtr) = do
rv <- findObjectsFinal' functionListPtr sessionHandle
when (rv /= 0) $ fail $ "failed to finalize search: " ++ rvToStr rv
-- | Searches current session for objects matching provided attributes list, returns a list of matching object handles | 350 | _findObjectsFinalEx :: Session -> IO ()
_findObjectsFinalEx (Session sessionHandle functionListPtr) = do
rv <- findObjectsFinal' functionListPtr sessionHandle
when (rv /= 0) $ fail $ "failed to finalize search: " ++ rvToStr rv
-- | Searches current session for objects matching provided attributes list, returns a list of matching object handles | 350 | _findObjectsFinalEx (Session sessionHandle functionListPtr) = do
rv <- findObjectsFinal' functionListPtr sessionHandle
when (rv /= 0) $ fail $ "failed to finalize search: " ++ rvToStr rv
-- | Searches current session for objects matching provided attributes list, returns a list of matching object handles | 310 | false | true | 0 | 12 | 54 | 72 | 34 | 38 | null | null |
tjakway/ghcjvm | compiler/utils/Util.hs | bsd-3-clause | seqList :: [a] -> b -> b
seqList [] b = b | 41 | seqList :: [a] -> b -> b
seqList [] b = b | 41 | seqList [] b = b | 16 | false | true | 0 | 9 | 11 | 35 | 16 | 19 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/utils/Pretty.hs | bsd-3-clause | nonEmptySet _ = panic "nonEmptySet: Unhandled case" | 68 | nonEmptySet _ = panic "nonEmptySet: Unhandled case" | 68 | nonEmptySet _ = panic "nonEmptySet: Unhandled case" | 68 | false | false | 0 | 5 | 23 | 12 | 5 | 7 | null | null |
philopon/hassistant.vim | src/library.hs | bsd-3-clause | gatherNamesInModule :: CString -> IO CString
gatherNamesInModule query = do
lbs <- (T.lines <$> unsafePackCStringToText query) >>= \case
[file, mdl] -> Json.encode . concatMap cand <$>
listNamesInModule (P.fromText file) mdl `catch` (\(_::SomeException) -> return [])
_ -> return $ Json.encode ([] :: [Json.Value])
newCStringFromBS $ L.toStrict lbs
where
wkm w k m = (candidate $ T.pack w) { kind = Just $ T.pack k, menu = Just m }
ppDC s = '(' : (intercalate "," s) ++ ")"
cand (Var n t ) = [wkm n t "Function"]
cand (Constructor t ds) = wkm t (ppDC $ map fst ds) "TyCon" :
map (\(d,_) -> wkm d t "DataCon") ds
cand (Class c ms) = wkm c (ppDC $ map fst ms) "Class" :
map (\(d,t) -> wkm d t (T.pack c)) ms | 850 | gatherNamesInModule :: CString -> IO CString
gatherNamesInModule query = do
lbs <- (T.lines <$> unsafePackCStringToText query) >>= \case
[file, mdl] -> Json.encode . concatMap cand <$>
listNamesInModule (P.fromText file) mdl `catch` (\(_::SomeException) -> return [])
_ -> return $ Json.encode ([] :: [Json.Value])
newCStringFromBS $ L.toStrict lbs
where
wkm w k m = (candidate $ T.pack w) { kind = Just $ T.pack k, menu = Just m }
ppDC s = '(' : (intercalate "," s) ++ ")"
cand (Var n t ) = [wkm n t "Function"]
cand (Constructor t ds) = wkm t (ppDC $ map fst ds) "TyCon" :
map (\(d,_) -> wkm d t "DataCon") ds
cand (Class c ms) = wkm c (ppDC $ map fst ms) "Class" :
map (\(d,t) -> wkm d t (T.pack c)) ms | 850 | gatherNamesInModule query = do
lbs <- (T.lines <$> unsafePackCStringToText query) >>= \case
[file, mdl] -> Json.encode . concatMap cand <$>
listNamesInModule (P.fromText file) mdl `catch` (\(_::SomeException) -> return [])
_ -> return $ Json.encode ([] :: [Json.Value])
newCStringFromBS $ L.toStrict lbs
where
wkm w k m = (candidate $ T.pack w) { kind = Just $ T.pack k, menu = Just m }
ppDC s = '(' : (intercalate "," s) ++ ")"
cand (Var n t ) = [wkm n t "Function"]
cand (Constructor t ds) = wkm t (ppDC $ map fst ds) "TyCon" :
map (\(d,_) -> wkm d t "DataCon") ds
cand (Class c ms) = wkm c (ppDC $ map fst ms) "Class" :
map (\(d,t) -> wkm d t (T.pack c)) ms | 805 | false | true | 0 | 17 | 278 | 391 | 198 | 193 | null | null |
AubreyEAnderson/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | prop_checkBashisms16= verify checkBashisms "echo $RANDOM" | 57 | prop_checkBashisms16= verify checkBashisms "echo $RANDOM" | 57 | prop_checkBashisms16= verify checkBashisms "echo $RANDOM" | 57 | false | false | 1 | 5 | 4 | 15 | 5 | 10 | null | null |
kazu-yamamoto/piki | src/Piki.hs | bsd-3-clause | oitem :: Int -> LineParser Xitem
oitem = xitem pikiOl | 53 | oitem :: Int -> LineParser Xitem
oitem = xitem pikiOl | 53 | oitem = xitem pikiOl | 20 | false | true | 0 | 7 | 9 | 27 | 11 | 16 | null | null |
mydaum/cabal | Cabal/tests/StructDiff.hs | bsd-3-clause | gdiffS cs xs ys = DiffResult [DiffThunk [] (constructorNameOf cs xs) (constructorNameOf cs ys)] | 95 | gdiffS cs xs ys = DiffResult [DiffThunk [] (constructorNameOf cs xs) (constructorNameOf cs ys)] | 95 | gdiffS cs xs ys = DiffResult [DiffThunk [] (constructorNameOf cs xs) (constructorNameOf cs ys)] | 95 | false | false | 0 | 9 | 13 | 44 | 21 | 23 | null | null |
Soostone/aws | tests/Utils.hs | bsd-3-clause | eitherTOnceTest0
:: String -- ^ test name
-> EitherT T.Text IO a -- ^ test
-> TestTree
eitherTOnceTest0 name test = testProperty name . once . monadicIO
$ evalTestT name test | 190 | eitherTOnceTest0
:: String -- ^ test name
-> EitherT T.Text IO a -- ^ test
-> TestTree
eitherTOnceTest0 name test = testProperty name . once . monadicIO
$ evalTestT name test | 190 | eitherTOnceTest0 name test = testProperty name . once . monadicIO
$ evalTestT name test | 91 | false | true | 2 | 9 | 46 | 61 | 28 | 33 | null | null |
jochu/image-bin-packing | src/RectBinPacker/Geometry.hs | mit | ----------------------------------------------------------------------------------------------------
-- | A lens that finds the area of a dimension
area :: HasDim a => Getter a Int
area = to dimArea | 198 | area :: HasDim a => Getter a Int
area = to dimArea | 50 | area = to dimArea | 17 | true | true | 0 | 7 | 23 | 34 | 15 | 19 | null | null |
danr/hipspec | examples/old-examples/AppendLists.hs | gpl-3.0 | prop_nil :: Prop [a]
prop_nil = toList NilS =:= [] | 50 | prop_nil :: Prop [a]
prop_nil = toList NilS =:= [] | 50 | prop_nil = toList NilS =:= [] | 29 | false | true | 0 | 7 | 9 | 31 | 14 | 17 | null | null |
stefan-j/ProjectEuler | q23.hs | mit | _abundant' :: Int -> Int -> Int -> Bool
is_abundant' 1 k acc = False
| 71 | is_abundant' :: Int -> Int -> Int -> Bool
is_abundant' 1 k acc = False | 70 | is_abundant' 1 k acc = False | 28 | false | true | 0 | 9 | 17 | 35 | 16 | 19 | null | null |
thalerjonathan/phd | coding/prototyping/haskell/sir/src/SIRClassic.hs | gpl-3.0 | runReplications :: Int -> Int -> Int -> [[(Int, Int, Int)]] -> IO [[(Int, Int, Int)]]
runReplications popCount 0 maxSteps repls = return repls | 142 | runReplications :: Int -> Int -> Int -> [[(Int, Int, Int)]] -> IO [[(Int, Int, Int)]]
runReplications popCount 0 maxSteps repls = return repls | 142 | runReplications popCount 0 maxSteps repls = return repls | 56 | false | true | 0 | 12 | 23 | 72 | 40 | 32 | null | null |
badp/ganeti | src/Ganeti/OpCodes.hs | gpl-2.0 | opSummaryVal OpQuery { opWhat = s } = Just (queryTypeOpToRaw s) | 63 | opSummaryVal OpQuery { opWhat = s } = Just (queryTypeOpToRaw s) | 63 | opSummaryVal OpQuery { opWhat = s } = Just (queryTypeOpToRaw s) | 63 | false | false | 1 | 7 | 10 | 32 | 14 | 18 | null | null |
brunjlar/pell | Math/NumberTheory/Pell.hs | mit | fmzs :: Integer -> Integer -> [(Integer, Integer, [Integer])]
fmzs d n = map (\f -> let m = n `div` (f * f) in (f, m, zs m)) $ filter (\f -> (n `mod` (f * f)) == 0) $ toList $ divisors n where
zs :: Integer -> [Integer]
zs 1 = [0]
zs (-1) = [0]
zs m = nub $ sort $ map norm $ sqrts d am where
am = abs m
am2 = floor (am % 2)
norm x = if x <= am2 then x else x - am | 412 | fmzs :: Integer -> Integer -> [(Integer, Integer, [Integer])]
fmzs d n = map (\f -> let m = n `div` (f * f) in (f, m, zs m)) $ filter (\f -> (n `mod` (f * f)) == 0) $ toList $ divisors n where
zs :: Integer -> [Integer]
zs 1 = [0]
zs (-1) = [0]
zs m = nub $ sort $ map norm $ sqrts d am where
am = abs m
am2 = floor (am % 2)
norm x = if x <= am2 then x else x - am | 412 | fmzs d n = map (\f -> let m = n `div` (f * f) in (f, m, zs m)) $ filter (\f -> (n `mod` (f * f)) == 0) $ toList $ divisors n where
zs :: Integer -> [Integer]
zs 1 = [0]
zs (-1) = [0]
zs m = nub $ sort $ map norm $ sqrts d am where
am = abs m
am2 = floor (am % 2)
norm x = if x <= am2 then x else x - am | 350 | false | true | 8 | 16 | 143 | 276 | 137 | 139 | null | null |
denibertovic/haskell | kubernetes/lib/Kubernetes/OpenAPI/ModelLens.hs | bsd-3-clause | -- | 'v2alpha1CronJobListMetadata' Lens
v2alpha1CronJobListMetadataL :: Lens_' V2alpha1CronJobList (Maybe V1ListMeta)
v2alpha1CronJobListMetadataL f V2alpha1CronJobList{..} = (\v2alpha1CronJobListMetadata -> V2alpha1CronJobList { v2alpha1CronJobListMetadata, ..} ) <$> f v2alpha1CronJobListMetadata | 298 | v2alpha1CronJobListMetadataL :: Lens_' V2alpha1CronJobList (Maybe V1ListMeta)
v2alpha1CronJobListMetadataL f V2alpha1CronJobList{..} = (\v2alpha1CronJobListMetadata -> V2alpha1CronJobList { v2alpha1CronJobListMetadata, ..} ) <$> f v2alpha1CronJobListMetadata | 258 | v2alpha1CronJobListMetadataL f V2alpha1CronJobList{..} = (\v2alpha1CronJobListMetadata -> V2alpha1CronJobList { v2alpha1CronJobListMetadata, ..} ) <$> f v2alpha1CronJobListMetadata | 180 | true | true | 0 | 8 | 23 | 57 | 30 | 27 | null | null |
upwawet/vision | src/Utils.hs | gpl-3.0 | secondaryIconTooltipText =
newAttrFromStringProperty "secondary-icon-tooltip-text" | 84 | secondaryIconTooltipText =
newAttrFromStringProperty "secondary-icon-tooltip-text" | 84 | secondaryIconTooltipText =
newAttrFromStringProperty "secondary-icon-tooltip-text" | 84 | false | false | 0 | 5 | 5 | 9 | 4 | 5 | null | null |
xpika/mohws | src/Network/MoHWS/Part/UserDirectory.hs | bsd-3-clause | translatePath _ _ _ = mzero | 27 | translatePath _ _ _ = mzero | 27 | translatePath _ _ _ = mzero | 27 | false | false | 0 | 5 | 5 | 13 | 6 | 7 | null | null |
ghc-android/ghc | compiler/typecheck/TcGenDeriv.hs | bsd-3-clause | leDouble_RDR = varQual_RDR gHC_PRIM (fsLit "<=##") | 53 | leDouble_RDR = varQual_RDR gHC_PRIM (fsLit "<=##") | 53 | leDouble_RDR = varQual_RDR gHC_PRIM (fsLit "<=##") | 53 | false | false | 0 | 7 | 8 | 17 | 8 | 9 | null | null |
DavidAlphaFox/ghc | libraries/Cabal/Cabal/Distribution/Simple/Program/Builtin.hs | bsd-3-clause | lhcProgram :: Program
lhcProgram = (simpleProgram "lhc") {
programFindVersion = findProgramVersion "--numeric-version" id
} | 129 | lhcProgram :: Program
lhcProgram = (simpleProgram "lhc") {
programFindVersion = findProgramVersion "--numeric-version" id
} | 129 | lhcProgram = (simpleProgram "lhc") {
programFindVersion = findProgramVersion "--numeric-version" id
} | 107 | false | true | 0 | 7 | 19 | 30 | 16 | 14 | null | null |
artems/FlashBit | src/Process/Peer/Receiver.hs | bsd-3-clause | specReceiver :: Socket -> TChan PeerMessage -> IO ChildSpec
specReceiver sock chan = do
return $ ChildSpec
{ csType = Worker
, csAction = runReceiver sock chan
, csRestart = Transient
, csShutdown = return ()
, csShutdownTimeout = 100
} | 288 | specReceiver :: Socket -> TChan PeerMessage -> IO ChildSpec
specReceiver sock chan = do
return $ ChildSpec
{ csType = Worker
, csAction = runReceiver sock chan
, csRestart = Transient
, csShutdown = return ()
, csShutdownTimeout = 100
} | 288 | specReceiver sock chan = do
return $ ChildSpec
{ csType = Worker
, csAction = runReceiver sock chan
, csRestart = Transient
, csShutdown = return ()
, csShutdownTimeout = 100
} | 228 | false | true | 0 | 11 | 92 | 79 | 42 | 37 | null | null |
rodrigogribeiro/mptc | src/Tc/TcClassInstGen.hs | bsd-3-clause | idof (ClassA n _) = toId n | 26 | idof (ClassA n _) = toId n | 26 | idof (ClassA n _) = toId n | 26 | false | false | 0 | 7 | 6 | 20 | 9 | 11 | null | null |
mgsloan/quasi-extras | src/Language/Quasi/Internal/Conversion.hs | bsd-3-clause | patToExp (ViewP _ _) = error "ViewP has no expression equivalent." | 66 | patToExp (ViewP _ _) = error "ViewP has no expression equivalent." | 66 | patToExp (ViewP _ _) = error "ViewP has no expression equivalent." | 66 | false | false | 0 | 7 | 10 | 20 | 9 | 11 | null | null |
brendanhay/gogol | gogol-sourcerepo/gen/Network/Google/Resource/SourceRepo/Projects/Repos/Delete.hs | mpl-2.0 | -- | JSONP
prdCallback :: Lens' ProjectsReposDelete (Maybe Text)
prdCallback
= lens _prdCallback (\ s a -> s{_prdCallback = a}) | 129 | prdCallback :: Lens' ProjectsReposDelete (Maybe Text)
prdCallback
= lens _prdCallback (\ s a -> s{_prdCallback = a}) | 118 | prdCallback
= lens _prdCallback (\ s a -> s{_prdCallback = a}) | 64 | true | true | 0 | 9 | 21 | 48 | 25 | 23 | null | null |
tbarnetlamb/hyphen | hyphen/lowlevel_src/Hyphen.hs | gpl-2.0 | from_haskell_ByteString_impl = withHsObjRawSimp pythonateByteString | 68 | from_haskell_ByteString_impl = withHsObjRawSimp pythonateByteString | 68 | from_haskell_ByteString_impl = withHsObjRawSimp pythonateByteString | 68 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
brendanhay/gogol | gogol-translate/gen/Network/Google/Translate/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'OperationMetadata' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'omAddtional'
operationMetadata
:: HashMap Text JSONValue -- ^ 'omAddtional'
-> OperationMetadata
operationMetadata pOmAddtional_ =
OperationMetadata' {_omAddtional = _Coerce # pOmAddtional_} | 378 | operationMetadata
:: HashMap Text JSONValue -- ^ 'omAddtional'
-> OperationMetadata
operationMetadata pOmAddtional_ =
OperationMetadata' {_omAddtional = _Coerce # pOmAddtional_} | 187 | operationMetadata pOmAddtional_ =
OperationMetadata' {_omAddtional = _Coerce # pOmAddtional_} | 95 | true | true | 0 | 8 | 62 | 47 | 25 | 22 | null | null |
lostbean/VirMat | src/VirMat/Core/Sampling.hs | gpl-3.0 | composeDist fs = let
dist = L.foldl' (\acc d -> (\a -> acc a + (getDistFunc d) a)) (const 0) fs
modes = map getDistMode fs
area = L.foldl' (\acc d -> getDistArea d + acc) 0 fs
mean = let
func (sa, ma) d = let
s = getDistArea d
in (s + sa, (s * (getDistMean d) ^ (2 :: Int)) + ma)
(totalS, totalM) = L.foldl' func (0,0) fs
in sqrt (totalM / totalS)
interval = let
xs = concatMap (toList . getDistInterval) fs
toList (a,b) = [a,b]
in (minimum xs, maximum xs)
in return MultiDist
{ mDistFunc = dist
, mDistMean = mean
, mDistInterval = interval
, mDistModes = modes
, mDistArea = area
} | 663 | composeDist fs = let
dist = L.foldl' (\acc d -> (\a -> acc a + (getDistFunc d) a)) (const 0) fs
modes = map getDistMode fs
area = L.foldl' (\acc d -> getDistArea d + acc) 0 fs
mean = let
func (sa, ma) d = let
s = getDistArea d
in (s + sa, (s * (getDistMean d) ^ (2 :: Int)) + ma)
(totalS, totalM) = L.foldl' func (0,0) fs
in sqrt (totalM / totalS)
interval = let
xs = concatMap (toList . getDistInterval) fs
toList (a,b) = [a,b]
in (minimum xs, maximum xs)
in return MultiDist
{ mDistFunc = dist
, mDistMean = mean
, mDistInterval = interval
, mDistModes = modes
, mDistArea = area
} | 663 | composeDist fs = let
dist = L.foldl' (\acc d -> (\a -> acc a + (getDistFunc d) a)) (const 0) fs
modes = map getDistMode fs
area = L.foldl' (\acc d -> getDistArea d + acc) 0 fs
mean = let
func (sa, ma) d = let
s = getDistArea d
in (s + sa, (s * (getDistMean d) ^ (2 :: Int)) + ma)
(totalS, totalM) = L.foldl' func (0,0) fs
in sqrt (totalM / totalS)
interval = let
xs = concatMap (toList . getDistInterval) fs
toList (a,b) = [a,b]
in (minimum xs, maximum xs)
in return MultiDist
{ mDistFunc = dist
, mDistMean = mean
, mDistInterval = interval
, mDistModes = modes
, mDistArea = area
} | 663 | false | false | 0 | 21 | 199 | 324 | 171 | 153 | null | null |
Soostone/uri-bytestring | test/URI/ByteString/Generators.hs | bsd-3-clause | genURINormalizationOptions :: Gen URINormalizationOptions
genURINormalizationOptions = do
dScheme <- Gen.bool
dHost <- Gen.bool
dPort <- Gen.bool
slashPath <- Gen.bool
dSlashes <- Gen.bool
dSort <- Gen.bool
dSegments <- Gen.bool
ports <- Gen.map (Range.linear 0 10) ((,) <$> genScheme <*> genPort)
pure $ URINormalizationOptions
{ unoDowncaseScheme = dScheme
, unoDowncaseHost = dHost
, unoDropDefPort = dPort
, unoSlashEmptyPath = slashPath
, unoDropExtraSlashes = dSlashes
, unoSortParameters = dSort
, unoRemoveDotSegments = dSegments
, unoDefaultPorts = ports
} | 645 | genURINormalizationOptions :: Gen URINormalizationOptions
genURINormalizationOptions = do
dScheme <- Gen.bool
dHost <- Gen.bool
dPort <- Gen.bool
slashPath <- Gen.bool
dSlashes <- Gen.bool
dSort <- Gen.bool
dSegments <- Gen.bool
ports <- Gen.map (Range.linear 0 10) ((,) <$> genScheme <*> genPort)
pure $ URINormalizationOptions
{ unoDowncaseScheme = dScheme
, unoDowncaseHost = dHost
, unoDropDefPort = dPort
, unoSlashEmptyPath = slashPath
, unoDropExtraSlashes = dSlashes
, unoSortParameters = dSort
, unoRemoveDotSegments = dSegments
, unoDefaultPorts = ports
} | 645 | genURINormalizationOptions = do
dScheme <- Gen.bool
dHost <- Gen.bool
dPort <- Gen.bool
slashPath <- Gen.bool
dSlashes <- Gen.bool
dSort <- Gen.bool
dSegments <- Gen.bool
ports <- Gen.map (Range.linear 0 10) ((,) <$> genScheme <*> genPort)
pure $ URINormalizationOptions
{ unoDowncaseScheme = dScheme
, unoDowncaseHost = dHost
, unoDropDefPort = dPort
, unoSlashEmptyPath = slashPath
, unoDropExtraSlashes = dSlashes
, unoSortParameters = dSort
, unoRemoveDotSegments = dSegments
, unoDefaultPorts = ports
} | 587 | false | true | 0 | 12 | 154 | 172 | 90 | 82 | null | null |
yogsototh/YML | test/YML/LinearGradient/Test.hs | mit | linearGradientSuite :: TestTree
linearGradientSuite = testGroup "LinearGradient"
[ testCase "cost from null function" testCost
, SC.testProperty "Cost is always positive" prop_cost_positive
] | 203 | linearGradientSuite :: TestTree
linearGradientSuite = testGroup "LinearGradient"
[ testCase "cost from null function" testCost
, SC.testProperty "Cost is always positive" prop_cost_positive
] | 203 | linearGradientSuite = testGroup "LinearGradient"
[ testCase "cost from null function" testCost
, SC.testProperty "Cost is always positive" prop_cost_positive
] | 171 | false | true | 0 | 8 | 33 | 34 | 17 | 17 | null | null |
takayuki/natume | Re.hs | gpl-2.0 | prefixHiragana :: String -> [(String,String)]
prefixHiragana = prefixAny (parse "([:hiragana:][:hiragana:]*)") | 111 | prefixHiragana :: String -> [(String,String)]
prefixHiragana = prefixAny (parse "([:hiragana:][:hiragana:]*)") | 111 | prefixHiragana = prefixAny (parse "([:hiragana:][:hiragana:]*)") | 65 | false | true | 0 | 7 | 10 | 33 | 18 | 15 | null | null |
mzini/TcT | source/Tct/Encoding/Precedence.hs | gpl-3.0 | isRecursive :: Eq l => Symbol -> PropFormula l
isRecursive = propAtom . IsRecursive | 83 | isRecursive :: Eq l => Symbol -> PropFormula l
isRecursive = propAtom . IsRecursive | 83 | isRecursive = propAtom . IsRecursive | 36 | false | true | 0 | 7 | 13 | 29 | 14 | 15 | null | null |
yuto-matsum/contest-util-hs | src/My/Num.hs | mit | {-| multiply powered tuples
>>> [1,2,3] ^* [4,5,6] == 1^4 * 2^5 * 3^6
True
>>> [] ^* [4,5,6]
1
>>> [1,2,3] ^* []
1
-}
(^*) :: Integral a => [a] -> [a] -> a
(^*) [] _ = 1 | 169 | (^*) :: Integral a => [a] -> [a] -> a
(^*) [] _ = 1 | 51 | (^*) [] _ = 1 | 13 | true | true | 0 | 8 | 40 | 44 | 25 | 19 | null | null |
aaronhourie/ottava | ottava.hs | mit | generateScale (ScaleName (Tone (Note name Flat) octave) Major) =
convertScale Flat (scale major (Tone (Note name Flat) octave)) | 132 | generateScale (ScaleName (Tone (Note name Flat) octave) Major) =
convertScale Flat (scale major (Tone (Note name Flat) octave)) | 132 | generateScale (ScaleName (Tone (Note name Flat) octave) Major) =
convertScale Flat (scale major (Tone (Note name Flat) octave)) | 132 | false | false | 0 | 11 | 22 | 62 | 30 | 32 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.