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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ku-fpg/sunroof-examples | examples/unit/Main.hs | bsd-3-clause | checkArbitraryMap
:: TestEngine
-> Property
checkArbitraryMap doc = monadicIO $ do
ops :: [MapOp SmallString SmallNat] <- pick (genMapOps 10)
run $ print ops
res :: Bool <- run $ syncJS (srEngine doc) $ do
mp <- M.newMap
let km = foldr (\ (op :: MapOp SmallString SmallNat) (km' :... | 2,513 | checkArbitraryMap
:: TestEngine
-> Property
checkArbitraryMap doc = monadicIO $ do
ops :: [MapOp SmallString SmallNat] <- pick (genMapOps 10)
run $ print ops
res :: Bool <- run $ syncJS (srEngine doc) $ do
mp <- M.newMap
let km = foldr (\ (op :: MapOp SmallString SmallNat) (km' :... | 2,513 | checkArbitraryMap doc = monadicIO $ do
ops :: [MapOp SmallString SmallNat] <- pick (genMapOps 10)
run $ print ops
res :: Bool <- run $ syncJS (srEngine doc) $ do
mp <- M.newMap
let km = foldr (\ (op :: MapOp SmallString SmallNat) (km' :: JSA (JSFunction () JSBool)) -> do
... | 2,453 | false | true | 0 | 37 | 1,613 | 466 | 219 | 247 | null | null |
rahulmutt/ghcvm | compiler/Eta/TypeCheck/TcTypeNats.hs | bsd-3-clause | matchFamCmpSymbol :: [Type] -> Maybe (CoAxiomRule, [Type], Type)
matchFamCmpSymbol [s,t]
| Just x <- mbX, Just y <- mbY =
Just (axCmpSymbolDef, [s,t], ordering (compare x y))
| tcEqType s t = Just (axCmpSymbolRefl, [s], ordering EQ)
where mbX = isStrLitTy s
mbY = isStrLitTy t | 294 | matchFamCmpSymbol :: [Type] -> Maybe (CoAxiomRule, [Type], Type)
matchFamCmpSymbol [s,t]
| Just x <- mbX, Just y <- mbY =
Just (axCmpSymbolDef, [s,t], ordering (compare x y))
| tcEqType s t = Just (axCmpSymbolRefl, [s], ordering EQ)
where mbX = isStrLitTy s
mbY = isStrLitTy t | 294 | matchFamCmpSymbol [s,t]
| Just x <- mbX, Just y <- mbY =
Just (axCmpSymbolDef, [s,t], ordering (compare x y))
| tcEqType s t = Just (axCmpSymbolRefl, [s], ordering EQ)
where mbX = isStrLitTy s
mbY = isStrLitTy t | 229 | false | true | 2 | 9 | 63 | 159 | 77 | 82 | null | null |
GaloisInc/halvm-ghc | compiler/main/DynFlags.hs | bsd-3-clause | wayDesc WayDebug = "Debug" | 29 | wayDesc WayDebug = "Debug" | 29 | wayDesc WayDebug = "Debug" | 29 | false | false | 0 | 5 | 6 | 9 | 4 | 5 | null | null |
rfranek/duckling | Duckling/Numeral/GA/Rules.hs | bsd-3-clause | rules :: [Rule]
rules =
[ ruleAmhin
, ruleCountNumerals
, ruleDag
, ruleDecimalNumeral
, ruleDecimalWithThousandsSeparator
, ruleIntegerNumeric
, ruleIntegerWithThousandsSeparator
, ruleNumerals
, ruleNumerals2
, ruleNumeralsPrefixWithNegativeOrMinus
, ruleNumeralsSuffixesKMG
, ruleOldVigesimalN... | 363 | rules :: [Rule]
rules =
[ ruleAmhin
, ruleCountNumerals
, ruleDag
, ruleDecimalNumeral
, ruleDecimalWithThousandsSeparator
, ruleIntegerNumeric
, ruleIntegerWithThousandsSeparator
, ruleNumerals
, ruleNumerals2
, ruleNumeralsPrefixWithNegativeOrMinus
, ruleNumeralsSuffixesKMG
, ruleOldVigesimalN... | 363 | rules =
[ ruleAmhin
, ruleCountNumerals
, ruleDag
, ruleDecimalNumeral
, ruleDecimalWithThousandsSeparator
, ruleIntegerNumeric
, ruleIntegerWithThousandsSeparator
, ruleNumerals
, ruleNumerals2
, ruleNumeralsPrefixWithNegativeOrMinus
, ruleNumeralsSuffixesKMG
, ruleOldVigesimalNumeralsS
, rul... | 347 | false | true | 0 | 7 | 59 | 60 | 35 | 25 | null | null |
spechub/Hets | Persistence/LogicGraph.hs | gpl-2.0 | exportLogicGraph :: HetcatsOpts -> IO ()
exportLogicGraph opts =
onDatabase (databaseConfig opts) $
advisoryLocked opts migrateLogicGraphKey $ migrateLogicGraph opts | 171 | exportLogicGraph :: HetcatsOpts -> IO ()
exportLogicGraph opts =
onDatabase (databaseConfig opts) $
advisoryLocked opts migrateLogicGraphKey $ migrateLogicGraph opts | 171 | exportLogicGraph opts =
onDatabase (databaseConfig opts) $
advisoryLocked opts migrateLogicGraphKey $ migrateLogicGraph opts | 130 | false | true | 0 | 9 | 24 | 48 | 22 | 26 | null | null |
wildsebastian/99HaskellProblems | 01-10_ListProblems/Main.hs | mit | testCase6 :: [Int]
testCase6 = [1..10000] | 41 | testCase6 :: [Int]
testCase6 = [1..10000] | 41 | testCase6 = [1..10000] | 22 | false | true | 0 | 5 | 5 | 19 | 11 | 8 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/main/HscTypes.hs | bsd-3-clause | trustInfoToNum :: IfaceTrustInfo -> Word8
trustInfoToNum it
= case getSafeMode it of
Sf_None -> 0
Sf_Unsafe -> 1
Sf_Trustworthy -> 2
Sf_Safe -> 3 | 218 | trustInfoToNum :: IfaceTrustInfo -> Word8
trustInfoToNum it
= case getSafeMode it of
Sf_None -> 0
Sf_Unsafe -> 1
Sf_Trustworthy -> 2
Sf_Safe -> 3 | 218 | trustInfoToNum it
= case getSafeMode it of
Sf_None -> 0
Sf_Unsafe -> 1
Sf_Trustworthy -> 2
Sf_Safe -> 3 | 176 | false | true | 0 | 7 | 96 | 49 | 24 | 25 | null | null |
ideas-edu/ideas | src/Ideas/Encoding/LinkManager.hs | apache-2.0 | linkToFirsts :: LinkManager -> State a -> HTMLBuilder -> HTMLBuilder
linkToFirsts = linkWith . urlForFirsts | 108 | linkToFirsts :: LinkManager -> State a -> HTMLBuilder -> HTMLBuilder
linkToFirsts = linkWith . urlForFirsts | 107 | linkToFirsts = linkWith . urlForFirsts | 38 | false | true | 0 | 9 | 15 | 37 | 16 | 21 | null | null |
PierreR/Haskell-Turtle-Library | src/Turtle/Prelude.hs | bsd-3-clause | -- | Stream lines of `Text` to standard output
stdout :: MonadIO io => Shell Line -> io ()
stdout s = sh (do
line <- s
liftIO (echo line) ) | 147 | stdout :: MonadIO io => Shell Line -> io ()
stdout s = sh (do
line <- s
liftIO (echo line) ) | 100 | stdout s = sh (do
line <- s
liftIO (echo line) ) | 56 | true | true | 0 | 11 | 38 | 59 | 27 | 32 | null | null |
NickAger/LearningHaskell | CIS194/hw02.hs | mit | -- Exercise 3 -----------------------------------------
-- Construct a Move from a guess given the actual code
getMove :: Code -> Code -> Move
getMove code guess = Move guess exactMatchScore (matches code guess - exactMatchScore)
where exactMatchScore = exactMatches code guess
-- Exercise 4 --------------------... | 341 | getMove :: Code -> Code -> Move
getMove code guess = Move guess exactMatchScore (matches code guess - exactMatchScore)
where exactMatchScore = exactMatches code guess
-- Exercise 4 ----------------------------------------- | 229 | getMove code guess = Move guess exactMatchScore (matches code guess - exactMatchScore)
where exactMatchScore = exactMatches code guess
-- Exercise 4 ----------------------------------------- | 197 | true | true | 0 | 8 | 51 | 58 | 30 | 28 | null | null |
beni55/haste-compiler | libraries/ghc-7.8/base/GHC/IO/Handle.hs | bsd-3-clause | -- ---------------------------------------------------------------------------
-- Buffering Operations
-- Three kinds of buffering are supported: line-buffering,
-- block-buffering or no-buffering. See GHC.IO.Handle for definition and
-- further explanation of what the type represent.
-- | Computation 'hSetBuffering... | 2,738 | hSetBuffering :: Handle -> BufferMode -> IO ()
hSetBuffering handle mode =
withAllHandles__ "hSetBuffering" handle $ \ handle_@Handle__{..} -> do
case haType of
ClosedHandle -> ioe_closedHandle
_ -> do
if mode == haBufferMode then return handle_ else do
-- See [note Buffer Sizing] in GHC.... | 1,868 | hSetBuffering handle mode =
withAllHandles__ "hSetBuffering" handle $ \ handle_@Handle__{..} -> do
case haType of
ClosedHandle -> ioe_closedHandle
_ -> do
if mode == haBufferMode then return handle_ else do
-- See [note Buffer Sizing] in GHC.IO.Handle.Types
-- check for errors:... | 1,821 | true | true | 0 | 24 | 647 | 272 | 149 | 123 | null | null |
TomMD/ghc | compiler/nativeGen/NCGMonad.hs | bsd-3-clause | getNewLabelNat :: NatM CLabel
getNewLabelNat
= do u <- getUniqueNat
return (mkAsmTempLabel u) | 104 | getNewLabelNat :: NatM CLabel
getNewLabelNat
= do u <- getUniqueNat
return (mkAsmTempLabel u) | 104 | getNewLabelNat
= do u <- getUniqueNat
return (mkAsmTempLabel u) | 74 | false | true | 0 | 9 | 23 | 35 | 15 | 20 | null | null |
brendanhay/gogol | gogol-bigquery/gen/Network/Google/BigQuery/Types/Product.hs | mpl-2.0 | -- | [Required] The type of this field.
qptstiType :: Lens' QueryParameterTypeStructTypesItem (Maybe QueryParameterType)
qptstiType
= lens _qptstiType (\ s a -> s{_qptstiType = a}) | 182 | qptstiType :: Lens' QueryParameterTypeStructTypesItem (Maybe QueryParameterType)
qptstiType
= lens _qptstiType (\ s a -> s{_qptstiType = a}) | 142 | qptstiType
= lens _qptstiType (\ s a -> s{_qptstiType = a}) | 61 | true | true | 0 | 9 | 26 | 48 | 25 | 23 | null | null |
stevedonnelly/haskell | code/Data/Tuple/Extensions.hs | mit | first6 (a, b, c, d, e, f) = a | 29 | first6 (a, b, c, d, e, f) = a | 29 | first6 (a, b, c, d, e, f) = a | 29 | false | false | 0 | 5 | 8 | 28 | 16 | 12 | null | null |
gcampax/ghc | compiler/types/TyCon.hs | bsd-3-clause | famTyConFlav_maybe _ = Nothing | 61 | famTyConFlav_maybe _ = Nothing | 61 | famTyConFlav_maybe _ = Nothing | 61 | false | false | 0 | 4 | 34 | 10 | 4 | 6 | null | null |
mfine/ghc | compiler/main/DynFlags.hs | bsd-3-clause | wayTag WayDebug = "debug" | 28 | wayTag WayDebug = "debug" | 28 | wayTag WayDebug = "debug" | 28 | false | false | 0 | 4 | 6 | 10 | 4 | 6 | null | null |
DavidAlphaFox/darcs | harness/test.hs | gpl-2.0 | readDiffAlgorithm _ = error "Valid diff algorithms: myers, patience" | 68 | readDiffAlgorithm _ = error "Valid diff algorithms: myers, patience" | 68 | readDiffAlgorithm _ = error "Valid diff algorithms: myers, patience" | 68 | false | false | 0 | 4 | 8 | 13 | 5 | 8 | null | null |
elginer/shpider | Network/Shpider/URL.hs | mit | -- | Assumes the given URL is relative to `currentPage`.
mkAbsoluteUrl :: String -> Shpider ( Maybe String )
mkAbsoluteUrl uncleanUrl = do
if not $ isMailto uncleanUrl
then do
shpider <- get
let cleanUrlStr = escapeSpaces uncleanUrl
maybeUrl = importURL cleanUrlStr
c... | 922 | mkAbsoluteUrl :: String -> Shpider ( Maybe String )
mkAbsoluteUrl uncleanUrl = do
if not $ isMailto uncleanUrl
then do
shpider <- get
let cleanUrlStr = escapeSpaces uncleanUrl
maybeUrl = importURL cleanUrlStr
currentAddr = addr $ currentPage shpider
maybe ( ... | 865 | mkAbsoluteUrl uncleanUrl = do
if not $ isMailto uncleanUrl
then do
shpider <- get
let cleanUrlStr = escapeSpaces uncleanUrl
maybeUrl = importURL cleanUrlStr
currentAddr = addr $ currentPage shpider
maybe ( return Nothing )
( \ url ->
... | 813 | true | true | 0 | 18 | 406 | 186 | 89 | 97 | null | null |
denibertovic/haskell | kubernetes-client-helper/src/Kubernetes/ClientHelper.hs | bsd-3-clause | -- |Default TLS settings using the system CA store.
defaultTLSClientParams :: IO TLS.ClientParams
defaultTLSClientParams = do
let defParams = defaultParamsClient "" ""
systemCAStore <- getSystemCertificateStore
return defParams
{ TLS.clientSupported = def
{ TLS.supportedCiphers = TLS.cip... | 482 | defaultTLSClientParams :: IO TLS.ClientParams
defaultTLSClientParams = do
let defParams = defaultParamsClient "" ""
systemCAStore <- getSystemCertificateStore
return defParams
{ TLS.clientSupported = def
{ TLS.supportedCiphers = TLS.ciphersuite_strong
}
, TLS.clientSh... | 430 | defaultTLSClientParams = do
let defParams = defaultParamsClient "" ""
systemCAStore <- getSystemCertificateStore
return defParams
{ TLS.clientSupported = def
{ TLS.supportedCiphers = TLS.ciphersuite_strong
}
, TLS.clientShared = (TLS.clientShared defParams)
... | 384 | true | true | 0 | 13 | 133 | 92 | 48 | 44 | null | null |
tangboyun/miranda | src/MiRanda/Diagram/LocalAU.hs | gpl-3.0 | seedColor = dodgerblue | 22 | seedColor = dodgerblue | 22 | seedColor = dodgerblue | 22 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
naoto-ogawa/h-xproto-mysql | src/DataBase/MySQLX/Model.hs | mit | getIdentifier :: (MonadThrow m) => B.ByteString -> m PI.Identifier
getIdentifier = getMessage | 168 | getIdentifier :: (MonadThrow m) => B.ByteString -> m PI.Identifier
getIdentifier = getMessage | 143 | getIdentifier = getMessage | 51 | false | true | 0 | 8 | 86 | 31 | 16 | 15 | null | null |
bennofs/cabal | Cabal/Distribution/Simple/Setup.hs | bsd-3-clause | emptyConfigFlags :: ConfigFlags
emptyConfigFlags = mempty | 57 | emptyConfigFlags :: ConfigFlags
emptyConfigFlags = mempty | 57 | emptyConfigFlags = mempty | 25 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
hackern/halfs | Halfs/Inode.hs | bsd-3-clause | writeExt :: Monad m =>
BlockDevice m -> Ext -> m ()
writeExt dev c =
dbug (" ==> Writing ext: " ++ show c ) $
bdWriteBlock dev (unER $ address c) (encode c) | 174 | writeExt :: Monad m =>
BlockDevice m -> Ext -> m ()
writeExt dev c =
dbug (" ==> Writing ext: " ++ show c ) $
bdWriteBlock dev (unER $ address c) (encode c) | 174 | writeExt dev c =
dbug (" ==> Writing ext: " ++ show c ) $
bdWriteBlock dev (unER $ address c) (encode c) | 109 | false | true | 0 | 10 | 52 | 85 | 38 | 47 | null | null |
kadena-io/pact | src-ghc/Pact/GasModel/GasTests.hs | bsd-3-clause | emitEventTests :: NativeDefName -> GasUnitTests
emitEventTests = defGasUnitTests (expr :| [])
where
expr = defPactExpression [text| ($acctModuleNameText.test-emit-event-func) |] | 183 | emitEventTests :: NativeDefName -> GasUnitTests
emitEventTests = defGasUnitTests (expr :| [])
where
expr = defPactExpression [text| ($acctModuleNameText.test-emit-event-func) |] | 183 | emitEventTests = defGasUnitTests (expr :| [])
where
expr = defPactExpression [text| ($acctModuleNameText.test-emit-event-func) |] | 135 | false | true | 0 | 8 | 23 | 42 | 23 | 19 | null | null |
danipozodg/dependency | AVL.hs | gpl-3.0 | split :: AVL a -> (a,AVL a)
split (Node x h Empty rt) = (x,rt) | 64 | split :: AVL a -> (a,AVL a)
split (Node x h Empty rt) = (x,rt) | 63 | split (Node x h Empty rt) = (x,rt) | 35 | false | true | 0 | 7 | 16 | 48 | 25 | 23 | null | null |
d0kt0r0/Tidal | src/Sound/Tidal/Params.hs | gpl-3.0 | -- ring modulation
ring, ringf, ringdf :: Pattern Double -> ControlPattern
ring = pF "ring" | 91 | ring, ringf, ringdf :: Pattern Double -> ControlPattern
ring = pF "ring" | 72 | ring = pF "ring" | 16 | true | true | 0 | 6 | 14 | 26 | 15 | 11 | null | null |
songpp/pcs-cli | src/Token.hs | apache-2.0 | currentToken :: IO (Maybe TokenResp)
currentToken = liftM parse'' $ tokenCachedFileFullPath >>= readFile
where
parse'' :: String -> Maybe TokenResp
parse'' = decodeStrict . LC.toStrict . LC.pack | 214 | currentToken :: IO (Maybe TokenResp)
currentToken = liftM parse'' $ tokenCachedFileFullPath >>= readFile
where
parse'' :: String -> Maybe TokenResp
parse'' = decodeStrict . LC.toStrict . LC.pack | 214 | currentToken = liftM parse'' $ tokenCachedFileFullPath >>= readFile
where
parse'' :: String -> Maybe TokenResp
parse'' = decodeStrict . LC.toStrict . LC.pack | 177 | false | true | 0 | 9 | 46 | 62 | 31 | 31 | null | null |
ehlemur/HLearn | src/exec/hlearn-knn.hs | bsd-3-clause | cv_legit ::
( HomTrainer model
, Classifier model
, MahalanobisMetric metric
, RandomGen g
, Eq (Datapoint model)
, Eq (Label (Datapoint model))
, F.Foldable container
, Functor container
, Double ~ Ring metric
, Datapoint model ~ DP
) => SamplingMethod
-> LossFunctio... | 1,082 | cv_legit ::
( HomTrainer model
, Classifier model
, MahalanobisMetric metric
, RandomGen g
, Eq (Datapoint model)
, Eq (Label (Datapoint model))
, F.Foldable container
, Functor container
, Double ~ Ring metric
, Datapoint model ~ DP
) => SamplingMethod
-> LossFunctio... | 1,082 | cv_legit genfolds loss xs trainmetric nummetric trainmodel = do
xs' <- genfolds $ F.toList xs
return $ train $ do
testset <- xs'
let trainingset = concat $ filter (/=testset) xs'
metric = trainmetric $ genMetricConstraints (V.fromList $ F.toList xs) nummetric
trainingset'... | 595 | false | true | 0 | 20 | 304 | 391 | 191 | 200 | null | null |
ghc-android/ghc | compiler/deSugar/Coverage.hs | bsd-3-clause | isGoodBreakExpr (RecordCon {}) = True | 37 | isGoodBreakExpr (RecordCon {}) = True | 37 | isGoodBreakExpr (RecordCon {}) = True | 37 | false | false | 0 | 7 | 4 | 16 | 8 | 8 | null | null |
sherwoodwang/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxFONTFAMILY_UNKNOWN :: Int
wxFONTFAMILY_UNKNOWN = wxFONTFAMILY_MAX | 67 | wxFONTFAMILY_UNKNOWN :: Int
wxFONTFAMILY_UNKNOWN = wxFONTFAMILY_MAX | 67 | wxFONTFAMILY_UNKNOWN = wxFONTFAMILY_MAX | 39 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
sherwoodwang/wxHaskell | samples/test/Resize.hs | lgpl-2.1 | main
= start $
do p <- getApplicationDir
f <- frame [text := p]
h <- staticText f [text := "Hello world!", on click ::= goodbye]
b <- button f [text := "Ok", on command ::= longlabel]
set f [layout := column 5 [widget h, widget b]]
set f [clientSize := sz 300 300] | 311 | main
= start $
do p <- getApplicationDir
f <- frame [text := p]
h <- staticText f [text := "Hello world!", on click ::= goodbye]
b <- button f [text := "Ok", on command ::= longlabel]
set f [layout := column 5 [widget h, widget b]]
set f [clientSize := sz 300 300] | 311 | main
= start $
do p <- getApplicationDir
f <- frame [text := p]
h <- staticText f [text := "Hello world!", on click ::= goodbye]
b <- button f [text := "Ok", on command ::= longlabel]
set f [layout := column 5 [widget h, widget b]]
set f [clientSize := sz 300 300] | 311 | false | false | 1 | 14 | 100 | 148 | 68 | 80 | null | null |
roldugin/LiveFusion | Data/LiveFusion/HsBackend/Prelude.hs | bsd-3-clause | maxTerm x y = (code maxImpl) `app` x `app` y | 44 | maxTerm x y = (code maxImpl) `app` x `app` y | 44 | maxTerm x y = (code maxImpl) `app` x `app` y | 44 | false | false | 0 | 8 | 9 | 29 | 16 | 13 | null | null |
haskellbr/missingh | missingh-all/src/System/IO/Binary.hs | mit | hPutBlocks h (x:xs) = do
hPutBufStr h x
hPutBlocks h xs
{- | An alias for 'hPutBlocks' 'stdout'
putBlocks :: (BinaryConvertible b) => [[b]] -> IO ()
putBlocks = hPutBlocks stdout -}
{- | Returns a lazily-evaluated list of all blocks in the input file,
as read by 'hGetBufStr... | 401 | hPutBlocks h (x:xs) = do
hPutBufStr h x
hPutBlocks h xs
{- | An alias for 'hPutBlocks' 'stdout'
putBlocks :: (BinaryConvertible b) => [[b]] -> IO ()
putBlocks = hPutBlocks stdout -}
{- | Returns a lazily-evaluated list of all blocks in the input file,
as read by 'hGetBufStr... | 401 | hPutBlocks h (x:xs) = do
hPutBufStr h x
hPutBlocks h xs
{- | An alias for 'hPutBlocks' 'stdout'
putBlocks :: (BinaryConvertible b) => [[b]] -> IO ()
putBlocks = hPutBlocks stdout -}
{- | Returns a lazily-evaluated list of all blocks in the input file,
as read by 'hGetBufStr... | 401 | false | false | 0 | 7 | 111 | 38 | 17 | 21 | null | null |
lukexi/ghc-7.8-arm64 | compiler/cmm/CmmUtils.hs | bsd-3-clause | mkLiveness dflags (reg:regs)
= take sizeW bits ++ mkLiveness dflags regs
where
sizeW = case reg of
Nothing -> 1
Just r -> (widthInBytes (typeWidth (localRegType r)) + wORD_SIZE dflags - 1)
`quot` wORD_SIZE dflags
-- number of words, rou... | 781 | mkLiveness dflags (reg:regs)
= take sizeW bits ++ mkLiveness dflags regs
where
sizeW = case reg of
Nothing -> 1
Just r -> (widthInBytes (typeWidth (localRegType r)) + wORD_SIZE dflags - 1)
`quot` wORD_SIZE dflags
-- number of words, rou... | 781 | mkLiveness dflags (reg:regs)
= take sizeW bits ++ mkLiveness dflags regs
where
sizeW = case reg of
Nothing -> 1
Just r -> (widthInBytes (typeWidth (localRegType r)) + wORD_SIZE dflags - 1)
`quot` wORD_SIZE dflags
-- number of words, rou... | 781 | false | false | 0 | 16 | 188 | 154 | 80 | 74 | null | null |
andrewthad/vinyl-vectors | src/Data/Vector/Vinyl/Default/NonEmpty/Tagged.hs | bsd-3-clause | modify p = G.modify p | 21 | modify p = G.modify p | 21 | modify p = G.modify p | 21 | false | false | 1 | 5 | 4 | 18 | 6 | 12 | null | null |
nikhilunni/HaskellBoy | src/GPU.hs | gpl-2.0 | --B
--TODO : Check for GBP #0-7, otherwise error ... right now you'll just get a runtime exception for index out of bound
getGBCPalette :: Word8 -> GBC Palette
getGBCPalette num = do
pal <- readArr vramBank $ 8 * (fromIntegral num)
bytes <- sequence [readArr vramBank $ 8 * (fromIntegral num) + i | i <- [0... | 784 | getGBCPalette :: Word8 -> GBC Palette
getGBCPalette num = do
pal <- readArr vramBank $ 8 * (fromIntegral num)
bytes <- sequence [readArr vramBank $ 8 * (fromIntegral num) + i | i <- [0 .. 7]]
let col0 = getGBCColor $ (fromIntegral $ ((bytes !! 0) `shiftL` 8)) + (fromIntegral $ (bytes !! 1))
let col1... | 658 | getGBCPalette num = do
pal <- readArr vramBank $ 8 * (fromIntegral num)
bytes <- sequence [readArr vramBank $ 8 * (fromIntegral num) + i | i <- [0 .. 7]]
let col0 = getGBCColor $ (fromIntegral $ ((bytes !! 0) `shiftL` 8)) + (fromIntegral $ (bytes !! 1))
let col1 = getGBCColor $ (fromIntegral $ ((byt... | 620 | true | true | 1 | 16 | 175 | 321 | 177 | 144 | null | null |
ggreif/clash-compiler | clash-lib/src/CLaSH/Normalize/Util.hs | bsd-2-clause | -- | Specialize under the Normalization Monad
specializeNorm :: NormRewrite
specializeNorm = specialise specialisationCache specialisationHistory specialisationLimit | 165 | specializeNorm :: NormRewrite
specializeNorm = specialise specialisationCache specialisationHistory specialisationLimit | 119 | specializeNorm = specialise specialisationCache specialisationHistory specialisationLimit | 89 | true | true | 0 | 6 | 15 | 25 | 11 | 14 | null | null |
m-arnold/graflog | src/Graflog/Console.hs | bsd-3-clause | writeStdout' :: MonadIO m => Text -> m ()
writeStdout' = liftIO . T.putStrLn | 76 | writeStdout' :: MonadIO m => Text -> m ()
writeStdout' = liftIO . T.putStrLn | 76 | writeStdout' = liftIO . T.putStrLn | 34 | false | true | 0 | 8 | 13 | 33 | 16 | 17 | null | null |
rrnewton/criterion | Criterion/Main/Options.hs | bsd-2-clause | -- We sort not by name, but by likely frequency of use.
regressionHelp :: Chunk Doc
regressionHelp =
fmap (text "Regression metrics (for use with --regress):" .$.) $
tabulate [(text n,text d) | (n,(_,d)) <- map f measureKeys]
where f k = (k, measureAccessors M.! k) | 277 | regressionHelp :: Chunk Doc
regressionHelp =
fmap (text "Regression metrics (for use with --regress):" .$.) $
tabulate [(text n,text d) | (n,(_,d)) <- map f measureKeys]
where f k = (k, measureAccessors M.! k) | 221 | regressionHelp =
fmap (text "Regression metrics (for use with --regress):" .$.) $
tabulate [(text n,text d) | (n,(_,d)) <- map f measureKeys]
where f k = (k, measureAccessors M.! k) | 193 | true | true | 0 | 11 | 57 | 95 | 50 | 45 | null | null |
josuf107/Fizzckle | src/Fizz/Core.hs | gpl-3.0 | defaultEntry :: ExpenseEntry
defaultEntry = ExpenseEntry
{ getExpenseTag = []
, getExpenseCategory = Uncategorized
, getExpenseValue = 0
, getExpenseDescription = ""
} | 187 | defaultEntry :: ExpenseEntry
defaultEntry = ExpenseEntry
{ getExpenseTag = []
, getExpenseCategory = Uncategorized
, getExpenseValue = 0
, getExpenseDescription = ""
} | 187 | defaultEntry = ExpenseEntry
{ getExpenseTag = []
, getExpenseCategory = Uncategorized
, getExpenseValue = 0
, getExpenseDescription = ""
} | 158 | false | true | 0 | 8 | 42 | 43 | 25 | 18 | null | null |
kojiromike/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | pureTerm :: TT Name -> Bool
pureTerm (App _ f a) = pureTerm f && pureTerm a | 75 | pureTerm :: TT Name -> Bool
pureTerm (App _ f a) = pureTerm f && pureTerm a | 75 | pureTerm (App _ f a) = pureTerm f && pureTerm a | 47 | false | true | 0 | 9 | 16 | 46 | 20 | 26 | null | null |
TOSPIO/vtop | src/Core.hs | lgpl-3.0 | defaultStat :: Stat
defaultStat = Stat 0 0 0 0 0 0 0 0 0 0 | 58 | defaultStat :: Stat
defaultStat = Stat 0 0 0 0 0 0 0 0 0 0 | 58 | defaultStat = Stat 0 0 0 0 0 0 0 0 0 0 | 38 | false | true | 0 | 5 | 15 | 32 | 16 | 16 | null | null |
snapframework/cufp2011 | sample-implementation/Snap/Chat/API/Handlers.hs | bsd-3-clause | handleJoin :: Key
-> JoinRequest
-> ApiHandler (ApiResponse JoinResponse)
handleJoin key (JoinRequest userName) = do
(ask >>= joinUp) `catch` \(_ :: UserAlreadyConnectedException) -> do
return $ ApiResponseFailure (failureCode resp) (failureReason resp)
where
resp = JoinResponse... | 626 | handleJoin :: Key
-> JoinRequest
-> ApiHandler (ApiResponse JoinResponse)
handleJoin key (JoinRequest userName) = do
(ask >>= joinUp) `catch` \(_ :: UserAlreadyConnectedException) -> do
return $ ApiResponseFailure (failureCode resp) (failureReason resp)
where
resp = JoinResponse... | 626 | handleJoin key (JoinRequest userName) = do
(ask >>= joinUp) `catch` \(_ :: UserAlreadyConnectedException) -> do
return $ ApiResponseFailure (failureCode resp) (failureReason resp)
where
resp = JoinResponseUserAlreadyExists
joinUp chatRoom = do
user <- liftIO $ joinUser userName chatRoom
... | 529 | false | true | 0 | 14 | 130 | 153 | 74 | 79 | null | null |
rodrigosetti/master-plan | src/MasterPlan/Data.hs | mit | progress (Annotated _) = undefined | 37 | progress (Annotated _) = undefined | 37 | progress (Annotated _) = undefined | 37 | false | false | 0 | 7 | 7 | 15 | 7 | 8 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/types/Type.hs | bsd-3-clause | cmpTc :: TyCon -> TyCon -> Ordering
-- Here we treat * and Constraint as equal
-- See Note [Kind Constraint and kind *] in Kinds.lhs
--
-- Also we treat OpenTypeKind as equal to either * or #
-- See Note [Comparison with OpenTypeKind]
cmpTc tc1 tc2
| u1 == openTypeKindTyConKey, isSubOpenTypeKindKey u2 = EQ
| u2 == ... | 2,282 | cmpTc :: TyCon -> TyCon -> Ordering
cmpTc tc1 tc2
| u1 == openTypeKindTyConKey, isSubOpenTypeKindKey u2 = EQ
| u2 == openTypeKindTyConKey, isSubOpenTypeKindKey u1 = EQ
| otherwise = nu1 `compare` nu2
where
u1 = tyConUnique tc1
nu1 = if u1==constraintKindTyConKey then liftedTypeKindTyConKey else u1
... | 2,083 | cmpTc tc1 tc2
| u1 == openTypeKindTyConKey, isSubOpenTypeKindKey u2 = EQ
| u2 == openTypeKindTyConKey, isSubOpenTypeKindKey u1 = EQ
| otherwise = nu1 `compare` nu2
where
u1 = tyConUnique tc1
nu1 = if u1==constraintKindTyConKey then liftedTypeKindTyConKey else u1
u2 = tyConUnique tc2
nu2 = if u... | 2,047 | true | true | 2 | 8 | 637 | 152 | 75 | 77 | null | null |
feliposz/learning-stuff | haskell/learn_chapter9.hs | mit | upperB = B.pack [65..90] | 24 | upperB = B.pack [65..90] | 24 | upperB = B.pack [65..90] | 24 | false | false | 1 | 6 | 3 | 20 | 8 | 12 | null | null |
keithodulaigh/Hets | OWL2/StaticAnalysis.hs | gpl-2.0 | createSign :: [Frame] -> State Sign ()
createSign f = do
pm <- gets prefixMap
mapM_ (collectEntities . function Expand (StringMap pm)) f | 140 | createSign :: [Frame] -> State Sign ()
createSign f = do
pm <- gets prefixMap
mapM_ (collectEntities . function Expand (StringMap pm)) f | 140 | createSign f = do
pm <- gets prefixMap
mapM_ (collectEntities . function Expand (StringMap pm)) f | 101 | false | true | 0 | 12 | 26 | 64 | 30 | 34 | null | null |
conal/hermit | src/HERMIT/PrettyPrinter/GHC.hs | bsd-2-clause | ---------------------------------------------------------------------------
externals :: [External]
externals = [ external "ghc" pretty ["GHC pretty printer."] ] | 162 | externals :: [External]
externals = [ external "ghc" pretty ["GHC pretty printer."] ] | 85 | externals = [ external "ghc" pretty ["GHC pretty printer."] ] | 61 | true | true | 0 | 7 | 14 | 28 | 16 | 12 | null | null |
adinapoli/memento | src/Memento/GoogleCalendar.hs | mit | --------------------------------------------------------------------------------
calendarAPI :: Text
calendarAPI = "https://www.googleapis.com/calendar/v3/calendars/" | 166 | calendarAPI :: Text
calendarAPI = "https://www.googleapis.com/calendar/v3/calendars/" | 85 | calendarAPI = "https://www.googleapis.com/calendar/v3/calendars/" | 65 | true | true | 0 | 4 | 6 | 12 | 7 | 5 | null | null |
nickbart1980/pandoc | src/Text/Pandoc/Shared.hs | gpl-2.0 | compactify items =
case (init items, last items) of
(_,[]) -> items
(others, final) ->
case last final of
Para a -> case (filter isPara $ concat items) of
-- if this is only Para, change to Plain
[_] ->... | 603 | compactify items =
case (init items, last items) of
(_,[]) -> items
(others, final) ->
case last final of
Para a -> case (filter isPara $ concat items) of
-- if this is only Para, change to Plain
[_] ->... | 603 | compactify items =
case (init items, last items) of
(_,[]) -> items
(others, final) ->
case last final of
Para a -> case (filter isPara $ concat items) of
-- if this is only Para, change to Plain
[_] ->... | 603 | false | false | 1 | 18 | 257 | 133 | 67 | 66 | null | null |
pjones/xmonad-test | vendor/xmonad-contrib/XMonad/Util/WindowProperties.hs | bsd-2-clause | propertyToQuery (Const b) = return b | 36 | propertyToQuery (Const b) = return b | 36 | propertyToQuery (Const b) = return b | 36 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
arybczak/happstack-server | src/Happstack/Server/Response.hs | bsd-3-clause | -- | Same as @'setResponseCode' status >> return val@.
--
-- Use this if you want to set a response code that does not already
-- have a helper function.
--
-- > main = simpleHTTP nullConf $ resp 200 "Everything is OK"
resp :: (FilterMonad Response m) =>
Int -- ^ response code
-> b -- ^ value to return
... | 385 | resp :: (FilterMonad Response m) =>
Int -- ^ response code
-> b -- ^ value to return
-> m b
resp status val = setResponseCode status >> return val | 166 | resp status val = setResponseCode status >> return val | 54 | true | true | 0 | 8 | 92 | 56 | 31 | 25 | null | null |
chadbrewbaker/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | prop_checkUnquotedExpansions3a= verify checkUnquotedExpansions "[ ! $(foo) ]" | 77 | prop_checkUnquotedExpansions3a= verify checkUnquotedExpansions "[ ! $(foo) ]" | 77 | prop_checkUnquotedExpansions3a= verify checkUnquotedExpansions "[ ! $(foo) ]" | 77 | false | false | 0 | 5 | 6 | 11 | 5 | 6 | null | null |
mplamann/magic-spieler | src/State/Operations.hs | mit | allActivatedAbilities :: Monad m => StateT GameState m [(CardID, Ability)]
allActivatedAbilities = filteredAbilitiesOnField abilityIsActivated | 142 | allActivatedAbilities :: Monad m => StateT GameState m [(CardID, Ability)]
allActivatedAbilities = filteredAbilitiesOnField abilityIsActivated | 142 | allActivatedAbilities = filteredAbilitiesOnField abilityIsActivated | 67 | false | true | 0 | 8 | 13 | 37 | 19 | 18 | null | null |
CharlesRandles/cryptoChallenge | challenge12.hs | gpl-3.0 | randomKey :: B.ByteString
randomKey = B8.pack $ toString $ Prelude.take aesBlocksize $ base64Decode "abcdabcdabcdabcdabcdabcd" | 126 | randomKey :: B.ByteString
randomKey = B8.pack $ toString $ Prelude.take aesBlocksize $ base64Decode "abcdabcdabcdabcdabcdabcd" | 126 | randomKey = B8.pack $ toString $ Prelude.take aesBlocksize $ base64Decode "abcdabcdabcdabcdabcdabcd" | 100 | false | true | 0 | 8 | 13 | 35 | 17 | 18 | null | null |
keithodulaigh/Hets | OWL2/MS2Ship.hs | gpl-2.0 | classListFrame2Boxes :: Concept -> Maybe Relation -> ListFrameBit -> [TBox]
classListFrame2Boxes c mr lfb = case lfb of
ExpressionBit l -> let cs = map (ce2Concept . snd) l in case mr of
Just r -> case r of
SubClass -> map (ConceptDecl c . ConceptRel Less) cs
EDRelation ed -> map ((case ed of
... | 405 | classListFrame2Boxes :: Concept -> Maybe Relation -> ListFrameBit -> [TBox]
classListFrame2Boxes c mr lfb = case lfb of
ExpressionBit l -> let cs = map (ce2Concept . snd) l in case mr of
Just r -> case r of
SubClass -> map (ConceptDecl c . ConceptRel Less) cs
EDRelation ed -> map ((case ed of
... | 405 | classListFrame2Boxes c mr lfb = case lfb of
ExpressionBit l -> let cs = map (ce2Concept . snd) l in case mr of
Just r -> case r of
SubClass -> map (ConceptDecl c . ConceptRel Less) cs
EDRelation ed -> map ((case ed of
Disjoint -> disC
Equivalent -> eqC) c) cs
_ -> []
_ -> []
... | 329 | false | true | 2 | 18 | 117 | 175 | 85 | 90 | null | null |
bravit/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | pprintRaw bound (RApp f x) =
enclose lparen rparen . group . align . hang 2 . vsep $
[text "RApp", pprintRaw bound f, pprintRaw bound x] | 140 | pprintRaw bound (RApp f x) =
enclose lparen rparen . group . align . hang 2 . vsep $
[text "RApp", pprintRaw bound f, pprintRaw bound x] | 140 | pprintRaw bound (RApp f x) =
enclose lparen rparen . group . align . hang 2 . vsep $
[text "RApp", pprintRaw bound f, pprintRaw bound x] | 140 | false | false | 0 | 10 | 30 | 72 | 33 | 39 | null | null |
phischu/fragnix | builtins/base/GHC.IO.Buffer.hs | bsd-3-clause | readCharBufPtr :: Ptr CharBufElem -> Int -> IO (Char, Int)
readCharBufPtr p ix = do c <- peekElemOff (castPtr p) ix; return (c, ix+1)
| 135 | readCharBufPtr :: Ptr CharBufElem -> Int -> IO (Char, Int)
readCharBufPtr p ix = do c <- peekElemOff (castPtr p) ix; return (c, ix+1)
| 135 | readCharBufPtr p ix = do c <- peekElemOff (castPtr p) ix; return (c, ix+1)
| 76 | false | true | 0 | 10 | 25 | 71 | 35 | 36 | null | null |
DanielSchuessler/tuple-th | TupleTH.hs | bsd-3-clause | -- | Type of the generated expression:
--
-- > (a -> Bool) -> (a, ..) -> [a]
filterTuple :: Int -> ExpQ
filterTuple n = liftExpFun "p" (filterTuple' n) | 152 | filterTuple :: Int -> ExpQ
filterTuple n = liftExpFun "p" (filterTuple' n) | 75 | filterTuple n = liftExpFun "p" (filterTuple' n) | 47 | true | true | 0 | 7 | 30 | 39 | 18 | 21 | null | null |
ejconlon/webbing | src/Webbing/WebHerokuCopy.hs | mit | dbConnParams :: IO [(Text, Text)]
dbConnParams = dbConnParams' "DATABASE_URL" parseDatabaseUrl | 94 | dbConnParams :: IO [(Text, Text)]
dbConnParams = dbConnParams' "DATABASE_URL" parseDatabaseUrl | 94 | dbConnParams = dbConnParams' "DATABASE_URL" parseDatabaseUrl | 60 | false | true | 0 | 8 | 9 | 34 | 16 | 18 | null | null |
fffej/sql-server-gen | src/Database/SqlServer/Create/Sequence.hs | bsd-2-clause | renderMaxValue (Just n) = text "MAXVALUE" <+> integer n | 55 | renderMaxValue (Just n) = text "MAXVALUE" <+> integer n | 55 | renderMaxValue (Just n) = text "MAXVALUE" <+> integer n | 55 | false | false | 0 | 7 | 8 | 25 | 11 | 14 | null | null |
vektordev/GP | src/Dictionary.hs | gpl-2.0 | declarations = [] | 17 | declarations = [] | 17 | declarations = [] | 17 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
Lykos/Sara | tests/Sara/TestUtils/AstGenUtils.hs | gpl-3.0 | initialEnvWithPureness :: Bool -> GeneratorEnv
initialEnvWithPureness isPure = GeneratorEnv{ callables = M.empty, functions = M.empty, variables = M.empty, isPureEnv = isPure } | 176 | initialEnvWithPureness :: Bool -> GeneratorEnv
initialEnvWithPureness isPure = GeneratorEnv{ callables = M.empty, functions = M.empty, variables = M.empty, isPureEnv = isPure } | 176 | initialEnvWithPureness isPure = GeneratorEnv{ callables = M.empty, functions = M.empty, variables = M.empty, isPureEnv = isPure } | 129 | false | true | 0 | 7 | 21 | 50 | 29 | 21 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | emitPrimOp dflags res ReadOffAddrOp_Addr args = doIndexOffAddrOp Nothing (bWord dflags) res args | 110 | emitPrimOp dflags res ReadOffAddrOp_Addr args = doIndexOffAddrOp Nothing (bWord dflags) res args | 110 | emitPrimOp dflags res ReadOffAddrOp_Addr args = doIndexOffAddrOp Nothing (bWord dflags) res args | 110 | false | false | 0 | 7 | 25 | 30 | 14 | 16 | null | null |
joelwilliamson/validator | Maker.hs | agpl-3.0 | excludeKeys keys = Maker $ \t → if rootLabel t `notElem` map Label keys
then Right $ rootLabel t
else Left (("Root label excluded: " <> show' (rootLabel t), source t)
, KeyNotFound) | 288 | excludeKeys keys = Maker $ \t → if rootLabel t `notElem` map Label keys
then Right $ rootLabel t
else Left (("Root label excluded: " <> show' (rootLabel t), source t)
, KeyNotFound) | 288 | excludeKeys keys = Maker $ \t → if rootLabel t `notElem` map Label keys
then Right $ rootLabel t
else Left (("Root label excluded: " <> show' (rootLabel t), source t)
, KeyNotFound) | 288 | false | false | 0 | 14 | 139 | 78 | 40 | 38 | null | null |
ekmett/data-store | src/Data/Store/Internal/Index.hs | bsd-3-clause | delete [k] oid (Index imap) = Index $ deleteFromSet oid (Unsafe.unsafeCoerce k) imap | 84 | delete [k] oid (Index imap) = Index $ deleteFromSet oid (Unsafe.unsafeCoerce k) imap | 84 | delete [k] oid (Index imap) = Index $ deleteFromSet oid (Unsafe.unsafeCoerce k) imap | 84 | false | false | 0 | 9 | 12 | 41 | 20 | 21 | null | null |
tphyahoo/gititpt | Network/Gitit/Authentication.hs | gpl-2.0 | resetPasswordRequest :: Params -> Handler
resetPasswordRequest params = do
let uname = pUsername params
mbUser <- getUser uname
let errors = case mbUser of
Nothing -> ["Unknown user. Please re-register " ++
"or press the Back button to try again."]
Just u -> ["Since you did no... | 1,345 | resetPasswordRequest :: Params -> Handler
resetPasswordRequest params = do
let uname = pUsername params
mbUser <- getUser uname
let errors = case mbUser of
Nothing -> ["Unknown user. Please re-register " ++
"or press the Back button to try again."]
Just u -> ["Since you did no... | 1,345 | resetPasswordRequest params = do
let uname = pUsername params
mbUser <- getUser uname
let errors = case mbUser of
Nothing -> ["Unknown user. Please re-register " ++
"or press the Back button to try again."]
Just u -> ["Since you did not register with " ++
"a... | 1,303 | false | true | 0 | 17 | 597 | 232 | 118 | 114 | null | null |
TOSPIO/yi | src/library/Yi/Buffer/Misc.hs | gpl-2.0 | startUpdateTransactionB :: BufferM ()
startUpdateTransactionB = do
transactionPresent <- use updateTransactionInFlightA
if transactionPresent
then error "Already started update transaction"
else do
undosA %= addChangeU InteractivePoint
assign updateTransactionInFlightA True | 290 | startUpdateTransactionB :: BufferM ()
startUpdateTransactionB = do
transactionPresent <- use updateTransactionInFlightA
if transactionPresent
then error "Already started update transaction"
else do
undosA %= addChangeU InteractivePoint
assign updateTransactionInFlightA True | 290 | startUpdateTransactionB = do
transactionPresent <- use updateTransactionInFlightA
if transactionPresent
then error "Already started update transaction"
else do
undosA %= addChangeU InteractivePoint
assign updateTransactionInFlightA True | 252 | false | true | 0 | 11 | 43 | 58 | 26 | 32 | null | null |
veskoy/functional-programming-fmi | Project/TicTacToe.hs | gpl-3.0 | createEmptyBoard :: Board
createEmptyBoard = Board [Right 1, Right 2, Right 3] [Right 4, Right 5, Right 6] [Right 7, Right 8, Right 9] | 134 | createEmptyBoard :: Board
createEmptyBoard = Board [Right 1, Right 2, Right 3] [Right 4, Right 5, Right 6] [Right 7, Right 8, Right 9] | 134 | createEmptyBoard = Board [Right 1, Right 2, Right 3] [Right 4, Right 5, Right 6] [Right 7, Right 8, Right 9] | 108 | false | true | 0 | 7 | 23 | 72 | 36 | 36 | null | null |
lkania/Haskitter | src/Site.hs | mit | feedHandler :: User -> ExceptT Error AppHandler [Post]
feedHandler user = getFollowedPostsByUserId user | 104 | feedHandler :: User -> ExceptT Error AppHandler [Post]
feedHandler user = getFollowedPostsByUserId user | 103 | feedHandler user = getFollowedPostsByUserId user | 48 | false | true | 0 | 8 | 13 | 35 | 16 | 19 | null | null |
Pold87/Haggressive | testsuite/tests/My.hs | gpl-2.0 | tup2 = ("a", "b", "c", "d", "e") | 32 | tup2 = ("a", "b", "c", "d", "e") | 32 | tup2 = ("a", "b", "c", "d", "e") | 32 | false | false | 0 | 5 | 6 | 21 | 13 | 8 | null | null |
brendanhay/gogol | gogol-sqladmin/gen/Network/Google/SQLAdmin/Types/Product.hs | mpl-2.0 | -- | The type of the flag. Flags are typed to being **BOOLEAN**, **STRING**,
-- **INTEGER** or **NONE**. **NONE** is used for flags which do not take a
-- value, such as **skip_grant_tables**.
fType :: Lens' Flag (Maybe FlagType)
fType = lens _fType (\ s a -> s{_fType = a}) | 274 | fType :: Lens' Flag (Maybe FlagType)
fType = lens _fType (\ s a -> s{_fType = a}) | 81 | fType = lens _fType (\ s a -> s{_fType = a}) | 44 | true | true | 1 | 9 | 49 | 53 | 27 | 26 | null | null |
jfischoff/th-instances | src/Language/Haskell/TH/LiftInstances.hs | bsd-3-clause | unfold_kinds' (ArrowK x y) i accum = unfold_kinds' y (i - 1) (x:accum) | 70 | unfold_kinds' (ArrowK x y) i accum = unfold_kinds' y (i - 1) (x:accum) | 70 | unfold_kinds' (ArrowK x y) i accum = unfold_kinds' y (i - 1) (x:accum) | 70 | false | false | 0 | 7 | 12 | 42 | 21 | 21 | null | null |
noteed/mojito | Language/Mojito/Syntax/ExprBuilder.hs | bsd-3-clause | buildExpr :: MonadError String m => SExpr -> ExprT m (Expr Int)
buildExpr e = case e of
List [Sym "::", a, b] -> do
i <- newId
a' <- buildExpr a
b' <- toSimple b
return $ HasType i a' b'
List [Sym "let", List [Sym o, a], b] -> do
i <- newId
a' <- buildExpr a
b' <- buildExpr b
return ... | 1,529 | buildExpr :: MonadError String m => SExpr -> ExprT m (Expr Int)
buildExpr e = case e of
List [Sym "::", a, b] -> do
i <- newId
a' <- buildExpr a
b' <- toSimple b
return $ HasType i a' b'
List [Sym "let", List [Sym o, a], b] -> do
i <- newId
a' <- buildExpr a
b' <- buildExpr b
return ... | 1,529 | buildExpr e = case e of
List [Sym "::", a, b] -> do
i <- newId
a' <- buildExpr a
b' <- toSimple b
return $ HasType i a' b'
List [Sym "let", List [Sym o, a], b] -> do
i <- newId
a' <- buildExpr a
b' <- buildExpr b
return $ Let i (Def o a') b'
List [Sym "let", List a@[List (Sym f:xs@... | 1,465 | false | true | 14 | 15 | 493 | 805 | 372 | 433 | null | null |
mukeshtiwari/formalized-voting | paper-code/schulze-voting/src/Derivation.hs | mit | haskInt :: Nat -> P.Int
haskInt O = 0 | 37 | haskInt :: Nat -> P.Int
haskInt O = 0 | 37 | haskInt O = 0 | 13 | false | true | 0 | 6 | 8 | 20 | 10 | 10 | null | null |
amccausl/Swish | Swish/HaskellRDF/GraphTest.hs | lgpl-2.1 | t61006 = toStatement v210 p5 v206 | 33 | t61006 = toStatement v210 p5 v206 | 33 | t61006 = toStatement v210 p5 v206 | 33 | false | false | 0 | 5 | 5 | 13 | 6 | 7 | null | null |
kamilc/Snaplet-Tasks | src/Snap/Snaplet/Tasks/Internal.hs | bsd-3-clause | -- | This function reads options from command line
-- and if it sees any options after "T" it
-- tries to compile them into task.
taskFromCommandLine :: IO (Maybe Task)
taskFromCommandLine = do
_args <- return . dropWhile ((/=) "T") =<< getArgs
case _args of
[] -> return Nothing
xs ->
case null $... | 1,986 | taskFromCommandLine :: IO (Maybe Task)
taskFromCommandLine = do
_args <- return . dropWhile ((/=) "T") =<< getArgs
case _args of
[] -> return Nothing
xs ->
case null $ tail xs of
True -> return Nothing
False -> return $ Just $ taskForArgs $ tail xs
where
taskForArgs :: [String]... | 1,852 | taskFromCommandLine = do
_args <- return . dropWhile ((/=) "T") =<< getArgs
case _args of
[] -> return Nothing
xs ->
case null $ tail xs of
True -> return Nothing
False -> return $ Just $ taskForArgs $ tail xs
where
taskForArgs :: [String] -> Task
taskForArgs args = Task
... | 1,813 | true | true | 29 | 15 | 563 | 456 | 239 | 217 | null | null |
radelac/zebaki | Zebaki.hs | unlicense | run :: Net ()
run = do
write "NICK" nick
write "USER" (nick ++ " 0 * :tutorial bot")
write "JOIN" chan
asks socket >>= listen
--
-- Process each line from the server
-- | 185 | run :: Net ()
run = do
write "NICK" nick
write "USER" (nick ++ " 0 * :tutorial bot")
write "JOIN" chan
asks socket >>= listen
--
-- Process each line from the server
-- | 185 | run = do
write "NICK" nick
write "USER" (nick ++ " 0 * :tutorial bot")
write "JOIN" chan
asks socket >>= listen
--
-- Process each line from the server
-- | 171 | false | true | 1 | 9 | 51 | 64 | 28 | 36 | null | null |
logistark/haskellbookexercises | 6 - Typeclasses/chapter6.hs | apache-2.0 | divideThenAdd :: Fractional a => a -> a -> a
divideThenAdd x y = (x / y) + 1 | 78 | divideThenAdd :: Fractional a => a -> a -> a
divideThenAdd x y = (x / y) + 1 | 76 | divideThenAdd x y = (x / y) + 1 | 31 | false | true | 0 | 7 | 20 | 42 | 21 | 21 | null | null |
crufter/haquery | src/Haquery.hs | bsd-3-clause | setIndex :: Int -> Tag -> Tag
setIndex i t = case t of
Doctype ind te -> Doctype (i:ind) te
Text ind te -> Text (i:ind) te
Tag ind te a c -> Tag (i:ind) te a $ map (setIndex i) c | 196 | setIndex :: Int -> Tag -> Tag
setIndex i t = case t of
Doctype ind te -> Doctype (i:ind) te
Text ind te -> Text (i:ind) te
Tag ind te a c -> Tag (i:ind) te a $ map (setIndex i) c | 196 | setIndex i t = case t of
Doctype ind te -> Doctype (i:ind) te
Text ind te -> Text (i:ind) te
Tag ind te a c -> Tag (i:ind) te a $ map (setIndex i) c | 166 | false | true | 0 | 11 | 60 | 123 | 58 | 65 | null | null |
christiaanb/clash-compiler | clash-lib/src/CLaSH/Core/Util.hs | bsd-2-clause | -- | Abstract a term over a list of type variables
mkLams :: Term
-> [Id]
-> Term
mkLams tm = mkAbstraction tm . map Left | 135 | mkLams :: Term
-> [Id]
-> Term
mkLams tm = mkAbstraction tm . map Left | 84 | mkLams tm = mkAbstraction tm . map Left | 39 | true | true | 0 | 7 | 39 | 36 | 18 | 18 | null | null |
tomahawkins/ecu | src/Commit.hs | bsd-3-clause | format :: String -> String
format a | any (flip elem " \"") a = "\"" ++ concat [ if c == '"' then "\\\"" else [c] | c <- a ] ++ "\""
| otherwise = a | 157 | format :: String -> String
format a | any (flip elem " \"") a = "\"" ++ concat [ if c == '"' then "\\\"" else [c] | c <- a ] ++ "\""
| otherwise = a | 157 | format a | any (flip elem " \"") a = "\"" ++ concat [ if c == '"' then "\\\"" else [c] | c <- a ] ++ "\""
| otherwise = a | 130 | false | true | 0 | 11 | 46 | 83 | 41 | 42 | null | null |
chengzh2008/hpffp | src/ch28-BasicLibraries/criterionExample.hs | bsd-3-clause | (x:_) !? 0 = Just x | 19 | (x:_) !? 0 = Just x | 19 | (x:_) !? 0 = Just x | 19 | false | false | 0 | 7 | 5 | 22 | 10 | 12 | null | null |
jfrikker/crawlstats | src/Crawl/Stats/Stats.hs | bsd-3-clause | parseRead :: (Read f) => CSV.Field -> CSV.Parser f
parseRead = mfromMaybe . readMaybe . unpack | 94 | parseRead :: (Read f) => CSV.Field -> CSV.Parser f
parseRead = mfromMaybe . readMaybe . unpack | 94 | parseRead = mfromMaybe . readMaybe . unpack | 43 | false | true | 0 | 8 | 15 | 39 | 20 | 19 | null | null |
argiopetech/help | bench/bench-main.hs | bsd-3-clause | bench_singleRecord :: Benchmark
bench_singleRecord = let parser = makeRecordParser $ "%s_`message`"
in bench "Single-record" $ whnf (parse parser) singleLog | 177 | bench_singleRecord :: Benchmark
bench_singleRecord = let parser = makeRecordParser $ "%s_`message`"
in bench "Single-record" $ whnf (parse parser) singleLog | 177 | bench_singleRecord = let parser = makeRecordParser $ "%s_`message`"
in bench "Single-record" $ whnf (parse parser) singleLog | 145 | false | true | 0 | 9 | 39 | 50 | 22 | 28 | null | null |
brendanhay/gogol | gogol-dataflow/gen/Network/Google/Dataflow/Types/Product.hs | mpl-2.0 | -- | Index of the inner source.
cpIndex :: Lens' ConcatPosition (Maybe Int32)
cpIndex
= lens _cpIndex (\ s a -> s{_cpIndex = a}) .
mapping _Coerce | 154 | cpIndex :: Lens' ConcatPosition (Maybe Int32)
cpIndex
= lens _cpIndex (\ s a -> s{_cpIndex = a}) .
mapping _Coerce | 122 | cpIndex
= lens _cpIndex (\ s a -> s{_cpIndex = a}) .
mapping _Coerce | 76 | true | true | 0 | 10 | 34 | 55 | 28 | 27 | null | null |
shicks/shsh | Language/Sh/Parser/Parsec.hs | bsd-3-clause | string (c:cs) = do c' <- char c
fmap (c':) $ string cs -- errors should work correctly... | 108 | string (c:cs) = do c' <- char c
fmap (c':) $ string cs -- errors should work correctly... | 108 | string (c:cs) = do c' <- char c
fmap (c':) $ string cs -- errors should work correctly... | 108 | false | false | 0 | 9 | 36 | 45 | 21 | 24 | null | null |
rohitjha/DiMPL | src/Logic.hs | bsd-2-clause | {-|
The '/\' operator is the binary AND operator.
For example:
>>> True /\ True
True
>>> True /\ False
False
>>> False /\ True
False
>>> False /\ False
False
-}
(/\) :: Bool -> Bool -> Bool
a /\ b = a && b | 270 | (/\) :: Bool -> Bool -> Bool
a /\ b = a && b | 44 | a /\ b = a && b | 15 | true | true | 0 | 9 | 110 | 37 | 18 | 19 | null | null |
ejlilley/AbstractMusic | Csound.hs | gpl-3.0 | csoundPhrase n (d:notes) = csoundPhrase n notes | 47 | csoundPhrase n (d:notes) = csoundPhrase n notes | 47 | csoundPhrase n (d:notes) = csoundPhrase n notes | 47 | false | false | 0 | 6 | 6 | 25 | 11 | 14 | null | null |
sinelaw/lamdu | bottlelib/Graphics/UI/Bottle/Direction.hs | gpl-3.0 | coordinates :: Lens.Traversal' Direction Rect
coordinates _ Outside = pure Outside | 82 | coordinates :: Lens.Traversal' Direction Rect
coordinates _ Outside = pure Outside | 82 | coordinates _ Outside = pure Outside | 36 | false | true | 0 | 6 | 10 | 26 | 12 | 14 | null | null |
gspia/reflex-dom-htmlea | lib/src/Reflex/Dom/HTML5/Elements/Elements.hs | bsd-3-clause | -- | A short-hand notion for @ elDynAttr\' \"ol\" ... @
olD' ∷ forall t m a. (DomBuilder t m, PostBuild t m) ⇒ Dynamic t Ol → m a → m (Element EventResult (DomBuilderSpace m) t, a)
olD' bm = elDynAttr' "ol" (A.attrMap <$> bm) | 226 | olD' ∷ forall t m a. (DomBuilder t m, PostBuild t m) ⇒ Dynamic t Ol → m a → m (Element EventResult (DomBuilderSpace m) t, a)
olD' bm = elDynAttr' "ol" (A.attrMap <$> bm) | 170 | olD' bm = elDynAttr' "ol" (A.attrMap <$> bm) | 45 | true | true | 0 | 14 | 46 | 97 | 49 | 48 | null | null |
kwibus/myLang | src/ModificationTags.hs | bsd-3-clause | depthChange (Tag.Let _ defs _) = length defs | 44 | depthChange (Tag.Let _ defs _) = length defs | 44 | depthChange (Tag.Let _ defs _) = length defs | 44 | false | false | 0 | 7 | 7 | 25 | 11 | 14 | null | null |
ahmadsalim/p3-tool | p3-tool/TVL/Pretty.hs | gpl-3.0 | prettyExpr (BuiltinFun nm (Right cid)) = text nm <+> parens (prettyChildrenId cid) | 82 | prettyExpr (BuiltinFun nm (Right cid)) = text nm <+> parens (prettyChildrenId cid) | 82 | prettyExpr (BuiltinFun nm (Right cid)) = text nm <+> parens (prettyChildrenId cid) | 82 | false | false | 0 | 9 | 11 | 39 | 18 | 21 | null | null |
nlogax/norby | src/Commands.hs | bsd-3-clause | matchPrefix' :: ByteString -> (Message -> Net ()) -> Message -> Net ()
matchPrefix' pfx a msg = match msg p a
where
p (Message (Just (User n _ _)) _ (_:x:_)) = n `elem` admins && pfx `isPrefixOf` x
p _ = False | 257 | matchPrefix' :: ByteString -> (Message -> Net ()) -> Message -> Net ()
matchPrefix' pfx a msg = match msg p a
where
p (Message (Just (User n _ _)) _ (_:x:_)) = n `elem` admins && pfx `isPrefixOf` x
p _ = False | 257 | matchPrefix' pfx a msg = match msg p a
where
p (Message (Just (User n _ _)) _ (_:x:_)) = n `elem` admins && pfx `isPrefixOf` x
p _ = False | 186 | false | true | 0 | 11 | 91 | 133 | 65 | 68 | null | null |
sdiehl/ghc | compiler/llvmGen/Llvm/Types.hs | bsd-3-clause | ppName v@(LMLocalVar {}) = char '%' <> ppPlainName v | 53 | ppName v@(LMLocalVar {}) = char '%' <> ppPlainName v | 53 | ppName v@(LMLocalVar {}) = char '%' <> ppPlainName v | 53 | false | false | 0 | 8 | 9 | 29 | 14 | 15 | null | null |
shlevy/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | pprSkolInfo (PatSkol cl mc) = sep [ pprPatSkolInfo cl
, text "in" <+> pprMatchContext mc ] | 128 | pprSkolInfo (PatSkol cl mc) = sep [ pprPatSkolInfo cl
, text "in" <+> pprMatchContext mc ] | 128 | pprSkolInfo (PatSkol cl mc) = sep [ pprPatSkolInfo cl
, text "in" <+> pprMatchContext mc ] | 128 | false | false | 0 | 7 | 53 | 40 | 18 | 22 | null | null |
pranjaltale16/codeworld | codeworld-api/src/CodeWorld/Picture.hs | apache-2.0 | -- | The CodeWorld logo.
codeWorldLogo :: HasCallStack => Picture
codeWorldLogo = Logo (getDebugSrcLoc callStack) | 113 | codeWorldLogo :: HasCallStack => Picture
codeWorldLogo = Logo (getDebugSrcLoc callStack) | 88 | codeWorldLogo = Logo (getDebugSrcLoc callStack) | 47 | true | true | 0 | 7 | 14 | 26 | 13 | 13 | null | null |
lukemaurer/sequent-core | src/Language/SequentCore/Syntax/Util.hs | bsd-3-clause | mergeAlts (a1:as1) (a2:as2)
= case a1 `cmpAlt` a2 of
LT -> a1 : mergeAlts as1 (a2:as2)
EQ -> a1 : mergeAlts as1 as2 -- Discard a2
GT -> a2 : mergeAlts (a1:as1) as2
--------------------------------- | 241 | mergeAlts (a1:as1) (a2:as2)
= case a1 `cmpAlt` a2 of
LT -> a1 : mergeAlts as1 (a2:as2)
EQ -> a1 : mergeAlts as1 as2 -- Discard a2
GT -> a2 : mergeAlts (a1:as1) as2
--------------------------------- | 241 | mergeAlts (a1:as1) (a2:as2)
= case a1 `cmpAlt` a2 of
LT -> a1 : mergeAlts as1 (a2:as2)
EQ -> a1 : mergeAlts as1 as2 -- Discard a2
GT -> a2 : mergeAlts (a1:as1) as2
--------------------------------- | 241 | false | false | 0 | 11 | 77 | 96 | 50 | 46 | null | null |
dbp/thistle | src/Lexer.hs | isc | lexer ('<':cs) = TokenAO : lexer cs | 35 | lexer ('<':cs) = TokenAO : lexer cs | 35 | lexer ('<':cs) = TokenAO : lexer cs | 35 | false | false | 0 | 7 | 6 | 23 | 11 | 12 | null | null |
jmaessen/Data.FastSequence | src/Data/FastSequence.hs | bsd-3-clause | index' (Root s l d r) i
| i < sl = indexN i l
| i < sld = uncurry indexN (index' d (i - sl))
| otherwise = indexN (i - sld) r
where sl = size l
sld = sl + size d
-- Again, we might have a Node (Node a) here, in which
-- case each element will cover multiple indices. As a
-- result we return the residu... | 386 | index' (Root s l d r) i
| i < sl = indexN i l
| i < sld = uncurry indexN (index' d (i - sl))
| otherwise = indexN (i - sld) r
where sl = size l
sld = sl + size d
-- Again, we might have a Node (Node a) here, in which
-- case each element will cover multiple indices. As a
-- result we return the residu... | 386 | index' (Root s l d r) i
| i < sl = indexN i l
| i < sld = uncurry indexN (index' d (i - sl))
| otherwise = indexN (i - sld) r
where sl = size l
sld = sl + size d
-- Again, we might have a Node (Node a) here, in which
-- case each element will cover multiple indices. As a
-- result we return the residu... | 386 | false | false | 1 | 10 | 103 | 129 | 61 | 68 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.