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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
GaloisInc/halvm-ghc | compiler/coreSyn/TrieMap.hs | bsd-3-clause | lkA env (DataAlt dc, bs, rhs) = am_data >.> lkDNamed dc
>=> lkG (D (extendCMEs env bs) rhs) | 131 | lkA env (DataAlt dc, bs, rhs) = am_data >.> lkDNamed dc
>=> lkG (D (extendCMEs env bs) rhs) | 131 | lkA env (DataAlt dc, bs, rhs) = am_data >.> lkDNamed dc
>=> lkG (D (extendCMEs env bs) rhs) | 131 | false | false | 0 | 10 | 57 | 53 | 26 | 27 | null | null |
Fermat/higher-rank | src/Matching.hs | bsd-3-clause | convert :: Exp -> Exp
-- convert (Pos _ e) = convert e
convert (Imply x y) = App (App (Const "->" dummyPos) (convert x)) (convert y) | 132 | convert :: Exp -> Exp
convert (Imply x y) = App (App (Const "->" dummyPos) (convert x)) (convert y) | 99 | convert (Imply x y) = App (App (Const "->" dummyPos) (convert x)) (convert y) | 77 | true | true | 0 | 9 | 26 | 64 | 31 | 33 | null | null |
mdsteele/fallback | src/Fallback/Data/Point.hs | gpl-3.0 | dirDelta DirSE = Point 1 1 | 31 | dirDelta DirSE = Point 1 1 | 31 | dirDelta DirSE = Point 1 1 | 31 | false | false | 0 | 5 | 10 | 14 | 6 | 8 | null | null |
carlostome/shrdlite | haskell/Popper.hs | gpl-3.0 | goalInEff :: (Conjunct,Action) -> Action -> Bool
goalInEff goal (Action _ _ effs) = elem (fst goal) effs | 104 | goalInEff :: (Conjunct,Action) -> Action -> Bool
goalInEff goal (Action _ _ effs) = elem (fst goal) effs | 104 | goalInEff goal (Action _ _ effs) = elem (fst goal) effs | 55 | false | true | 0 | 7 | 17 | 51 | 26 | 25 | null | null |
ezyang/ghc | compiler/basicTypes/IdInfo.hs | bsd-3-clause | {-
************************************************************************
* *
\subsection{Bulk operations on IdInfo}
* *
************************************************************************
-}
-- | This is used to remove information on lambda binders that we have
-- setup as part of a lambda group, assuming they will be applied all at once,
-- but turn out to be part of an unsaturated lambda as in e.g:
--
-- > (\x1. \x2. e) arg1
zapLamInfo :: IdInfo -> Maybe IdInfo
zapLamInfo info@(IdInfo {occInfo = occ, demandInfo = demand})
| is_safe_occ occ && is_safe_dmd demand
= Nothing
| otherwise
= Just (info {occInfo = safe_occ, demandInfo = topDmd})
where
-- The "unsafe" occ info is the ones that say I'm not in a lambda
-- because that might not be true for an unsaturated lambda
is_safe_occ occ | isAlwaysTailCalled occ = False
is_safe_occ (OneOcc { occ_in_lam = in_lam }) = in_lam
is_safe_occ _other = True
safe_occ = case occ of
OneOcc{} -> occ { occ_in_lam = True
, occ_tail = NoTailCallInfo }
IAmALoopBreaker{}
-> occ { occ_tail = NoTailCallInfo }
_other -> occ
is_safe_dmd dmd = not (isStrictDmd dmd)
-- | Remove all demand info on the 'IdInfo' | 1,492 | zapLamInfo :: IdInfo -> Maybe IdInfo
zapLamInfo info@(IdInfo {occInfo = occ, demandInfo = demand})
| is_safe_occ occ && is_safe_dmd demand
= Nothing
| otherwise
= Just (info {occInfo = safe_occ, demandInfo = topDmd})
where
-- The "unsafe" occ info is the ones that say I'm not in a lambda
-- because that might not be true for an unsaturated lambda
is_safe_occ occ | isAlwaysTailCalled occ = False
is_safe_occ (OneOcc { occ_in_lam = in_lam }) = in_lam
is_safe_occ _other = True
safe_occ = case occ of
OneOcc{} -> occ { occ_in_lam = True
, occ_tail = NoTailCallInfo }
IAmALoopBreaker{}
-> occ { occ_tail = NoTailCallInfo }
_other -> occ
is_safe_dmd dmd = not (isStrictDmd dmd)
-- | Remove all demand info on the 'IdInfo' | 914 | zapLamInfo info@(IdInfo {occInfo = occ, demandInfo = demand})
| is_safe_occ occ && is_safe_dmd demand
= Nothing
| otherwise
= Just (info {occInfo = safe_occ, demandInfo = topDmd})
where
-- The "unsafe" occ info is the ones that say I'm not in a lambda
-- because that might not be true for an unsaturated lambda
is_safe_occ occ | isAlwaysTailCalled occ = False
is_safe_occ (OneOcc { occ_in_lam = in_lam }) = in_lam
is_safe_occ _other = True
safe_occ = case occ of
OneOcc{} -> occ { occ_in_lam = True
, occ_tail = NoTailCallInfo }
IAmALoopBreaker{}
-> occ { occ_tail = NoTailCallInfo }
_other -> occ
is_safe_dmd dmd = not (isStrictDmd dmd)
-- | Remove all demand info on the 'IdInfo' | 877 | true | true | 7 | 9 | 519 | 237 | 120 | 117 | null | null |
10sr/scheme_hs | main.hs | mit | unpackNum notNum = throwError $ TypeMismatch "number" notNum | 60 | unpackNum notNum = throwError $ TypeMismatch "number" notNum | 60 | unpackNum notNum = throwError $ TypeMismatch "number" notNum | 60 | false | false | 1 | 6 | 7 | 21 | 8 | 13 | null | null |
marcellussiegburg/autotool | collection/src/Lambda/Derive2.hs | gpl-2.0 | derive2 :: Bool -> Lambda -> [ Step ] -> Reporter Lambda
derive2 drawing t steps = do
t' <- foldM (step drawing) t steps
inform $ vcat [ text "Ergebnis der Ableitung ist", nest 4 $ toDoc t' ]
return t' | 213 | derive2 :: Bool -> Lambda -> [ Step ] -> Reporter Lambda
derive2 drawing t steps = do
t' <- foldM (step drawing) t steps
inform $ vcat [ text "Ergebnis der Ableitung ist", nest 4 $ toDoc t' ]
return t' | 213 | derive2 drawing t steps = do
t' <- foldM (step drawing) t steps
inform $ vcat [ text "Ergebnis der Ableitung ist", nest 4 $ toDoc t' ]
return t' | 156 | false | true | 0 | 12 | 53 | 96 | 43 | 53 | null | null |
tanishiking/HasC | src/AssignAddr.hs | mit | assignIStmt (ICompoundStmt decls stmts) = do
fp <- getFp
let requiredWords = map (calcWords . getTypeFromIVar) decls
declsAddress <- mapM assignFpWords requiredWords
mapM_ pushVar $ zip decls declsAddress
stmts' <- mapM assignIStmt stmts
resetFp fp
return $ ICompoundStmt (map VarAddr declsAddress) stmts' | 319 | assignIStmt (ICompoundStmt decls stmts) = do
fp <- getFp
let requiredWords = map (calcWords . getTypeFromIVar) decls
declsAddress <- mapM assignFpWords requiredWords
mapM_ pushVar $ zip decls declsAddress
stmts' <- mapM assignIStmt stmts
resetFp fp
return $ ICompoundStmt (map VarAddr declsAddress) stmts' | 319 | assignIStmt (ICompoundStmt decls stmts) = do
fp <- getFp
let requiredWords = map (calcWords . getTypeFromIVar) decls
declsAddress <- mapM assignFpWords requiredWords
mapM_ pushVar $ zip decls declsAddress
stmts' <- mapM assignIStmt stmts
resetFp fp
return $ ICompoundStmt (map VarAddr declsAddress) stmts' | 319 | false | false | 0 | 12 | 55 | 111 | 48 | 63 | null | null |
dterei/Scraps | haskell/lenses/Types.hs | bsd-3-clause | -- # Holes: Editing focus value
over :: (c -> d) -> PairZipper a b c -> PairZipper a b d
over f (PZ c l) = PZ (f c) l | 118 | over :: (c -> d) -> PairZipper a b c -> PairZipper a b d
over f (PZ c l) = PZ (f c) l | 85 | over f (PZ c l) = PZ (f c) l | 28 | true | true | 0 | 7 | 31 | 65 | 32 | 33 | null | null |
mattias-lundell/timber-llvm | src/Reduce.hs | bsd-3-clause | plus gs (Left a) b = return b | 50 | plus gs (Left a) b = return b | 50 | plus gs (Left a) b = return b | 50 | false | false | 0 | 7 | 28 | 22 | 10 | 12 | null | null |
baldore/haskell-99-exercises | 25.hs | mit | rndPermutationG ls gen =
let (i,g) = randomR (0, length ls - 1) gen
(x,xs) = removeAt i ls
in x : rndPermutationG (reverse xs) g | 139 | rndPermutationG ls gen =
let (i,g) = randomR (0, length ls - 1) gen
(x,xs) = removeAt i ls
in x : rndPermutationG (reverse xs) g | 139 | rndPermutationG ls gen =
let (i,g) = randomR (0, length ls - 1) gen
(x,xs) = removeAt i ls
in x : rndPermutationG (reverse xs) g | 139 | false | false | 3 | 12 | 36 | 85 | 39 | 46 | null | null |
mcschroeder/ghc | compiler/basicTypes/RdrName.hs | bsd-3-clause | isExact _ = False | 25 | isExact _ = False | 25 | isExact _ = False | 25 | false | false | 0 | 4 | 11 | 10 | 4 | 6 | null | null |
arnizamani/DLvalidity | DLvalidity.hs | gpl-2.0 | maxDm :: [(WM,(RuleD,Maybe Fi))] -> Int
maxDm [] = 0 | 52 | maxDm :: [(WM,(RuleD,Maybe Fi))] -> Int
maxDm [] = 0 | 52 | maxDm [] = 0 | 12 | false | true | 0 | 9 | 9 | 38 | 21 | 17 | null | null |
expipiplus1/spir-v | Language/SpirV/OpCode.hs | mit | instructionSize OpCopyMemorySized = Fixed 4 | 43 | instructionSize OpCopyMemorySized = Fixed 4 | 43 | instructionSize OpCopyMemorySized = Fixed 4 | 43 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
mtak/chess-hs | src/Chess.hs | mit | newChess :: Chess
newChess = newChess' newBoard L | 49 | newChess :: Chess
newChess = newChess' newBoard L | 49 | newChess = newChess' newBoard L | 31 | false | true | 0 | 6 | 7 | 22 | 9 | 13 | null | null |
sjpet/quark | src/Quark/Buffer.hs | mit | -- Copy selection
selection :: Buffer -> T.Text
selection (Buffer s _ crs sel) = T.take l $ T.drop k s
where
l = abs $ distance crs sel s
k = cursorToIx (min crs sel) s | 178 | selection :: Buffer -> T.Text
selection (Buffer s _ crs sel) = T.take l $ T.drop k s
where
l = abs $ distance crs sel s
k = cursorToIx (min crs sel) s | 160 | selection (Buffer s _ crs sel) = T.take l $ T.drop k s
where
l = abs $ distance crs sel s
k = cursorToIx (min crs sel) s | 130 | true | true | 3 | 7 | 46 | 93 | 43 | 50 | null | null |
bvdelft/parac2 | src/Language/Java/Paragon/Interaction.hs | bsd-3-clause | typeCheckerBase = libraryBase ++ ".TypeCheck" | 45 | typeCheckerBase = libraryBase ++ ".TypeCheck" | 45 | typeCheckerBase = libraryBase ++ ".TypeCheck" | 45 | false | false | 1 | 5 | 4 | 13 | 5 | 8 | null | null |
haskell-distributed/distributed-process-execution | src/Control/Distributed/Process/Execution/Exchange/Internal.hs | bsd-3-clause | runExchange :: forall s.
ExchangeType s
-> MVar (ControlPort ControlMessage)
-> Process ()
runExchange t tc = MP.chanServe t exInit (processDefinition t tc) | 195 | runExchange :: forall s.
ExchangeType s
-> MVar (ControlPort ControlMessage)
-> Process ()
runExchange t tc = MP.chanServe t exInit (processDefinition t tc) | 195 | runExchange t tc = MP.chanServe t exInit (processDefinition t tc) | 65 | false | true | 0 | 11 | 61 | 67 | 31 | 36 | null | null |
ndmitchell/shake | src/Development/Shake/Internal/FilePattern.hs | bsd-3-clause | -- | Do they have the same * and // counts in the same order
compatible :: [FilePattern] -> Bool
compatible [] = True | 117 | compatible :: [FilePattern] -> Bool
compatible [] = True | 56 | compatible [] = True | 20 | true | true | 0 | 6 | 23 | 24 | 13 | 11 | null | null |
joelchelliah/diy-lang-haskell | test/parts/Test_5_AddingFunctionsToTheMix.hs | bsd-3-clause | closureHoldsFunction :: TestTree
closureHoldsFunction = testCase
"\n Test 5.3 - A closure holds a function. \n\
\ The closure contains a parameter list and a function body. They \n\
\ are represented as a <DiyFunction [DiyAST] DiyAST> in our AST" $ do
let lambda = parse "(lambda (x y) (+ x y))"
(closure, _) = evaluate lambda $ Environment []
expectedParams = [ DiySymbol "x", DiySymbol "y" ]
expectedBody = DiyList [ DiySymbol "+", DiySymbol "x", DiySymbol "y" ]
assertIsClosure closure
assertClosureFunction closure expectedParams expectedBody | 602 | closureHoldsFunction :: TestTree
closureHoldsFunction = testCase
"\n Test 5.3 - A closure holds a function. \n\
\ The closure contains a parameter list and a function body. They \n\
\ are represented as a <DiyFunction [DiyAST] DiyAST> in our AST" $ do
let lambda = parse "(lambda (x y) (+ x y))"
(closure, _) = evaluate lambda $ Environment []
expectedParams = [ DiySymbol "x", DiySymbol "y" ]
expectedBody = DiyList [ DiySymbol "+", DiySymbol "x", DiySymbol "y" ]
assertIsClosure closure
assertClosureFunction closure expectedParams expectedBody | 602 | closureHoldsFunction = testCase
"\n Test 5.3 - A closure holds a function. \n\
\ The closure contains a parameter list and a function body. They \n\
\ are represented as a <DiyFunction [DiyAST] DiyAST> in our AST" $ do
let lambda = parse "(lambda (x y) (+ x y))"
(closure, _) = evaluate lambda $ Environment []
expectedParams = [ DiySymbol "x", DiySymbol "y" ]
expectedBody = DiyList [ DiySymbol "+", DiySymbol "x", DiySymbol "y" ]
assertIsClosure closure
assertClosureFunction closure expectedParams expectedBody | 569 | false | true | 0 | 13 | 140 | 113 | 54 | 59 | null | null |
phischu/fragnix | builtins/ghc-prim/GHC.Prim.hs | bsd-3-clause | -- | Unpack the elements of a vector into an unboxed tuple. #
unpackInt32X16# :: Int32X16# -> (# Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int# #)
unpackInt32X16# = unpackInt32X16# | 214 | unpackInt32X16# :: Int32X16# -> (# Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int#,Int# #)
unpackInt32X16# = unpackInt32X16# | 151 | unpackInt32X16# = unpackInt32X16# | 33 | true | true | 0 | 8 | 23 | 70 | 41 | 29 | null | null |
oldmanmike/ghc | compiler/utils/Pretty.hs | bsd-3-clause | oneLiner (Above {}) = error "oneLiner Above" | 53 | oneLiner (Above {}) = error "oneLiner Above" | 53 | oneLiner (Above {}) = error "oneLiner Above" | 53 | false | false | 0 | 7 | 15 | 19 | 9 | 10 | null | null |
jgm/blaze-html | Text/Blaze/Renderer/Utf8.hs | bsd-3-clause | fromChoiceString (AppendChoiceString x y) =
fromChoiceString x `mappend` fromChoiceString y | 95 | fromChoiceString (AppendChoiceString x y) =
fromChoiceString x `mappend` fromChoiceString y | 95 | fromChoiceString (AppendChoiceString x y) =
fromChoiceString x `mappend` fromChoiceString y | 95 | false | false | 0 | 6 | 13 | 33 | 15 | 18 | null | null |
pxqr/base32-bytestring | src/Data/ByteString/Base32/Hex.hs | bsd-3-clause | decTable :: DecTable
decTable = BS.pack $ L.map decW5 [minBound .. maxBound] | 76 | decTable :: DecTable
decTable = BS.pack $ L.map decW5 [minBound .. maxBound] | 76 | decTable = BS.pack $ L.map decW5 [minBound .. maxBound] | 55 | false | true | 2 | 6 | 11 | 39 | 17 | 22 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_STENCIL_INDEX16_EXT :: GLenum
gl_STENCIL_INDEX16_EXT = 0x8D49 | 64 | gl_STENCIL_INDEX16_EXT :: GLenum
gl_STENCIL_INDEX16_EXT = 0x8D49 | 64 | gl_STENCIL_INDEX16_EXT = 0x8D49 | 31 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
quchen/shaking-up-ghc | src/Rules/Cabal.hs | bsd-3-clause | collectDeps (Just (CondNode _ deps ifs)) = deps ++ concatMap f ifs
where
f (_, t, mt) = collectDeps (Just t) ++ collectDeps mt | 132 | collectDeps (Just (CondNode _ deps ifs)) = deps ++ concatMap f ifs
where
f (_, t, mt) = collectDeps (Just t) ++ collectDeps mt | 132 | collectDeps (Just (CondNode _ deps ifs)) = deps ++ concatMap f ifs
where
f (_, t, mt) = collectDeps (Just t) ++ collectDeps mt | 132 | false | false | 0 | 9 | 29 | 70 | 34 | 36 | null | null |
shak-mar/botstrats | supervisor/Robots.hs | mit | startRobot :: Robot -> IO (Maybe Robot)
startRobot (Off identifier) = (packInRobot <$> createProcess process)
`catch` \(e :: SomeException) -> return Nothing
where packInRobot (Just stdin, Just stdout, Nothing, procHandle) =
Just $ Running identifier stdin stdout procHandle
drivePath = genDrivePath identifier
process = CreateProcess
-- Use the file `init` in the robot’s drive
(RawCommand (drivePath <> "/init") [])
(Just drivePath) -- Use the robot’s drive as working directory
Nothing -- Pass on the environment
CreatePipe -- Create a pipe for stdin
CreatePipe -- Create a pipe for stdout
Inherit -- Inherit stderr
False -- Don’t close any file descriptors
True -- Create a new process group
False -- Don’t delegate Control-C handling | 988 | startRobot :: Robot -> IO (Maybe Robot)
startRobot (Off identifier) = (packInRobot <$> createProcess process)
`catch` \(e :: SomeException) -> return Nothing
where packInRobot (Just stdin, Just stdout, Nothing, procHandle) =
Just $ Running identifier stdin stdout procHandle
drivePath = genDrivePath identifier
process = CreateProcess
-- Use the file `init` in the robot’s drive
(RawCommand (drivePath <> "/init") [])
(Just drivePath) -- Use the robot’s drive as working directory
Nothing -- Pass on the environment
CreatePipe -- Create a pipe for stdin
CreatePipe -- Create a pipe for stdout
Inherit -- Inherit stderr
False -- Don’t close any file descriptors
True -- Create a new process group
False -- Don’t delegate Control-C handling | 988 | startRobot (Off identifier) = (packInRobot <$> createProcess process)
`catch` \(e :: SomeException) -> return Nothing
where packInRobot (Just stdin, Just stdout, Nothing, procHandle) =
Just $ Running identifier stdin stdout procHandle
drivePath = genDrivePath identifier
process = CreateProcess
-- Use the file `init` in the robot’s drive
(RawCommand (drivePath <> "/init") [])
(Just drivePath) -- Use the robot’s drive as working directory
Nothing -- Pass on the environment
CreatePipe -- Create a pipe for stdin
CreatePipe -- Create a pipe for stdout
Inherit -- Inherit stderr
False -- Don’t close any file descriptors
True -- Create a new process group
False -- Don’t delegate Control-C handling | 948 | false | true | 2 | 10 | 362 | 169 | 91 | 78 | null | null |
keithodulaigh/Hets | QVTR/Parser.hs | gpl-2.0 | pPropertyTemplateList :: CharParser st [QVTR.PropertyTemplate]
pPropertyTemplateList = do
skip
try $ pCommaSep pPropertyTemplate
{- <propertyTemplate> ::= <identifier> '=' <OclExpressionCS>
<identifier> '=' <objectTemplate> -} | 232 | pPropertyTemplateList :: CharParser st [QVTR.PropertyTemplate]
pPropertyTemplateList = do
skip
try $ pCommaSep pPropertyTemplate
{- <propertyTemplate> ::= <identifier> '=' <OclExpressionCS>
<identifier> '=' <objectTemplate> -} | 232 | pPropertyTemplateList = do
skip
try $ pCommaSep pPropertyTemplate
{- <propertyTemplate> ::= <identifier> '=' <OclExpressionCS>
<identifier> '=' <objectTemplate> -} | 169 | false | true | 0 | 8 | 28 | 35 | 17 | 18 | null | null |
tinco/nanc | Nanc/IR/Types.hs | mit | booleanType = LLVM.IntegerType 1 | 32 | booleanType = LLVM.IntegerType 1 | 32 | booleanType = LLVM.IntegerType 1 | 32 | false | false | 0 | 6 | 3 | 11 | 5 | 6 | null | null |
adamschoenemann/simple-frp | src/FRP/TypeChecker.hs | mit | stableCtx :: Context t -> Context t
stableCtx (Ctx c1) =
Ctx $ M.map (maybe (error "laterCtx") (id)) $ M.filter isJust $ M.map mapper c1 where
mapper (t,q) = case q of
QNow -> Nothing
QStable -> Just (t, QStable)
QLater -> Nothing | 255 | stableCtx :: Context t -> Context t
stableCtx (Ctx c1) =
Ctx $ M.map (maybe (error "laterCtx") (id)) $ M.filter isJust $ M.map mapper c1 where
mapper (t,q) = case q of
QNow -> Nothing
QStable -> Just (t, QStable)
QLater -> Nothing | 255 | stableCtx (Ctx c1) =
Ctx $ M.map (maybe (error "laterCtx") (id)) $ M.filter isJust $ M.map mapper c1 where
mapper (t,q) = case q of
QNow -> Nothing
QStable -> Just (t, QStable)
QLater -> Nothing | 219 | false | true | 0 | 12 | 67 | 123 | 61 | 62 | null | null |
narurien/ganeti-ceph | src/Ganeti/OpCodes.hs | gpl-2.0 | opSummaryVal OpInstanceRecreateDisks { opInstanceName = s } = Just s | 68 | opSummaryVal OpInstanceRecreateDisks { opInstanceName = s } = Just s | 68 | opSummaryVal OpInstanceRecreateDisks { opInstanceName = s } = Just s | 68 | false | false | 0 | 7 | 9 | 22 | 10 | 12 | null | null |
timjs/idris-clean | Sources/IRTS/CodegenClean.hs | mit | cgPrim LFACos = cgPrimFn BReal "acos" | 39 | cgPrim LFACos = cgPrimFn BReal "acos" | 39 | cgPrim LFACos = cgPrimFn BReal "acos" | 39 | false | false | 0 | 5 | 7 | 14 | 6 | 8 | null | null |
mimi1vx/shellcheck | ShellCheck/Analytics.hs | gpl-3.0 | checkOverridingPath _ _ = return () | 35 | checkOverridingPath _ _ = return () | 35 | checkOverridingPath _ _ = return () | 35 | false | false | 0 | 6 | 5 | 16 | 7 | 9 | null | null |
rohit507/mfd-experiments | app/Sealing.hs | bsd-3-clause | getEstTimePlot :: Integer -> EstTimePlot
getEstTimePlot numDice = EstTimePlot{
diffs = {- trace ("for diffs " ++ show diffs) -} diffs
, totals = {- trace ("for totals " ++ show totals) -} totals
, estDays = estDays
, variance = variance
}
where
diffs = getDiffs numDice
totals = getTotals numDice
-- get all rows
(estDays,variance) = unzip $ map getSingDiff diffs
-- Get the row for a single difficulty
getSingDiff :: Integer -> ([Integer],[Integer])
-- The trace is here so I can see progress, but it's an otherwise pure
-- function, :V medium bad practice I suppose.
getSingDiff diff = {- trace ("for difficulty " ++ show diff) $ -} (estList,varList)
where
distGen = multipleDaysProgress numDice diff
(estList,varList) = unzip $ map tp totals
where
tp t = let e5 = ed 0.5 t in (e5,if (e5 == -1) then -1 else P.max (e5 - ed 0.05 t) (ed 0.95 t - e5))
-- Number of days to some percentage with >max just set to -1
ed p t = fromMaybe (-1) $ daysToComplete' distGen p t
-- Generate the full pile fo estimated time plot sas needed. | 1,138 | getEstTimePlot :: Integer -> EstTimePlot
getEstTimePlot numDice = EstTimePlot{
diffs = {- trace ("for diffs " ++ show diffs) -} diffs
, totals = {- trace ("for totals " ++ show totals) -} totals
, estDays = estDays
, variance = variance
}
where
diffs = getDiffs numDice
totals = getTotals numDice
-- get all rows
(estDays,variance) = unzip $ map getSingDiff diffs
-- Get the row for a single difficulty
getSingDiff :: Integer -> ([Integer],[Integer])
-- The trace is here so I can see progress, but it's an otherwise pure
-- function, :V medium bad practice I suppose.
getSingDiff diff = {- trace ("for difficulty " ++ show diff) $ -} (estList,varList)
where
distGen = multipleDaysProgress numDice diff
(estList,varList) = unzip $ map tp totals
where
tp t = let e5 = ed 0.5 t in (e5,if (e5 == -1) then -1 else P.max (e5 - ed 0.05 t) (ed 0.95 t - e5))
-- Number of days to some percentage with >max just set to -1
ed p t = fromMaybe (-1) $ daysToComplete' distGen p t
-- Generate the full pile fo estimated time plot sas needed. | 1,138 | getEstTimePlot numDice = EstTimePlot{
diffs = {- trace ("for diffs " ++ show diffs) -} diffs
, totals = {- trace ("for totals " ++ show totals) -} totals
, estDays = estDays
, variance = variance
}
where
diffs = getDiffs numDice
totals = getTotals numDice
-- get all rows
(estDays,variance) = unzip $ map getSingDiff diffs
-- Get the row for a single difficulty
getSingDiff :: Integer -> ([Integer],[Integer])
-- The trace is here so I can see progress, but it's an otherwise pure
-- function, :V medium bad practice I suppose.
getSingDiff diff = {- trace ("for difficulty " ++ show diff) $ -} (estList,varList)
where
distGen = multipleDaysProgress numDice diff
(estList,varList) = unzip $ map tp totals
where
tp t = let e5 = ed 0.5 t in (e5,if (e5 == -1) then -1 else P.max (e5 - ed 0.05 t) (ed 0.95 t - e5))
-- Number of days to some percentage with >max just set to -1
ed p t = fromMaybe (-1) $ daysToComplete' distGen p t
-- Generate the full pile fo estimated time plot sas needed. | 1,097 | false | true | 3 | 16 | 300 | 273 | 149 | 124 | null | null |
uwap/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | mapPTermFC f g (PAlternative ns ty ts) = PAlternative ns ty (map (mapPTermFC f g) ts) | 85 | mapPTermFC f g (PAlternative ns ty ts) = PAlternative ns ty (map (mapPTermFC f g) ts) | 85 | mapPTermFC f g (PAlternative ns ty ts) = PAlternative ns ty (map (mapPTermFC f g) ts) | 85 | false | false | 0 | 9 | 15 | 46 | 22 | 24 | null | null |
OS2World/DEV-UTIL-HUGS | libraries/Graphics/Rendering/OpenGL/GL/Extensions.hs | bsd-3-clause | throwIfNull :: String -> IO (FunPtr a) -> IO (FunPtr a)
throwIfNull msg act = do
res <- act
if res == nullFunPtr
then ioError (userError msg)
else return res | 175 | throwIfNull :: String -> IO (FunPtr a) -> IO (FunPtr a)
throwIfNull msg act = do
res <- act
if res == nullFunPtr
then ioError (userError msg)
else return res | 175 | throwIfNull msg act = do
res <- act
if res == nullFunPtr
then ioError (userError msg)
else return res | 119 | false | true | 0 | 11 | 47 | 81 | 37 | 44 | null | null |
ChrisKuklewicz/SafeSemaphore | src/Control/Concurrent/STM/SSem.hs | bsd-3-clause | -- | Try to take the given value from the semaphore. This succeeds when the quantity is greater or
-- equal to the given value, and then subtracts the given value from the quantity. Otherwise this
-- will 'retry'. This will never result in a negative quantity. If several threads are retrying
-- then which one succeeds next is undefined -- an unlucky thread might starve.
waitN :: SSem -> Int -> STM ()
waitN (SSem s) i = do
v <- readTVar s
if v >= i
then writeTVar s $! v-i
else retry
-- | Signal that single unit of the semaphore is available. This increases the available quantity
-- by one. | 613 | waitN :: SSem -> Int -> STM ()
waitN (SSem s) i = do
v <- readTVar s
if v >= i
then writeTVar s $! v-i
else retry
-- | Signal that single unit of the semaphore is available. This increases the available quantity
-- by one. | 236 | waitN (SSem s) i = do
v <- readTVar s
if v >= i
then writeTVar s $! v-i
else retry
-- | Signal that single unit of the semaphore is available. This increases the available quantity
-- by one. | 205 | true | true | 0 | 10 | 131 | 82 | 41 | 41 | null | null |
benweitzman/PhoBuddies-Servant | src/Util/Server.hs | mit | requireToken :: Maybe (Token a) -> ConfigM a
requireToken Nothing = errorOf err401 | 82 | requireToken :: Maybe (Token a) -> ConfigM a
requireToken Nothing = errorOf err401 | 82 | requireToken Nothing = errorOf err401 | 37 | false | true | 0 | 8 | 12 | 33 | 15 | 18 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/WebGPURenderingContext.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/WebGPURenderingContext.nextDrawable Mozilla WebGPURenderingContext.nextDrawable documentation>
nextDrawable ::
(MonadDOM m) => WebGPURenderingContext -> m (Maybe WebGPUDrawable)
nextDrawable self
= liftDOM ((self ^. jsf "nextDrawable" ()) >>= fromJSVal) | 324 | nextDrawable ::
(MonadDOM m) => WebGPURenderingContext -> m (Maybe WebGPUDrawable)
nextDrawable self
= liftDOM ((self ^. jsf "nextDrawable" ()) >>= fromJSVal) | 173 | nextDrawable self
= liftDOM ((self ^. jsf "nextDrawable" ()) >>= fromJSVal) | 77 | true | true | 0 | 11 | 42 | 66 | 32 | 34 | null | null |
talanis85/haScales | src/Data/Music/Chords.hs | bsd-3-clause | dominant7Chord = tetrad mixolydianScale | 39 | dominant7Chord = tetrad mixolydianScale | 39 | dominant7Chord = tetrad mixolydianScale | 39 | false | false | 1 | 5 | 3 | 12 | 4 | 8 | null | null |
urbit/urbit | pkg/hs/urbit-king/test/AmesTests.hs | mit | packetSplitMorphism :: Packet -> Bool
packetSplitMorphism p = (decode . encode) p == Right p | 92 | packetSplitMorphism :: Packet -> Bool
packetSplitMorphism p = (decode . encode) p == Right p | 92 | packetSplitMorphism p = (decode . encode) p == Right p | 54 | false | true | 0 | 8 | 14 | 35 | 17 | 18 | null | null |
taruti/diagrams-cairo-raster | example/PlainRaster.hs | bsd-3-clause | cplus :: Int -> Int -> CairoColor
cplus x y = crgb x y (x*y) | 60 | cplus :: Int -> Int -> CairoColor
cplus x y = crgb x y (x*y) | 60 | cplus x y = crgb x y (x*y) | 26 | false | true | 0 | 8 | 14 | 46 | 20 | 26 | null | null |
fmapfmapfmap/amazonka | amazonka-swf/gen/Network/AWS/SWF/DeprecateWorkflowType.hs | mpl-2.0 | -- | The workflow type to deprecate.
dWorkflowType :: Lens' DeprecateWorkflowType WorkflowType
dWorkflowType = lens _dWorkflowType (\ s a -> s{_dWorkflowType = a}) | 163 | dWorkflowType :: Lens' DeprecateWorkflowType WorkflowType
dWorkflowType = lens _dWorkflowType (\ s a -> s{_dWorkflowType = a}) | 126 | dWorkflowType = lens _dWorkflowType (\ s a -> s{_dWorkflowType = a}) | 68 | true | true | 0 | 9 | 22 | 40 | 22 | 18 | null | null |
txkaduo/hs-vdian-sdk | VDian/Order.hs | bsd-3-clause | fromOrderStatusNum :: Int -> Maybe OrderStatus
fromOrderStatusNum 0 = Just OrderStatusJustCreated | 97 | fromOrderStatusNum :: Int -> Maybe OrderStatus
fromOrderStatusNum 0 = Just OrderStatusJustCreated | 97 | fromOrderStatusNum 0 = Just OrderStatusJustCreated | 50 | false | true | 0 | 6 | 10 | 24 | 11 | 13 | null | null |
minad/omega | vendor/algorithm-p/Types.hs | bsd-3-clause | collectType :: Eq a => Endo (Type -> [a])
collectType f = walk where
walk (TyCon _ tas) = unions (map walk tas)
walk t = f t | 144 | collectType :: Eq a => Endo (Type -> [a])
collectType f = walk where
walk (TyCon _ tas) = unions (map walk tas)
walk t = f t | 144 | collectType f = walk where
walk (TyCon _ tas) = unions (map walk tas)
walk t = f t | 102 | false | true | 0 | 9 | 47 | 74 | 36 | 38 | null | null |
avh4/elm-format | tests/Test/ElmSourceGenerators.hs | bsd-3-clause | elmModule :: Gen String
elmModule =
do
header <- moduleHeader
d <- declaration
return $ unlines [ header, d ] | 123 | elmModule :: Gen String
elmModule =
do
header <- moduleHeader
d <- declaration
return $ unlines [ header, d ] | 123 | elmModule =
do
header <- moduleHeader
d <- declaration
return $ unlines [ header, d ] | 99 | false | true | 0 | 9 | 33 | 44 | 21 | 23 | null | null |
pparkkin/eta | compiler/ETA/Main/DynFlags.hs | bsd-3-clause | wayOptl _ WayThreaded = [] | 28 | wayOptl _ WayThreaded = [] | 28 | wayOptl _ WayThreaded = [] | 28 | false | false | 1 | 6 | 6 | 15 | 6 | 9 | null | null |
techtangents/ablist | test/AbListTests.hs | bsd-3-clause | p_abMapLefts_id :: AbList Int Char -> Bool
p_abMapLefts_id x = abMapLefts id x == x | 83 | p_abMapLefts_id :: AbList Int Char -> Bool
p_abMapLefts_id x = abMapLefts id x == x | 83 | p_abMapLefts_id x = abMapLefts id x == x | 40 | false | true | 0 | 6 | 14 | 32 | 15 | 17 | null | null |
markuspf/Idris-dev | src/Idris/Parser/Helpers.hs | bsd-3-clause | docComment :: IdrisParser (Docstring (), [(Name, Docstring ())])
docComment = do dc <- pushIndent *> docCommentLine
rest <- many (indented docCommentLine)
args <- many $ do (name, first) <- indented argDocCommentLine
rest <- many (indented docCommentLine)
return (name, concat (intersperse "\n" (first:rest)))
popIndent
return (parseDocstring $ T.pack (concat (intersperse "\n" (dc:rest))),
map (\(n, d) -> (n, parseDocstring (T.pack d))) args)
where docCommentLine :: MonadicParsing m => m String
docCommentLine = try (do string "|||"
many (satisfy (==' '))
contents <- option "" (do first <- satisfy (\c -> not (isEol c || c == '@'))
res <- many (satisfy (not . isEol))
return $ first:res)
eol ; someSpace
return contents)-- ++ concat rest))
<?> ""
argDocCommentLine = do string "|||"
many (satisfy isSpace)
char '@'
many (satisfy isSpace)
n <- fst <$> name
many (satisfy isSpace)
docs <- many (satisfy (not . isEol))
eol ; someSpace
return (n, docs)
-- | Parses some white space | 1,680 | docComment :: IdrisParser (Docstring (), [(Name, Docstring ())])
docComment = do dc <- pushIndent *> docCommentLine
rest <- many (indented docCommentLine)
args <- many $ do (name, first) <- indented argDocCommentLine
rest <- many (indented docCommentLine)
return (name, concat (intersperse "\n" (first:rest)))
popIndent
return (parseDocstring $ T.pack (concat (intersperse "\n" (dc:rest))),
map (\(n, d) -> (n, parseDocstring (T.pack d))) args)
where docCommentLine :: MonadicParsing m => m String
docCommentLine = try (do string "|||"
many (satisfy (==' '))
contents <- option "" (do first <- satisfy (\c -> not (isEol c || c == '@'))
res <- many (satisfy (not . isEol))
return $ first:res)
eol ; someSpace
return contents)-- ++ concat rest))
<?> ""
argDocCommentLine = do string "|||"
many (satisfy isSpace)
char '@'
many (satisfy isSpace)
n <- fst <$> name
many (satisfy isSpace)
docs <- many (satisfy (not . isEol))
eol ; someSpace
return (n, docs)
-- | Parses some white space | 1,680 | docComment = do dc <- pushIndent *> docCommentLine
rest <- many (indented docCommentLine)
args <- many $ do (name, first) <- indented argDocCommentLine
rest <- many (indented docCommentLine)
return (name, concat (intersperse "\n" (first:rest)))
popIndent
return (parseDocstring $ T.pack (concat (intersperse "\n" (dc:rest))),
map (\(n, d) -> (n, parseDocstring (T.pack d))) args)
where docCommentLine :: MonadicParsing m => m String
docCommentLine = try (do string "|||"
many (satisfy (==' '))
contents <- option "" (do first <- satisfy (\c -> not (isEol c || c == '@'))
res <- many (satisfy (not . isEol))
return $ first:res)
eol ; someSpace
return contents)-- ++ concat rest))
<?> ""
argDocCommentLine = do string "|||"
many (satisfy isSpace)
char '@'
many (satisfy isSpace)
n <- fst <$> name
many (satisfy isSpace)
docs <- many (satisfy (not . isEol))
eol ; someSpace
return (n, docs)
-- | Parses some white space | 1,615 | false | true | 3 | 23 | 853 | 481 | 230 | 251 | null | null |
tolysz/hiccup | Hiccup.hs | lgpl-2.1 | hiccupVersion = 0.49 | 20 | hiccupVersion = 0.49 | 20 | hiccupVersion = 0.49 | 20 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
mariefarrell/Hets | Driver/Options.hs | gpl-2.0 | getFileNames :: [String] -> FilePath -> [FilePath]
getFileNames exts file =
file : map (rmSuffix file ++) exts | 112 | getFileNames :: [String] -> FilePath -> [FilePath]
getFileNames exts file =
file : map (rmSuffix file ++) exts | 112 | getFileNames exts file =
file : map (rmSuffix file ++) exts | 61 | false | true | 2 | 9 | 19 | 53 | 25 | 28 | null | null |
nevrenato/HetsAlloy | Maude/Maude2DG.hs | gpl-2.0 | createEdgeImport tok1 (Inc, tok2, _, morph, _, _) sg tim dg = (tim, dg')
where morph' = setTarget sg morph
(n1, _, _, _, _) = fromJust $ Map.lookup tok1 tim
(n2, _, _, _, _) = fromJust $ Map.lookup tok2 tim
dg' = insertDefEdgeMorphism n1 n2 morph' dg
-- | extracts the sorts provided by the theories | 378 | createEdgeImport tok1 (Inc, tok2, _, morph, _, _) sg tim dg = (tim, dg')
where morph' = setTarget sg morph
(n1, _, _, _, _) = fromJust $ Map.lookup tok1 tim
(n2, _, _, _, _) = fromJust $ Map.lookup tok2 tim
dg' = insertDefEdgeMorphism n1 n2 morph' dg
-- | extracts the sorts provided by the theories | 378 | createEdgeImport tok1 (Inc, tok2, _, morph, _, _) sg tim dg = (tim, dg')
where morph' = setTarget sg morph
(n1, _, _, _, _) = fromJust $ Map.lookup tok1 tim
(n2, _, _, _, _) = fromJust $ Map.lookup tok2 tim
dg' = insertDefEdgeMorphism n1 n2 morph' dg
-- | extracts the sorts provided by the theories | 378 | false | false | 1 | 7 | 136 | 137 | 74 | 63 | null | null |
AlexeyRaga/eta | compiler/ETA/Prelude/PrimOp.hs | bsd-3-clause | tagOf_PrimOp EqStablePtrOp = _ILIT(372) | 39 | tagOf_PrimOp EqStablePtrOp = _ILIT(372) | 39 | tagOf_PrimOp EqStablePtrOp = _ILIT(372) | 39 | false | false | 0 | 6 | 3 | 16 | 7 | 9 | null | null |
soenkehahn/nhc | src/Run.hs | bsd-3-clause | wrapBashArg :: String -> String
wrapBashArg a =
"\"" ++ a ++ "\"" | 67 | wrapBashArg :: String -> String
wrapBashArg a =
"\"" ++ a ++ "\"" | 67 | wrapBashArg a =
"\"" ++ a ++ "\"" | 35 | false | true | 4 | 7 | 14 | 34 | 14 | 20 | null | null |
vincenthz/hs-foundation | basement/Basement/UArray/Base.hs | bsd-3-clause | -- | write to a cell in a mutable array without bounds checking.
--
-- Writing with invalid bounds will corrupt memory and your program will
-- become unreliable. use 'write' if unsure.
unsafeWrite :: (PrimMonad prim, PrimType ty) => MUArray ty (PrimState prim) -> Offset ty -> ty -> prim ()
unsafeWrite (MUArray start _ (MUArrayMBA mb)) i v = MBLK.unsafeWrite mb (start+i) v | 375 | unsafeWrite :: (PrimMonad prim, PrimType ty) => MUArray ty (PrimState prim) -> Offset ty -> ty -> prim ()
unsafeWrite (MUArray start _ (MUArrayMBA mb)) i v = MBLK.unsafeWrite mb (start+i) v | 189 | unsafeWrite (MUArray start _ (MUArrayMBA mb)) i v = MBLK.unsafeWrite mb (start+i) v | 83 | true | true | 0 | 10 | 64 | 100 | 51 | 49 | null | null |
ku-fpg/flat-json | src/Database/Flat/JSON.hs | bsd-3-clause | rowId :: Row -> Text
rowId (Row o) = case parse (.: "_id") o of
Success v -> v
Error msg -> error $ "rowId failed " ++ msg | 158 | rowId :: Row -> Text
rowId (Row o) = case parse (.: "_id") o of
Success v -> v
Error msg -> error $ "rowId failed " ++ msg | 158 | rowId (Row o) = case parse (.: "_id") o of
Success v -> v
Error msg -> error $ "rowId failed " ++ msg | 137 | false | true | 0 | 9 | 64 | 63 | 31 | 32 | null | null |
Newlifer/libstep | src/Data/EXPRESS/Parsers.hs | mit | -- simple_id .
pSubtypeConstraintId :: Parser SubtypeConstraintId
pSubtypeConstraintId = pSimpleId | 98 | pSubtypeConstraintId :: Parser SubtypeConstraintId
pSubtypeConstraintId = pSimpleId | 83 | pSubtypeConstraintId = pSimpleId | 32 | true | true | 0 | 5 | 9 | 15 | 8 | 7 | null | null |
monte-language/masque | Masque/Monte.hs | gpl-3.0 | unwrapChar :: Obj -> Monte Char
unwrapChar (CharObj c) = return c | 65 | unwrapChar :: Obj -> Monte Char
unwrapChar (CharObj c) = return c | 65 | unwrapChar (CharObj c) = return c | 33 | false | true | 0 | 7 | 11 | 30 | 14 | 16 | null | null |
TransformingMusicology/libaudioDB-haskell | src/Sound/Audio/Database.hs | gpl-3.0 | withNewPoweredAudioDB fp datasize ntracks dim f = withNewAudioDB fp datasize ntracks dim False True f | 109 | withNewPoweredAudioDB fp datasize ntracks dim f = withNewAudioDB fp datasize ntracks dim False True f | 109 | withNewPoweredAudioDB fp datasize ntracks dim f = withNewAudioDB fp datasize ntracks dim False True f | 109 | false | false | 0 | 5 | 22 | 32 | 15 | 17 | null | null |
Numberartificial/workflow | haskell-first-principles/haskell-programming-from-first-principles-master/src/Chapter10.hs | mit | {-
2. myAny returns True if a -> Bool applied to any of the values in
the list returns True .
myAny :: (a -> Bool) -> [a] -> Bool
myAny = undefined
Example for validating myAny :
Prelude> myAny even [1, 3, 5]
False
Prelude> myAny odd [1, 3, 5]
True
-}
myAny :: (a -> Bool) -> [a] -> Bool
myAny f' = foldr ((||) . f') False | 332 | myAny :: (a -> Bool) -> [a] -> Bool
myAny f' = foldr ((||) . f') False | 70 | myAny f' = foldr ((||) . f') False | 34 | true | true | 0 | 7 | 79 | 47 | 26 | 21 | null | null |
brendanhay/gogol | gogol-compute/gen/Network/Google/Resource/Compute/Disks/Resize.hs | mpl-2.0 | -- | Project ID for this request.
drProject :: Lens' DisksResize Text
drProject
= lens _drProject (\ s a -> s{_drProject = a}) | 128 | drProject :: Lens' DisksResize Text
drProject
= lens _drProject (\ s a -> s{_drProject = a}) | 94 | drProject
= lens _drProject (\ s a -> s{_drProject = a}) | 58 | true | true | 0 | 9 | 24 | 42 | 22 | 20 | null | null |
Zankoku-Okuno/ammonite | Language/Ammonite/Syntax/Parser.hs | gpl-3.0 | _expr :: Bool -> Parser Syntax
_expr inline = do
(stmts, pos) <- withPosition $
applyExpr inline coreExpr `sepBy1` sepSemicolon
return $ case stmts of
[e] -> e
_ -> (Block stmts, pos) | 215 | _expr :: Bool -> Parser Syntax
_expr inline = do
(stmts, pos) <- withPosition $
applyExpr inline coreExpr `sepBy1` sepSemicolon
return $ case stmts of
[e] -> e
_ -> (Block stmts, pos) | 215 | _expr inline = do
(stmts, pos) <- withPosition $
applyExpr inline coreExpr `sepBy1` sepSemicolon
return $ case stmts of
[e] -> e
_ -> (Block stmts, pos) | 184 | false | true | 0 | 12 | 64 | 84 | 43 | 41 | null | null |
daherb/Haskell-Muste | muste-lib/Test/Grammar.hs | artistic-2.0 | hunit_getRuleCat_test =
TestList [
TestLabel "NoType" ( getRuleCat (Function "f" NoType) ~?= wildCard),
TestLabel "Constant" ( getRuleCat (Function "f" (Fun "A" [])) ~?= "A"),
TestLabel "Constant" ( getRuleCat (Function "f" (Fun "A" ["A","B"])) ~?= "A")
] | 265 | hunit_getRuleCat_test =
TestList [
TestLabel "NoType" ( getRuleCat (Function "f" NoType) ~?= wildCard),
TestLabel "Constant" ( getRuleCat (Function "f" (Fun "A" [])) ~?= "A"),
TestLabel "Constant" ( getRuleCat (Function "f" (Fun "A" ["A","B"])) ~?= "A")
] | 265 | hunit_getRuleCat_test =
TestList [
TestLabel "NoType" ( getRuleCat (Function "f" NoType) ~?= wildCard),
TestLabel "Constant" ( getRuleCat (Function "f" (Fun "A" [])) ~?= "A"),
TestLabel "Constant" ( getRuleCat (Function "f" (Fun "A" ["A","B"])) ~?= "A")
] | 265 | false | false | 1 | 15 | 45 | 115 | 56 | 59 | null | null |
forsyde/forsyde-atom | src/ForSyDe/Atom/MoC.hs | bsd-3-clause | mealy24 ns od i s1 s2 = comb34 od st s1 s2
where st = i -&>- comb31 ns st s1 s2 | 111 | mealy24 ns od i s1 s2 = comb34 od st s1 s2
where st = i -&>- comb31 ns st s1 s2 | 111 | mealy24 ns od i s1 s2 = comb34 od st s1 s2
where st = i -&>- comb31 ns st s1 s2 | 111 | false | false | 0 | 6 | 53 | 47 | 22 | 25 | null | null |
phischu/fragnix | tests/packages/scotty/Network.HTTP.Date.Parser.hs | bsd-3-clause | month :: Parser Int
month = 1 <$ string "Jan"
<|> 2 <$ string "Feb"
<|> 3 <$ string "Mar"
<|> 4 <$ string "Apr"
<|> 5 <$ string "May"
<|> 6 <$ string "Jun"
<|> 7 <$ string "Jul"
<|> 8 <$ string "Aug"
<|> 9 <$ string "Sep"
<|> 10 <$ string "Oct"
<|> 11 <$ string "Nov"
<|> 12 <$ string "Dec" | 343 | month :: Parser Int
month = 1 <$ string "Jan"
<|> 2 <$ string "Feb"
<|> 3 <$ string "Mar"
<|> 4 <$ string "Apr"
<|> 5 <$ string "May"
<|> 6 <$ string "Jun"
<|> 7 <$ string "Jul"
<|> 8 <$ string "Aug"
<|> 9 <$ string "Sep"
<|> 10 <$ string "Oct"
<|> 11 <$ string "Nov"
<|> 12 <$ string "Dec" | 343 | month = 1 <$ string "Jan"
<|> 2 <$ string "Feb"
<|> 3 <$ string "Mar"
<|> 4 <$ string "Apr"
<|> 5 <$ string "May"
<|> 6 <$ string "Jun"
<|> 7 <$ string "Jul"
<|> 8 <$ string "Aug"
<|> 9 <$ string "Sep"
<|> 10 <$ string "Oct"
<|> 11 <$ string "Nov"
<|> 12 <$ string "Dec" | 323 | false | true | 33 | 6 | 117 | 175 | 87 | 88 | null | null |
zalora/redsift | redsift.hs | gpl-3.0 | defaultConfigFile :: FilePath
defaultConfigFile = "./Config/redsift.config" | 75 | defaultConfigFile :: FilePath
defaultConfigFile = "./Config/redsift.config" | 75 | defaultConfigFile = "./Config/redsift.config" | 45 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
kidaa/taygeta | src/Taygeta/Parser/Utils.hs | apache-2.0 | isParen :: Char -> Bool
isParen '(' = True | 42 | isParen :: Char -> Bool
isParen '(' = True | 42 | isParen '(' = True | 18 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
githubkleon/ConvenientHDL | src/Language/Cynide/PrettyPrint.hs | bsd-3-clause | ppItem (InOutDeclItem x) = ppInOutDecl x | 44 | ppItem (InOutDeclItem x) = ppInOutDecl x | 44 | ppItem (InOutDeclItem x) = ppInOutDecl x | 44 | false | false | 0 | 6 | 9 | 19 | 8 | 11 | null | null |
olsner/ghc | compiler/prelude/THNames.hs | bsd-3-clause | matchQTyConName, clauseQTyConName, expQTyConName, stmtQTyConName,
decQTyConName, conQTyConName, bangTypeQTyConName,
varBangTypeQTyConName, typeQTyConName, fieldExpQTyConName,
patQTyConName, fieldPatQTyConName, predQTyConName, decsQTyConName,
ruleBndrQTyConName, tySynEqnQTyConName, roleTyConName,
derivClauseQTyConName :: Name
matchQTyConName = libTc (fsLit "MatchQ") matchQTyConKey | 418 | matchQTyConName, clauseQTyConName, expQTyConName, stmtQTyConName,
decQTyConName, conQTyConName, bangTypeQTyConName,
varBangTypeQTyConName, typeQTyConName, fieldExpQTyConName,
patQTyConName, fieldPatQTyConName, predQTyConName, decsQTyConName,
ruleBndrQTyConName, tySynEqnQTyConName, roleTyConName,
derivClauseQTyConName :: Name
matchQTyConName = libTc (fsLit "MatchQ") matchQTyConKey | 418 | matchQTyConName = libTc (fsLit "MatchQ") matchQTyConKey | 71 | false | true | 0 | 7 | 61 | 56 | 45 | 11 | null | null |
39aldo39/klfc | src/Lookup/Tmk.hs | gpl-3.0 | posAndTmkAction ∷ [(Pos, String)]
posAndTmkAction =
[ (P.Tilde, "GRV")
, (P.Tilde, "GRAVE")
, (P.Tilde, "ZKHK")
, (P.N1, "1")
, (P.N2, "2")
, (P.N3, "3")
, (P.N4, "4")
, (P.N5, "5")
, (P.N6, "6")
, (P.N7, "7")
, (P.N8, "8")
, (P.N9, "9")
, (P.N0, "0")
, (P.Minus, "MINS")
, (P.Minus, "MINUS")
, (P.Plus, "EQL")
, (P.Plus, "EQUAL")
, (P.Backspace, "BSPC")
, (P.Backspace, "BSPACE")
, (P.Tab, "TAB")
, (P.Q, "Q")
, (P.W, "W")
, (P.E, "E")
, (P.R, "R")
, (P.T, "T")
, (P.Y, "Y")
, (P.U, "U")
, (P.I, "I")
, (P.O, "O")
, (P.P, "P")
, (P.Bracket_L, "LBRC")
, (P.Bracket_L, "LBRACKET")
, (P.Bracket_R, "RBRC")
, (P.Bracket_R, "RBRACKET")
, (P.Backslash, "BSLS")
, (P.Backslash, "BSLASH")
, (P.CapsLock, "CAPS")
, (P.CapsLock, "CAPSLOCK")
, (P.CapsLock, "CLCK")
, (P.A, "A")
, (P.S, "S")
, (P.D, "D")
, (P.F, "F")
, (P.G, "G")
, (P.H, "H")
, (P.J, "J")
, (P.K, "K")
, (P.L, "L")
, (P.Semicolon, "SCLN")
, (P.Semicolon, "SCOLON")
, (P.Apastrophe, "QUOT")
, (P.Apastrophe, "QUOTE")
, (P.Enter, "ENT")
, (P.Enter, "ENTER")
, (P.Shift_L, "LSFT")
, (P.Shift_L, "LSHIFT")
, (P.Iso, "NUBS")
, (P.Iso, "NONUS_BSLASH")
, (P.Z, "Z")
, (P.X, "X")
, (P.C, "C")
, (P.V, "V")
, (P.B, "B")
, (P.N, "N")
, (P.M, "M")
, (P.Comma, "COMM")
, (P.Comma, "COMMA")
, (P.Period, "DOT")
, (P.Slash, "SLSH")
, (P.Slash, "SLASH")
, (P.Shift_R, "RSFT")
, (P.Shift_R, "RSHIFT")
, (P.Control_L, "LCTL")
, (P.Control_L, "LCTRL")
, (P.Win_L, "LGUI")
, (P.Alt_L, "LALT")
, (P.Space, "SPC")
, (P.Space, "SPACE")
, (P.Alt_R, "RALT")
, (P.Win_R, "RGUI")
-- , (P.Menu, "MENU")
, (P.Menu, "APP")
, (P.Menu, "APPLICATION")
, (P.Control_R, "RCTL")
, (P.Control_R, "RCTRL")
, (P.Esc, "ESC")
, (P.Esc, "ESCAPE")
, (P.F1, "F1")
, (P.F2, "F2")
, (P.F3, "F3")
, (P.F4, "F4")
, (P.F5, "F5")
, (P.F6, "F6")
, (P.F7, "F7")
, (P.F8, "F8")
, (P.F9, "F9")
, (P.F10, "F10")
, (P.F11, "F11")
, (P.F12, "F12")
, (P.PrintScreen, "PSCR")
, (P.PrintScreen, "PSCREEN")
, (P.ScrollLock, "SLCK")
, (P.ScrollLock, "SCROLLLOCK")
, (P.Pause, "PAUS")
, (P.Pause, "PAUSE")
, (P.Pause, "BRK")
, (P.Insert, "INS")
, (P.Insert, "INSERT")
, (P.Delete, "DEL")
, (P.Delete, "DELETE")
, (P.Home, "HOME")
, (P.End, "END")
, (P.PageUp, "PGUP")
, (P.PageDown, "PGDN")
, (P.PageDown, "PGDOWN")
, (P.Up, "UP")
, (P.Left, "LEFT")
, (P.Down, "DOWN")
, (P.Right, "RGHT")
, (P.Right, "RIGHT")
, (P.NumLock, "NLCK")
, (P.NumLock, "NUMLOCK")
, (P.KP_Div, "PSLS")
, (P.KP_Div, "KP_SLASH")
, (P.KP_Mult, "PAST")
, (P.KP_Mult, "KP_ASTERISK")
, (P.KP_Min, "PMNS")
, (P.KP_Min, "KP_MINUS")
, (P.KP_7, "P7")
, (P.KP_7, "KP_7")
, (P.KP_8, "P8")
, (P.KP_8, "KP_8")
, (P.KP_9, "P9")
, (P.KP_9, "KP_9")
, (P.KP_Plus, "PPLS")
, (P.KP_Plus, "KP_PLUS")
, (P.KP_4, "P4")
, (P.KP_4, "KP_4")
, (P.KP_5, "P5")
, (P.KP_5, "KP_5")
, (P.KP_6, "P6")
, (P.KP_6, "KP_6")
, (P.KP_Comma, "PCMM")
, (P.KP_Comma, "KP_COMMA")
, (P.KP_1, "P1")
, (P.KP_1, "KP_1")
, (P.KP_2, "P2")
, (P.KP_2, "KP_2")
, (P.KP_3, "P3")
, (P.KP_3, "KP_3")
, (P.KP_Enter, "PENT")
, (P.KP_Enter, "KP_ENTER")
, (P.KP_0, "P0")
, (P.KP_0, "KP_0")
, (P.KP_Dec, "PDOT")
, (P.KP_Dec, "KP_DOT")
, (P.KP_Eq, "PEQL")
, (P.KP_Eq, "KP_EQUAL")
, (P.PlayPause, "MPLY")
, (P.PlayPause, "MEDIA_PLAY_PAUSE")
, (P.AudioPlay, "MPLY")
, (P.AudioPlay, "MEDIA_PLAY_PAUSE")
, (P.Previous, "MPRV")
, (P.Previous, "MEDIA_PREV_TRACK")
, (P.Next, "MNXT")
, (P.Next, "MEDIA_NEXT_TRACK")
, (P.Stop, "MSTP")
, (P.Stop, "MEDIA_STOP")
, (P.AudioRewind, "MRWD")
, (P.AudioRewind, "MEDIA_REWIND")
, (P.AudioForward, "MFFD")
, (P.AudioForward, "MEDIA_FAST_FORWARD")
, (P.Mute, "MUTE")
, (P.Mute, "AUDIO_MUTE")
, (P.VolumeDown, "VOLD")
, (P.VolumeDown, "AUDIO_VOL_DOWN")
, (P.VolumeUp, "VOLU")
, (P.VolumeUp, "AUDIO_VOL_UP")
, (P.Eject, "EJCT")
, (P.Eject, "MEDIA_EJECT")
, (P.Browser_Back, "WBAK")
, (P.Browser_Back, "WWW_BACK")
, (P.Browser_Forward, "WFWD")
, (P.Browser_Forward, "WWW_FORWARD")
, (P.Browser_Refresh, "WREF")
, (P.Browser_Refresh, "WWW_REFRESH")
, (P.Browser_Stop, "WSTP")
, (P.Browser_Stop, "WWW_STOP")
, (P.Browser_Search, "WSCH")
, (P.Browser_Search, "WWW_SEARCH")
, (P.Browser_Favorites, "WFAV")
, (P.Browser_Favorites, "WWW_FAVORITES")
, (P.Calculator, "CALC")
, (P.Calculator, "CALCULATOR")
, (P.MediaPlayer, "MSEL")
, (P.Browser, "WHOM")
, (P.Browser, "WWW_HOME")
, (P.Mail, "MAIL")
, (P.Search, "FIND")
, (P.MyComputer, "MYCM")
, (P.MyComputer, "MY_COMPUTER")
, (P.Help, "HELP")
, (P.Power, "PWR")
, (P.Power, "POWER")
, (P.Power, "SYSTEM_POWER")
, (P.Sleep, "SLEP")
, (P.Sleep, "SYSTEM_SLEEP")
, (P.Wake, "WAKE")
, (P.Wake, "SYSTEM_WAKE")
, (P.F13, "F13")
, (P.F14, "F14")
, (P.F15, "F15")
, (P.F16, "F16")
, (P.F17, "F17")
, (P.F18, "F18")
, (P.F19, "F19")
, (P.F20, "F20")
, (P.F21, "F21")
, (P.F22, "F22")
, (P.F23, "F23")
, (P.F24, "F24")
, (P.Hash, "NUHS")
, (P.Hash, "NONUS_HASH")
, (P.Ro, "RO")
, (P.Yen, "JYEN")
, (P.Muhenkan, "MHEN")
, (P.Henkan, "HENK")
, (P.Katakana, "KANA")
] | 5,765 | posAndTmkAction ∷ [(Pos, String)]
posAndTmkAction =
[ (P.Tilde, "GRV")
, (P.Tilde, "GRAVE")
, (P.Tilde, "ZKHK")
, (P.N1, "1")
, (P.N2, "2")
, (P.N3, "3")
, (P.N4, "4")
, (P.N5, "5")
, (P.N6, "6")
, (P.N7, "7")
, (P.N8, "8")
, (P.N9, "9")
, (P.N0, "0")
, (P.Minus, "MINS")
, (P.Minus, "MINUS")
, (P.Plus, "EQL")
, (P.Plus, "EQUAL")
, (P.Backspace, "BSPC")
, (P.Backspace, "BSPACE")
, (P.Tab, "TAB")
, (P.Q, "Q")
, (P.W, "W")
, (P.E, "E")
, (P.R, "R")
, (P.T, "T")
, (P.Y, "Y")
, (P.U, "U")
, (P.I, "I")
, (P.O, "O")
, (P.P, "P")
, (P.Bracket_L, "LBRC")
, (P.Bracket_L, "LBRACKET")
, (P.Bracket_R, "RBRC")
, (P.Bracket_R, "RBRACKET")
, (P.Backslash, "BSLS")
, (P.Backslash, "BSLASH")
, (P.CapsLock, "CAPS")
, (P.CapsLock, "CAPSLOCK")
, (P.CapsLock, "CLCK")
, (P.A, "A")
, (P.S, "S")
, (P.D, "D")
, (P.F, "F")
, (P.G, "G")
, (P.H, "H")
, (P.J, "J")
, (P.K, "K")
, (P.L, "L")
, (P.Semicolon, "SCLN")
, (P.Semicolon, "SCOLON")
, (P.Apastrophe, "QUOT")
, (P.Apastrophe, "QUOTE")
, (P.Enter, "ENT")
, (P.Enter, "ENTER")
, (P.Shift_L, "LSFT")
, (P.Shift_L, "LSHIFT")
, (P.Iso, "NUBS")
, (P.Iso, "NONUS_BSLASH")
, (P.Z, "Z")
, (P.X, "X")
, (P.C, "C")
, (P.V, "V")
, (P.B, "B")
, (P.N, "N")
, (P.M, "M")
, (P.Comma, "COMM")
, (P.Comma, "COMMA")
, (P.Period, "DOT")
, (P.Slash, "SLSH")
, (P.Slash, "SLASH")
, (P.Shift_R, "RSFT")
, (P.Shift_R, "RSHIFT")
, (P.Control_L, "LCTL")
, (P.Control_L, "LCTRL")
, (P.Win_L, "LGUI")
, (P.Alt_L, "LALT")
, (P.Space, "SPC")
, (P.Space, "SPACE")
, (P.Alt_R, "RALT")
, (P.Win_R, "RGUI")
-- , (P.Menu, "MENU")
, (P.Menu, "APP")
, (P.Menu, "APPLICATION")
, (P.Control_R, "RCTL")
, (P.Control_R, "RCTRL")
, (P.Esc, "ESC")
, (P.Esc, "ESCAPE")
, (P.F1, "F1")
, (P.F2, "F2")
, (P.F3, "F3")
, (P.F4, "F4")
, (P.F5, "F5")
, (P.F6, "F6")
, (P.F7, "F7")
, (P.F8, "F8")
, (P.F9, "F9")
, (P.F10, "F10")
, (P.F11, "F11")
, (P.F12, "F12")
, (P.PrintScreen, "PSCR")
, (P.PrintScreen, "PSCREEN")
, (P.ScrollLock, "SLCK")
, (P.ScrollLock, "SCROLLLOCK")
, (P.Pause, "PAUS")
, (P.Pause, "PAUSE")
, (P.Pause, "BRK")
, (P.Insert, "INS")
, (P.Insert, "INSERT")
, (P.Delete, "DEL")
, (P.Delete, "DELETE")
, (P.Home, "HOME")
, (P.End, "END")
, (P.PageUp, "PGUP")
, (P.PageDown, "PGDN")
, (P.PageDown, "PGDOWN")
, (P.Up, "UP")
, (P.Left, "LEFT")
, (P.Down, "DOWN")
, (P.Right, "RGHT")
, (P.Right, "RIGHT")
, (P.NumLock, "NLCK")
, (P.NumLock, "NUMLOCK")
, (P.KP_Div, "PSLS")
, (P.KP_Div, "KP_SLASH")
, (P.KP_Mult, "PAST")
, (P.KP_Mult, "KP_ASTERISK")
, (P.KP_Min, "PMNS")
, (P.KP_Min, "KP_MINUS")
, (P.KP_7, "P7")
, (P.KP_7, "KP_7")
, (P.KP_8, "P8")
, (P.KP_8, "KP_8")
, (P.KP_9, "P9")
, (P.KP_9, "KP_9")
, (P.KP_Plus, "PPLS")
, (P.KP_Plus, "KP_PLUS")
, (P.KP_4, "P4")
, (P.KP_4, "KP_4")
, (P.KP_5, "P5")
, (P.KP_5, "KP_5")
, (P.KP_6, "P6")
, (P.KP_6, "KP_6")
, (P.KP_Comma, "PCMM")
, (P.KP_Comma, "KP_COMMA")
, (P.KP_1, "P1")
, (P.KP_1, "KP_1")
, (P.KP_2, "P2")
, (P.KP_2, "KP_2")
, (P.KP_3, "P3")
, (P.KP_3, "KP_3")
, (P.KP_Enter, "PENT")
, (P.KP_Enter, "KP_ENTER")
, (P.KP_0, "P0")
, (P.KP_0, "KP_0")
, (P.KP_Dec, "PDOT")
, (P.KP_Dec, "KP_DOT")
, (P.KP_Eq, "PEQL")
, (P.KP_Eq, "KP_EQUAL")
, (P.PlayPause, "MPLY")
, (P.PlayPause, "MEDIA_PLAY_PAUSE")
, (P.AudioPlay, "MPLY")
, (P.AudioPlay, "MEDIA_PLAY_PAUSE")
, (P.Previous, "MPRV")
, (P.Previous, "MEDIA_PREV_TRACK")
, (P.Next, "MNXT")
, (P.Next, "MEDIA_NEXT_TRACK")
, (P.Stop, "MSTP")
, (P.Stop, "MEDIA_STOP")
, (P.AudioRewind, "MRWD")
, (P.AudioRewind, "MEDIA_REWIND")
, (P.AudioForward, "MFFD")
, (P.AudioForward, "MEDIA_FAST_FORWARD")
, (P.Mute, "MUTE")
, (P.Mute, "AUDIO_MUTE")
, (P.VolumeDown, "VOLD")
, (P.VolumeDown, "AUDIO_VOL_DOWN")
, (P.VolumeUp, "VOLU")
, (P.VolumeUp, "AUDIO_VOL_UP")
, (P.Eject, "EJCT")
, (P.Eject, "MEDIA_EJECT")
, (P.Browser_Back, "WBAK")
, (P.Browser_Back, "WWW_BACK")
, (P.Browser_Forward, "WFWD")
, (P.Browser_Forward, "WWW_FORWARD")
, (P.Browser_Refresh, "WREF")
, (P.Browser_Refresh, "WWW_REFRESH")
, (P.Browser_Stop, "WSTP")
, (P.Browser_Stop, "WWW_STOP")
, (P.Browser_Search, "WSCH")
, (P.Browser_Search, "WWW_SEARCH")
, (P.Browser_Favorites, "WFAV")
, (P.Browser_Favorites, "WWW_FAVORITES")
, (P.Calculator, "CALC")
, (P.Calculator, "CALCULATOR")
, (P.MediaPlayer, "MSEL")
, (P.Browser, "WHOM")
, (P.Browser, "WWW_HOME")
, (P.Mail, "MAIL")
, (P.Search, "FIND")
, (P.MyComputer, "MYCM")
, (P.MyComputer, "MY_COMPUTER")
, (P.Help, "HELP")
, (P.Power, "PWR")
, (P.Power, "POWER")
, (P.Power, "SYSTEM_POWER")
, (P.Sleep, "SLEP")
, (P.Sleep, "SYSTEM_SLEEP")
, (P.Wake, "WAKE")
, (P.Wake, "SYSTEM_WAKE")
, (P.F13, "F13")
, (P.F14, "F14")
, (P.F15, "F15")
, (P.F16, "F16")
, (P.F17, "F17")
, (P.F18, "F18")
, (P.F19, "F19")
, (P.F20, "F20")
, (P.F21, "F21")
, (P.F22, "F22")
, (P.F23, "F23")
, (P.F24, "F24")
, (P.Hash, "NUHS")
, (P.Hash, "NONUS_HASH")
, (P.Ro, "RO")
, (P.Yen, "JYEN")
, (P.Muhenkan, "MHEN")
, (P.Henkan, "HENK")
, (P.Katakana, "KANA")
] | 5,765 | posAndTmkAction =
[ (P.Tilde, "GRV")
, (P.Tilde, "GRAVE")
, (P.Tilde, "ZKHK")
, (P.N1, "1")
, (P.N2, "2")
, (P.N3, "3")
, (P.N4, "4")
, (P.N5, "5")
, (P.N6, "6")
, (P.N7, "7")
, (P.N8, "8")
, (P.N9, "9")
, (P.N0, "0")
, (P.Minus, "MINS")
, (P.Minus, "MINUS")
, (P.Plus, "EQL")
, (P.Plus, "EQUAL")
, (P.Backspace, "BSPC")
, (P.Backspace, "BSPACE")
, (P.Tab, "TAB")
, (P.Q, "Q")
, (P.W, "W")
, (P.E, "E")
, (P.R, "R")
, (P.T, "T")
, (P.Y, "Y")
, (P.U, "U")
, (P.I, "I")
, (P.O, "O")
, (P.P, "P")
, (P.Bracket_L, "LBRC")
, (P.Bracket_L, "LBRACKET")
, (P.Bracket_R, "RBRC")
, (P.Bracket_R, "RBRACKET")
, (P.Backslash, "BSLS")
, (P.Backslash, "BSLASH")
, (P.CapsLock, "CAPS")
, (P.CapsLock, "CAPSLOCK")
, (P.CapsLock, "CLCK")
, (P.A, "A")
, (P.S, "S")
, (P.D, "D")
, (P.F, "F")
, (P.G, "G")
, (P.H, "H")
, (P.J, "J")
, (P.K, "K")
, (P.L, "L")
, (P.Semicolon, "SCLN")
, (P.Semicolon, "SCOLON")
, (P.Apastrophe, "QUOT")
, (P.Apastrophe, "QUOTE")
, (P.Enter, "ENT")
, (P.Enter, "ENTER")
, (P.Shift_L, "LSFT")
, (P.Shift_L, "LSHIFT")
, (P.Iso, "NUBS")
, (P.Iso, "NONUS_BSLASH")
, (P.Z, "Z")
, (P.X, "X")
, (P.C, "C")
, (P.V, "V")
, (P.B, "B")
, (P.N, "N")
, (P.M, "M")
, (P.Comma, "COMM")
, (P.Comma, "COMMA")
, (P.Period, "DOT")
, (P.Slash, "SLSH")
, (P.Slash, "SLASH")
, (P.Shift_R, "RSFT")
, (P.Shift_R, "RSHIFT")
, (P.Control_L, "LCTL")
, (P.Control_L, "LCTRL")
, (P.Win_L, "LGUI")
, (P.Alt_L, "LALT")
, (P.Space, "SPC")
, (P.Space, "SPACE")
, (P.Alt_R, "RALT")
, (P.Win_R, "RGUI")
-- , (P.Menu, "MENU")
, (P.Menu, "APP")
, (P.Menu, "APPLICATION")
, (P.Control_R, "RCTL")
, (P.Control_R, "RCTRL")
, (P.Esc, "ESC")
, (P.Esc, "ESCAPE")
, (P.F1, "F1")
, (P.F2, "F2")
, (P.F3, "F3")
, (P.F4, "F4")
, (P.F5, "F5")
, (P.F6, "F6")
, (P.F7, "F7")
, (P.F8, "F8")
, (P.F9, "F9")
, (P.F10, "F10")
, (P.F11, "F11")
, (P.F12, "F12")
, (P.PrintScreen, "PSCR")
, (P.PrintScreen, "PSCREEN")
, (P.ScrollLock, "SLCK")
, (P.ScrollLock, "SCROLLLOCK")
, (P.Pause, "PAUS")
, (P.Pause, "PAUSE")
, (P.Pause, "BRK")
, (P.Insert, "INS")
, (P.Insert, "INSERT")
, (P.Delete, "DEL")
, (P.Delete, "DELETE")
, (P.Home, "HOME")
, (P.End, "END")
, (P.PageUp, "PGUP")
, (P.PageDown, "PGDN")
, (P.PageDown, "PGDOWN")
, (P.Up, "UP")
, (P.Left, "LEFT")
, (P.Down, "DOWN")
, (P.Right, "RGHT")
, (P.Right, "RIGHT")
, (P.NumLock, "NLCK")
, (P.NumLock, "NUMLOCK")
, (P.KP_Div, "PSLS")
, (P.KP_Div, "KP_SLASH")
, (P.KP_Mult, "PAST")
, (P.KP_Mult, "KP_ASTERISK")
, (P.KP_Min, "PMNS")
, (P.KP_Min, "KP_MINUS")
, (P.KP_7, "P7")
, (P.KP_7, "KP_7")
, (P.KP_8, "P8")
, (P.KP_8, "KP_8")
, (P.KP_9, "P9")
, (P.KP_9, "KP_9")
, (P.KP_Plus, "PPLS")
, (P.KP_Plus, "KP_PLUS")
, (P.KP_4, "P4")
, (P.KP_4, "KP_4")
, (P.KP_5, "P5")
, (P.KP_5, "KP_5")
, (P.KP_6, "P6")
, (P.KP_6, "KP_6")
, (P.KP_Comma, "PCMM")
, (P.KP_Comma, "KP_COMMA")
, (P.KP_1, "P1")
, (P.KP_1, "KP_1")
, (P.KP_2, "P2")
, (P.KP_2, "KP_2")
, (P.KP_3, "P3")
, (P.KP_3, "KP_3")
, (P.KP_Enter, "PENT")
, (P.KP_Enter, "KP_ENTER")
, (P.KP_0, "P0")
, (P.KP_0, "KP_0")
, (P.KP_Dec, "PDOT")
, (P.KP_Dec, "KP_DOT")
, (P.KP_Eq, "PEQL")
, (P.KP_Eq, "KP_EQUAL")
, (P.PlayPause, "MPLY")
, (P.PlayPause, "MEDIA_PLAY_PAUSE")
, (P.AudioPlay, "MPLY")
, (P.AudioPlay, "MEDIA_PLAY_PAUSE")
, (P.Previous, "MPRV")
, (P.Previous, "MEDIA_PREV_TRACK")
, (P.Next, "MNXT")
, (P.Next, "MEDIA_NEXT_TRACK")
, (P.Stop, "MSTP")
, (P.Stop, "MEDIA_STOP")
, (P.AudioRewind, "MRWD")
, (P.AudioRewind, "MEDIA_REWIND")
, (P.AudioForward, "MFFD")
, (P.AudioForward, "MEDIA_FAST_FORWARD")
, (P.Mute, "MUTE")
, (P.Mute, "AUDIO_MUTE")
, (P.VolumeDown, "VOLD")
, (P.VolumeDown, "AUDIO_VOL_DOWN")
, (P.VolumeUp, "VOLU")
, (P.VolumeUp, "AUDIO_VOL_UP")
, (P.Eject, "EJCT")
, (P.Eject, "MEDIA_EJECT")
, (P.Browser_Back, "WBAK")
, (P.Browser_Back, "WWW_BACK")
, (P.Browser_Forward, "WFWD")
, (P.Browser_Forward, "WWW_FORWARD")
, (P.Browser_Refresh, "WREF")
, (P.Browser_Refresh, "WWW_REFRESH")
, (P.Browser_Stop, "WSTP")
, (P.Browser_Stop, "WWW_STOP")
, (P.Browser_Search, "WSCH")
, (P.Browser_Search, "WWW_SEARCH")
, (P.Browser_Favorites, "WFAV")
, (P.Browser_Favorites, "WWW_FAVORITES")
, (P.Calculator, "CALC")
, (P.Calculator, "CALCULATOR")
, (P.MediaPlayer, "MSEL")
, (P.Browser, "WHOM")
, (P.Browser, "WWW_HOME")
, (P.Mail, "MAIL")
, (P.Search, "FIND")
, (P.MyComputer, "MYCM")
, (P.MyComputer, "MY_COMPUTER")
, (P.Help, "HELP")
, (P.Power, "PWR")
, (P.Power, "POWER")
, (P.Power, "SYSTEM_POWER")
, (P.Sleep, "SLEP")
, (P.Sleep, "SYSTEM_SLEEP")
, (P.Wake, "WAKE")
, (P.Wake, "SYSTEM_WAKE")
, (P.F13, "F13")
, (P.F14, "F14")
, (P.F15, "F15")
, (P.F16, "F16")
, (P.F17, "F17")
, (P.F18, "F18")
, (P.F19, "F19")
, (P.F20, "F20")
, (P.F21, "F21")
, (P.F22, "F22")
, (P.F23, "F23")
, (P.F24, "F24")
, (P.Hash, "NUHS")
, (P.Hash, "NONUS_HASH")
, (P.Ro, "RO")
, (P.Yen, "JYEN")
, (P.Muhenkan, "MHEN")
, (P.Henkan, "HENK")
, (P.Katakana, "KANA")
] | 5,731 | false | true | 0 | 7 | 1,618 | 2,518 | 1,602 | 916 | null | null |
Hodapp87/ivory | ivory-backend-c/src/Ivory/Compile/C/Gen.hs | bsd-3-clause | exp2 :: [C.Exp] -> C.Exp
exp2 = flip (!!) 2 | 43 | exp2 :: [C.Exp] -> C.Exp
exp2 = flip (!!) 2 | 43 | exp2 = flip (!!) 2 | 18 | false | true | 0 | 8 | 9 | 35 | 17 | 18 | null | null |
tanakh/MonadPoint | src/MonadPoint/Presentation.hs | bsd-3-clause | pageConcat :: [Component] -> Component
pageConcat ps = head ret
where
totl = length ps
qs = map (\(p, i) -> seq p $ scl 0.9 $ sclrd 0.05 0.05 $
TextComponent False AlignLeft $
show i ++ "/"++ show totl) $
zip ps [1..]
ret = [ prp (nxp p (ix+1)) (ix-1)
| (p, ix) <- zip qs [0..]]
nxp p ix | ix<length ret = seq p $ next $ ret !! ix
| otherwise = p
prp p ix | ix>=0 = seq p $ prev $ ret !! ix
| otherwise = p
scl d m = Component $ Scaled d d m
sclrd w h m =
holz (1-h) () $
vert (1-w) () m | 658 | pageConcat :: [Component] -> Component
pageConcat ps = head ret
where
totl = length ps
qs = map (\(p, i) -> seq p $ scl 0.9 $ sclrd 0.05 0.05 $
TextComponent False AlignLeft $
show i ++ "/"++ show totl) $
zip ps [1..]
ret = [ prp (nxp p (ix+1)) (ix-1)
| (p, ix) <- zip qs [0..]]
nxp p ix | ix<length ret = seq p $ next $ ret !! ix
| otherwise = p
prp p ix | ix>=0 = seq p $ prev $ ret !! ix
| otherwise = p
scl d m = Component $ Scaled d d m
sclrd w h m =
holz (1-h) () $
vert (1-w) () m | 657 | pageConcat ps = head ret
where
totl = length ps
qs = map (\(p, i) -> seq p $ scl 0.9 $ sclrd 0.05 0.05 $
TextComponent False AlignLeft $
show i ++ "/"++ show totl) $
zip ps [1..]
ret = [ prp (nxp p (ix+1)) (ix-1)
| (p, ix) <- zip qs [0..]]
nxp p ix | ix<length ret = seq p $ next $ ret !! ix
| otherwise = p
prp p ix | ix>=0 = seq p $ prev $ ret !! ix
| otherwise = p
scl d m = Component $ Scaled d d m
sclrd w h m =
holz (1-h) () $
vert (1-w) () m | 618 | false | true | 15 | 14 | 290 | 376 | 165 | 211 | null | null |
nikita-volkov/laika | library/Laika/Parsing/XMLTree.hs | mit | lazyText :: C.Text -> Either Text [Node]
lazyText =
first interpretError . D.eitherResult . D.parse (B.nodes <* A.endOfInput)
where
interpretError x =
fromString (showString "XML parsing error: " x) | 212 | lazyText :: C.Text -> Either Text [Node]
lazyText =
first interpretError . D.eitherResult . D.parse (B.nodes <* A.endOfInput)
where
interpretError x =
fromString (showString "XML parsing error: " x) | 212 | lazyText =
first interpretError . D.eitherResult . D.parse (B.nodes <* A.endOfInput)
where
interpretError x =
fromString (showString "XML parsing error: " x) | 171 | false | true | 0 | 9 | 42 | 76 | 37 | 39 | null | null |
sergv/vector | Data/Vector/Generic.hs | bsd-3-clause | unstablePartition f = unstablePartition_stream f . stream | 57 | unstablePartition f = unstablePartition_stream f . stream | 57 | unstablePartition f = unstablePartition_stream f . stream | 57 | false | false | 1 | 6 | 6 | 20 | 7 | 13 | null | null |
prowdsponsor/esqueleto | src/Database/Esqueleto/Internal/Sql.hs | bsd-3-clause | initialIdentState :: IdentState
initialIdentState = IdentState mempty | 69 | initialIdentState :: IdentState
initialIdentState = IdentState mempty | 69 | initialIdentState = IdentState mempty | 37 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
pdbartlett/misc-stuff | unfuddle/PdbMisc/Haskell/HelloHaskell/par.hs | apache-2.0 | fac n = n * fac (n - 1) | 23 | fac n = n * fac (n - 1) | 23 | fac n = n * fac (n - 1) | 23 | false | false | 0 | 8 | 8 | 23 | 11 | 12 | null | null |
pernas/Primes | Primes.hs | unlicense | --------------------------------------------------------------------------------
-- the longer is the randomList, the higher is the accuracy of the test
isPrime :: (RandomGen g, Integral a, Random a) => g -> a -> Bool
isPrime seed can = isPrimePure can $ randomList seed (2,can-2) 20 | 283 | isPrime :: (RandomGen g, Integral a, Random a) => g -> a -> Bool
isPrime seed can = isPrimePure can $ randomList seed (2,can-2) 20 | 130 | isPrime seed can = isPrimePure can $ randomList seed (2,can-2) 20 | 65 | true | true | 2 | 9 | 39 | 77 | 38 | 39 | null | null |
ckaestne/CIDE | other/CaseStudies/fgl/CIDEfgl/Data/Graph/Inductive/Monad.hs | gpl-3.0 | mkUGraphM :: (GraphM m gr) => [Node] -> [Edge] -> m (gr () ());
mkUGraphM vs es = mkGraphM (labUNodes vs) (labUEdges es) | 122 | mkUGraphM :: (GraphM m gr) => [Node] -> [Edge] -> m (gr () ())
mkUGraphM vs es = mkGraphM (labUNodes vs) (labUEdges es) | 119 | mkUGraphM vs es = mkGraphM (labUNodes vs) (labUEdges es) | 56 | false | true | 1 | 11 | 24 | 81 | 39 | 42 | null | null |
codeq/language-go | src/Language/Go/LexerUtils.hs | mit | keywords :: Map.Map String (SrcSpan -> Token)
keywords = Map.fromList keywordNames | 82 | keywords :: Map.Map String (SrcSpan -> Token)
keywords = Map.fromList keywordNames | 82 | keywords = Map.fromList keywordNames | 36 | false | true | 0 | 7 | 10 | 30 | 15 | 15 | null | null |
DanielWaterworth/Idris-dev | src/Idris/WhoCalls.hs | bsd-3-clause | occursDef n (CaseOp _ ty _ _ _ defs) = occurs n ty || occursSC n (snd (cases_compiletime defs)) | 95 | occursDef n (CaseOp _ ty _ _ _ defs) = occurs n ty || occursSC n (snd (cases_compiletime defs)) | 95 | occursDef n (CaseOp _ ty _ _ _ defs) = occurs n ty || occursSC n (snd (cases_compiletime defs)) | 95 | false | false | 0 | 10 | 18 | 55 | 25 | 30 | null | null |
Peaker/lamdu | src/Lamdu/Builtins/Anchors.hs | gpl-3.0 | genericVarTag :: Tag
genericVarTag =
-- This random UUID was generated in the stdlib prior to being a "builtin"
"\xa3\x86\xd9\x80\xd9os$Q\xf7\xb7\xb7\xeb\xab\x44\x1c" | 174 | genericVarTag :: Tag
genericVarTag =
-- This random UUID was generated in the stdlib prior to being a "builtin"
"\xa3\x86\xd9\x80\xd9os$Q\xf7\xb7\xb7\xeb\xab\x44\x1c" | 174 | genericVarTag =
-- This random UUID was generated in the stdlib prior to being a "builtin"
"\xa3\x86\xd9\x80\xd9os$Q\xf7\xb7\xb7\xeb\xab\x44\x1c" | 153 | false | true | 0 | 6 | 27 | 19 | 8 | 11 | null | null |
ezyang/ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | cmpAltCon (LitAlt _) DEFAULT = GT | 40 | cmpAltCon (LitAlt _) DEFAULT = GT | 40 | cmpAltCon (LitAlt _) DEFAULT = GT | 40 | false | false | 0 | 7 | 12 | 17 | 8 | 9 | null | null |
arianvp/binary-serialise-cbor | Data/Binary/Serialise/CBOR/FlatTerm.hs | bsd-3-clause | fromFlatTerm :: Decoder a -- ^ A @'Dec.Decoder'@ for a serialized value.
-> FlatTerm -- ^ The serialized @'FlatTerm'@.
-> Either String a -- ^ The deserialized value, or an error.
fromFlatTerm decoder ft = go (getDecodeAction decoder) ft
where
go (ConsumeWord k) (TkInt n : ts)
| n >= 0 = go (k (unW# (fromIntegral n))) ts
go (ConsumeWord k) (TkInteger n : ts)
| n >= 0 = go (k (unW# (fromIntegral n))) ts
go (ConsumeWord8 k) (TkInt n : ts)
| n >= 0 && n <= maxWord8 = go (k (unW# (fromIntegral n))) ts
go (ConsumeWord8 k) (TkInteger n : ts)
| n >= 0 && n <= maxWord8 = go (k (unW# (fromIntegral n))) ts
go (ConsumeWord16 k) (TkInt n : ts)
| n >= 0 && n <= maxWord16 = go (k (unW# (fromIntegral n))) ts
go (ConsumeWord16 k) (TkInteger n : ts)
| n >= 0 && n <= maxWord16 = go (k (unW# (fromIntegral n))) ts
go (ConsumeWord32 k) (TkInt n : ts)
| n >= 0 && n <= maxWord32 = go (k (unW# (fromIntegral n))) ts
go (ConsumeWord32 k) (TkInteger n : ts)
| n >= 0 && n <= maxWord32 = go (k (unW# (fromIntegral n))) ts
go (ConsumeNegWord k) (TkInt n : ts)
| n < 0 = go (k (unW# (fromIntegral (-1-n)))) ts
go (ConsumeNegWord k) (TkInteger n : ts)
| n < 0 = go (k (unW# (fromIntegral (-1-n)))) ts
go (ConsumeInt k) (TkInt n : ts) = go (k (unI# n)) ts
go (ConsumeInt k) (TkInteger n : ts)
| n <= maxInt = go (k (unI# (fromIntegral n))) ts
go (ConsumeInt8 k) (TkInt n : ts)
| n >= minInt8 && n <= maxInt8 = go (k (unI# n)) ts
go (ConsumeInt8 k) (TkInteger n : ts)
| n >= minInt8 && n <= maxInt8 = go (k (unI# (fromIntegral n))) ts
go (ConsumeInt16 k) (TkInt n : ts)
| n >= minInt16 && n <= maxInt16 = go (k (unI# n)) ts
go (ConsumeInt16 k) (TkInteger n : ts)
| n >= minInt16 && n <= maxInt16 = go (k (unI# (fromIntegral n))) ts
go (ConsumeInt32 k) (TkInt n : ts)
| n >= minInt32 && n <= maxInt32 = go (k (unI# n)) ts
go (ConsumeInt32 k) (TkInteger n : ts)
| n >= minInt32 && n <= maxInt32 = go (k (unI# (fromIntegral n))) ts
go (ConsumeInteger k) (TkInt n : ts) = go (k (fromIntegral n)) ts
go (ConsumeInteger k) (TkInteger n : ts) = go (k n) ts
go (ConsumeListLen k) (TkListLen n : ts)
| n <= maxInt = go (k (unI# (fromIntegral n))) ts
go (ConsumeMapLen k) (TkMapLen n : ts)
| n <= maxInt = go (k (unI# (fromIntegral n))) ts
go (ConsumeTag k) (TkTag n : ts)
| n <= maxWord = go (k (unW# (fromIntegral n))) ts
#if defined(ARCH_32bit)
-- 64bit variants for 32bit machines
go (ConsumeWord64 k) (TkInt n : ts)
| n >= 0 = go (k (unW64# (fromIntegral n))) ts
go (ConsumeWord64 k) (TkInteger n : ts)
| n >= 0 = go (k (unW64# (fromIntegral n))) ts
go (ConsumeNegWord64 k) (TkInt n : ts)
| n < 0 = go (k (unW64# (fromIntegral (-1-n)))) ts
go (ConsumeNegWord64 k) (TkInteger n : ts)
| n < 0 = go (k (unW64# (fromIntegral (-1-n)))) ts
go (ConsumeInt64 k) (TkInt n : ts) = go (k (unI64# (fromIntegral n))) ts
go (ConsumeInt64 k) (TkInteger n : ts) = go (k (unI64# (fromIntegral n))) ts
go (ConsumeTag64 k) (TkTag n : ts) = go (k (unW64# n)) ts
-- TODO FIXME (aseipp/dcoutts): are these going to be utilized?
-- see fallthrough case below if/when fixed.
go (ConsumeListLen64 _) ts = unexpected "decodeListLen64" ts
go (ConsumeMapLen64 _) ts = unexpected "decodeMapLen64" ts
#endif
go (ConsumeFloat k) (TkFloat16 f : ts) = go (k (unF# f)) ts
go (ConsumeFloat k) (TkFloat32 f : ts) = go (k (unF# f)) ts
go (ConsumeDouble k) (TkFloat16 f : ts) = go (k (unD# (float2Double f))) ts
go (ConsumeDouble k) (TkFloat32 f : ts) = go (k (unD# (float2Double f))) ts
go (ConsumeDouble k) (TkFloat64 f : ts) = go (k (unD# f)) ts
go (ConsumeBytes k) (TkBytes bs : ts) = go (k bs) ts
go (ConsumeString k) (TkString st : ts) = go (k st) ts
go (ConsumeBool k) (TkBool b : ts) = go (k b) ts
go (ConsumeSimple k) (TkSimple n : ts) = go (k (unW8# n)) ts
go (ConsumeBytesIndef da) (TkBytesBegin : ts) = go da ts
go (ConsumeStringIndef da) (TkStringBegin : ts) = go da ts
go (ConsumeListLenIndef da) (TkListBegin : ts) = go da ts
go (ConsumeMapLenIndef da) (TkMapBegin : ts) = go da ts
go (ConsumeNull da) (TkNull : ts) = go da ts
go (ConsumeListLenOrIndef k) (TkListLen n : ts)
| n <= maxInt = go (k (unI# (fromIntegral n))) ts
go (ConsumeListLenOrIndef k) (TkListBegin : ts) = go (k (-1#)) ts
go (ConsumeMapLenOrIndef k) (TkMapLen n : ts)
| n <= maxInt = go (k (unI# (fromIntegral n))) ts
go (ConsumeMapLenOrIndef k) (TkMapBegin : ts) = go (k (-1#)) ts
go (ConsumeBreakOr k) (TkBreak : ts) = go (k True) ts
go (ConsumeBreakOr k) ts@(_ : _ ) = go (k False) ts
go (PeekTokenType k) ts@(tk:_) = go (k (tokenTypeOf tk)) ts
go (PeekTokenType _) ts = unexpected "peekTokenType" ts
go (Fail msg) _ = Left msg
go (Done x) [] = Right x
go (Done _) ts = Left ("trailing tokens: " ++ show (take 5 ts))
----------------------------------------------------------------------------
-- Fallthrough cases: unhandled token/DecodeAction combinations
go (ConsumeWord _) ts = unexpected "decodeWord" ts
go (ConsumeWord8 _) ts = unexpected "decodeWord8" ts
go (ConsumeWord16 _) ts = unexpected "decodeWord16" ts
go (ConsumeWord32 _) ts = unexpected "decodeWord32" ts
go (ConsumeNegWord _) ts = unexpected "decodeNegWord" ts
go (ConsumeInt _) ts = unexpected "decodeInt" ts
go (ConsumeInt8 _) ts = unexpected "decodeInt8" ts
go (ConsumeInt16 _) ts = unexpected "decodeInt16" ts
go (ConsumeInt32 _) ts = unexpected "decodeInt32" ts
go (ConsumeInteger _) ts = unexpected "decodeInteger" ts
go (ConsumeListLen _) ts = unexpected "decodeListLen" ts
go (ConsumeMapLen _) ts = unexpected "decodeMapLen" ts
go (ConsumeTag _) ts = unexpected "decodeTag" ts
go (ConsumeFloat _) ts = unexpected "decodeFloat" ts
go (ConsumeDouble _) ts = unexpected "decodeDouble" ts
go (ConsumeBytes _) ts = unexpected "decodeBytes" ts
go (ConsumeString _) ts = unexpected "decodeString" ts
go (ConsumeBool _) ts = unexpected "decodeBool" ts
go (ConsumeSimple _) ts = unexpected "decodeSimple" ts
#if defined(ARCH_32bit)
-- 64bit variants for 32bit machines
go (ConsumeWord64 _) ts = unexpected "decodeWord64" ts
go (ConsumeNegWord64 _) ts = unexpected "decodeNegWord64" ts
go (ConsumeInt64 _) ts = unexpected "decodeInt64" ts
go (ConsumeTag64 _) ts = unexpected "decodeTag64" ts
--go (ConsumeListLen64 _) ts = unexpected "decodeListLen64" ts
--go (ConsumeMapLen64 _) ts = unexpected "decodeMapLen64" ts
#endif
go (ConsumeBytesIndef _) ts = unexpected "decodeBytesIndef" ts
go (ConsumeStringIndef _) ts = unexpected "decodeStringIndef" ts
go (ConsumeListLenIndef _) ts = unexpected "decodeListLenIndef" ts
go (ConsumeMapLenIndef _) ts = unexpected "decodeMapLenIndef" ts
go (ConsumeNull _) ts = unexpected "decodeNull" ts
go (ConsumeListLenOrIndef _) ts = unexpected "decodeListLenOrIndef" ts
go (ConsumeMapLenOrIndef _) ts = unexpected "decodeMapLenOrIndef" ts
go (ConsumeBreakOr _) ts = unexpected "decodeBreakOr" ts
unexpected name [] = Left $ name ++ ": unexpected end of input"
unexpected name (tok:_) = Left $ name ++ ": unexpected token " ++ show tok | 8,377 | fromFlatTerm :: Decoder a -- ^ A @'Dec.Decoder'@ for a serialized value.
-> FlatTerm -- ^ The serialized @'FlatTerm'@.
-> Either String a
fromFlatTerm decoder ft = go (getDecodeAction decoder) ft
where
go (ConsumeWord k) (TkInt n : ts)
| n >= 0 = go (k (unW# (fromIntegral n))) ts
go (ConsumeWord k) (TkInteger n : ts)
| n >= 0 = go (k (unW# (fromIntegral n))) ts
go (ConsumeWord8 k) (TkInt n : ts)
| n >= 0 && n <= maxWord8 = go (k (unW# (fromIntegral n))) ts
go (ConsumeWord8 k) (TkInteger n : ts)
| n >= 0 && n <= maxWord8 = go (k (unW# (fromIntegral n))) ts
go (ConsumeWord16 k) (TkInt n : ts)
| n >= 0 && n <= maxWord16 = go (k (unW# (fromIntegral n))) ts
go (ConsumeWord16 k) (TkInteger n : ts)
| n >= 0 && n <= maxWord16 = go (k (unW# (fromIntegral n))) ts
go (ConsumeWord32 k) (TkInt n : ts)
| n >= 0 && n <= maxWord32 = go (k (unW# (fromIntegral n))) ts
go (ConsumeWord32 k) (TkInteger n : ts)
| n >= 0 && n <= maxWord32 = go (k (unW# (fromIntegral n))) ts
go (ConsumeNegWord k) (TkInt n : ts)
| n < 0 = go (k (unW# (fromIntegral (-1-n)))) ts
go (ConsumeNegWord k) (TkInteger n : ts)
| n < 0 = go (k (unW# (fromIntegral (-1-n)))) ts
go (ConsumeInt k) (TkInt n : ts) = go (k (unI# n)) ts
go (ConsumeInt k) (TkInteger n : ts)
| n <= maxInt = go (k (unI# (fromIntegral n))) ts
go (ConsumeInt8 k) (TkInt n : ts)
| n >= minInt8 && n <= maxInt8 = go (k (unI# n)) ts
go (ConsumeInt8 k) (TkInteger n : ts)
| n >= minInt8 && n <= maxInt8 = go (k (unI# (fromIntegral n))) ts
go (ConsumeInt16 k) (TkInt n : ts)
| n >= minInt16 && n <= maxInt16 = go (k (unI# n)) ts
go (ConsumeInt16 k) (TkInteger n : ts)
| n >= minInt16 && n <= maxInt16 = go (k (unI# (fromIntegral n))) ts
go (ConsumeInt32 k) (TkInt n : ts)
| n >= minInt32 && n <= maxInt32 = go (k (unI# n)) ts
go (ConsumeInt32 k) (TkInteger n : ts)
| n >= minInt32 && n <= maxInt32 = go (k (unI# (fromIntegral n))) ts
go (ConsumeInteger k) (TkInt n : ts) = go (k (fromIntegral n)) ts
go (ConsumeInteger k) (TkInteger n : ts) = go (k n) ts
go (ConsumeListLen k) (TkListLen n : ts)
| n <= maxInt = go (k (unI# (fromIntegral n))) ts
go (ConsumeMapLen k) (TkMapLen n : ts)
| n <= maxInt = go (k (unI# (fromIntegral n))) ts
go (ConsumeTag k) (TkTag n : ts)
| n <= maxWord = go (k (unW# (fromIntegral n))) ts
#if defined(ARCH_32bit)
-- 64bit variants for 32bit machines
go (ConsumeWord64 k) (TkInt n : ts)
| n >= 0 = go (k (unW64# (fromIntegral n))) ts
go (ConsumeWord64 k) (TkInteger n : ts)
| n >= 0 = go (k (unW64# (fromIntegral n))) ts
go (ConsumeNegWord64 k) (TkInt n : ts)
| n < 0 = go (k (unW64# (fromIntegral (-1-n)))) ts
go (ConsumeNegWord64 k) (TkInteger n : ts)
| n < 0 = go (k (unW64# (fromIntegral (-1-n)))) ts
go (ConsumeInt64 k) (TkInt n : ts) = go (k (unI64# (fromIntegral n))) ts
go (ConsumeInt64 k) (TkInteger n : ts) = go (k (unI64# (fromIntegral n))) ts
go (ConsumeTag64 k) (TkTag n : ts) = go (k (unW64# n)) ts
-- TODO FIXME (aseipp/dcoutts): are these going to be utilized?
-- see fallthrough case below if/when fixed.
go (ConsumeListLen64 _) ts = unexpected "decodeListLen64" ts
go (ConsumeMapLen64 _) ts = unexpected "decodeMapLen64" ts
#endif
go (ConsumeFloat k) (TkFloat16 f : ts) = go (k (unF# f)) ts
go (ConsumeFloat k) (TkFloat32 f : ts) = go (k (unF# f)) ts
go (ConsumeDouble k) (TkFloat16 f : ts) = go (k (unD# (float2Double f))) ts
go (ConsumeDouble k) (TkFloat32 f : ts) = go (k (unD# (float2Double f))) ts
go (ConsumeDouble k) (TkFloat64 f : ts) = go (k (unD# f)) ts
go (ConsumeBytes k) (TkBytes bs : ts) = go (k bs) ts
go (ConsumeString k) (TkString st : ts) = go (k st) ts
go (ConsumeBool k) (TkBool b : ts) = go (k b) ts
go (ConsumeSimple k) (TkSimple n : ts) = go (k (unW8# n)) ts
go (ConsumeBytesIndef da) (TkBytesBegin : ts) = go da ts
go (ConsumeStringIndef da) (TkStringBegin : ts) = go da ts
go (ConsumeListLenIndef da) (TkListBegin : ts) = go da ts
go (ConsumeMapLenIndef da) (TkMapBegin : ts) = go da ts
go (ConsumeNull da) (TkNull : ts) = go da ts
go (ConsumeListLenOrIndef k) (TkListLen n : ts)
| n <= maxInt = go (k (unI# (fromIntegral n))) ts
go (ConsumeListLenOrIndef k) (TkListBegin : ts) = go (k (-1#)) ts
go (ConsumeMapLenOrIndef k) (TkMapLen n : ts)
| n <= maxInt = go (k (unI# (fromIntegral n))) ts
go (ConsumeMapLenOrIndef k) (TkMapBegin : ts) = go (k (-1#)) ts
go (ConsumeBreakOr k) (TkBreak : ts) = go (k True) ts
go (ConsumeBreakOr k) ts@(_ : _ ) = go (k False) ts
go (PeekTokenType k) ts@(tk:_) = go (k (tokenTypeOf tk)) ts
go (PeekTokenType _) ts = unexpected "peekTokenType" ts
go (Fail msg) _ = Left msg
go (Done x) [] = Right x
go (Done _) ts = Left ("trailing tokens: " ++ show (take 5 ts))
----------------------------------------------------------------------------
-- Fallthrough cases: unhandled token/DecodeAction combinations
go (ConsumeWord _) ts = unexpected "decodeWord" ts
go (ConsumeWord8 _) ts = unexpected "decodeWord8" ts
go (ConsumeWord16 _) ts = unexpected "decodeWord16" ts
go (ConsumeWord32 _) ts = unexpected "decodeWord32" ts
go (ConsumeNegWord _) ts = unexpected "decodeNegWord" ts
go (ConsumeInt _) ts = unexpected "decodeInt" ts
go (ConsumeInt8 _) ts = unexpected "decodeInt8" ts
go (ConsumeInt16 _) ts = unexpected "decodeInt16" ts
go (ConsumeInt32 _) ts = unexpected "decodeInt32" ts
go (ConsumeInteger _) ts = unexpected "decodeInteger" ts
go (ConsumeListLen _) ts = unexpected "decodeListLen" ts
go (ConsumeMapLen _) ts = unexpected "decodeMapLen" ts
go (ConsumeTag _) ts = unexpected "decodeTag" ts
go (ConsumeFloat _) ts = unexpected "decodeFloat" ts
go (ConsumeDouble _) ts = unexpected "decodeDouble" ts
go (ConsumeBytes _) ts = unexpected "decodeBytes" ts
go (ConsumeString _) ts = unexpected "decodeString" ts
go (ConsumeBool _) ts = unexpected "decodeBool" ts
go (ConsumeSimple _) ts = unexpected "decodeSimple" ts
#if defined(ARCH_32bit)
-- 64bit variants for 32bit machines
go (ConsumeWord64 _) ts = unexpected "decodeWord64" ts
go (ConsumeNegWord64 _) ts = unexpected "decodeNegWord64" ts
go (ConsumeInt64 _) ts = unexpected "decodeInt64" ts
go (ConsumeTag64 _) ts = unexpected "decodeTag64" ts
--go (ConsumeListLen64 _) ts = unexpected "decodeListLen64" ts
--go (ConsumeMapLen64 _) ts = unexpected "decodeMapLen64" ts
#endif
go (ConsumeBytesIndef _) ts = unexpected "decodeBytesIndef" ts
go (ConsumeStringIndef _) ts = unexpected "decodeStringIndef" ts
go (ConsumeListLenIndef _) ts = unexpected "decodeListLenIndef" ts
go (ConsumeMapLenIndef _) ts = unexpected "decodeMapLenIndef" ts
go (ConsumeNull _) ts = unexpected "decodeNull" ts
go (ConsumeListLenOrIndef _) ts = unexpected "decodeListLenOrIndef" ts
go (ConsumeMapLenOrIndef _) ts = unexpected "decodeMapLenOrIndef" ts
go (ConsumeBreakOr _) ts = unexpected "decodeBreakOr" ts
unexpected name [] = Left $ name ++ ": unexpected end of input"
unexpected name (tok:_) = Left $ name ++ ": unexpected token " ++ show tok | 8,335 | fromFlatTerm decoder ft = go (getDecodeAction decoder) ft
where
go (ConsumeWord k) (TkInt n : ts)
| n >= 0 = go (k (unW# (fromIntegral n))) ts
go (ConsumeWord k) (TkInteger n : ts)
| n >= 0 = go (k (unW# (fromIntegral n))) ts
go (ConsumeWord8 k) (TkInt n : ts)
| n >= 0 && n <= maxWord8 = go (k (unW# (fromIntegral n))) ts
go (ConsumeWord8 k) (TkInteger n : ts)
| n >= 0 && n <= maxWord8 = go (k (unW# (fromIntegral n))) ts
go (ConsumeWord16 k) (TkInt n : ts)
| n >= 0 && n <= maxWord16 = go (k (unW# (fromIntegral n))) ts
go (ConsumeWord16 k) (TkInteger n : ts)
| n >= 0 && n <= maxWord16 = go (k (unW# (fromIntegral n))) ts
go (ConsumeWord32 k) (TkInt n : ts)
| n >= 0 && n <= maxWord32 = go (k (unW# (fromIntegral n))) ts
go (ConsumeWord32 k) (TkInteger n : ts)
| n >= 0 && n <= maxWord32 = go (k (unW# (fromIntegral n))) ts
go (ConsumeNegWord k) (TkInt n : ts)
| n < 0 = go (k (unW# (fromIntegral (-1-n)))) ts
go (ConsumeNegWord k) (TkInteger n : ts)
| n < 0 = go (k (unW# (fromIntegral (-1-n)))) ts
go (ConsumeInt k) (TkInt n : ts) = go (k (unI# n)) ts
go (ConsumeInt k) (TkInteger n : ts)
| n <= maxInt = go (k (unI# (fromIntegral n))) ts
go (ConsumeInt8 k) (TkInt n : ts)
| n >= minInt8 && n <= maxInt8 = go (k (unI# n)) ts
go (ConsumeInt8 k) (TkInteger n : ts)
| n >= minInt8 && n <= maxInt8 = go (k (unI# (fromIntegral n))) ts
go (ConsumeInt16 k) (TkInt n : ts)
| n >= minInt16 && n <= maxInt16 = go (k (unI# n)) ts
go (ConsumeInt16 k) (TkInteger n : ts)
| n >= minInt16 && n <= maxInt16 = go (k (unI# (fromIntegral n))) ts
go (ConsumeInt32 k) (TkInt n : ts)
| n >= minInt32 && n <= maxInt32 = go (k (unI# n)) ts
go (ConsumeInt32 k) (TkInteger n : ts)
| n >= minInt32 && n <= maxInt32 = go (k (unI# (fromIntegral n))) ts
go (ConsumeInteger k) (TkInt n : ts) = go (k (fromIntegral n)) ts
go (ConsumeInteger k) (TkInteger n : ts) = go (k n) ts
go (ConsumeListLen k) (TkListLen n : ts)
| n <= maxInt = go (k (unI# (fromIntegral n))) ts
go (ConsumeMapLen k) (TkMapLen n : ts)
| n <= maxInt = go (k (unI# (fromIntegral n))) ts
go (ConsumeTag k) (TkTag n : ts)
| n <= maxWord = go (k (unW# (fromIntegral n))) ts
#if defined(ARCH_32bit)
-- 64bit variants for 32bit machines
go (ConsumeWord64 k) (TkInt n : ts)
| n >= 0 = go (k (unW64# (fromIntegral n))) ts
go (ConsumeWord64 k) (TkInteger n : ts)
| n >= 0 = go (k (unW64# (fromIntegral n))) ts
go (ConsumeNegWord64 k) (TkInt n : ts)
| n < 0 = go (k (unW64# (fromIntegral (-1-n)))) ts
go (ConsumeNegWord64 k) (TkInteger n : ts)
| n < 0 = go (k (unW64# (fromIntegral (-1-n)))) ts
go (ConsumeInt64 k) (TkInt n : ts) = go (k (unI64# (fromIntegral n))) ts
go (ConsumeInt64 k) (TkInteger n : ts) = go (k (unI64# (fromIntegral n))) ts
go (ConsumeTag64 k) (TkTag n : ts) = go (k (unW64# n)) ts
-- TODO FIXME (aseipp/dcoutts): are these going to be utilized?
-- see fallthrough case below if/when fixed.
go (ConsumeListLen64 _) ts = unexpected "decodeListLen64" ts
go (ConsumeMapLen64 _) ts = unexpected "decodeMapLen64" ts
#endif
go (ConsumeFloat k) (TkFloat16 f : ts) = go (k (unF# f)) ts
go (ConsumeFloat k) (TkFloat32 f : ts) = go (k (unF# f)) ts
go (ConsumeDouble k) (TkFloat16 f : ts) = go (k (unD# (float2Double f))) ts
go (ConsumeDouble k) (TkFloat32 f : ts) = go (k (unD# (float2Double f))) ts
go (ConsumeDouble k) (TkFloat64 f : ts) = go (k (unD# f)) ts
go (ConsumeBytes k) (TkBytes bs : ts) = go (k bs) ts
go (ConsumeString k) (TkString st : ts) = go (k st) ts
go (ConsumeBool k) (TkBool b : ts) = go (k b) ts
go (ConsumeSimple k) (TkSimple n : ts) = go (k (unW8# n)) ts
go (ConsumeBytesIndef da) (TkBytesBegin : ts) = go da ts
go (ConsumeStringIndef da) (TkStringBegin : ts) = go da ts
go (ConsumeListLenIndef da) (TkListBegin : ts) = go da ts
go (ConsumeMapLenIndef da) (TkMapBegin : ts) = go da ts
go (ConsumeNull da) (TkNull : ts) = go da ts
go (ConsumeListLenOrIndef k) (TkListLen n : ts)
| n <= maxInt = go (k (unI# (fromIntegral n))) ts
go (ConsumeListLenOrIndef k) (TkListBegin : ts) = go (k (-1#)) ts
go (ConsumeMapLenOrIndef k) (TkMapLen n : ts)
| n <= maxInt = go (k (unI# (fromIntegral n))) ts
go (ConsumeMapLenOrIndef k) (TkMapBegin : ts) = go (k (-1#)) ts
go (ConsumeBreakOr k) (TkBreak : ts) = go (k True) ts
go (ConsumeBreakOr k) ts@(_ : _ ) = go (k False) ts
go (PeekTokenType k) ts@(tk:_) = go (k (tokenTypeOf tk)) ts
go (PeekTokenType _) ts = unexpected "peekTokenType" ts
go (Fail msg) _ = Left msg
go (Done x) [] = Right x
go (Done _) ts = Left ("trailing tokens: " ++ show (take 5 ts))
----------------------------------------------------------------------------
-- Fallthrough cases: unhandled token/DecodeAction combinations
go (ConsumeWord _) ts = unexpected "decodeWord" ts
go (ConsumeWord8 _) ts = unexpected "decodeWord8" ts
go (ConsumeWord16 _) ts = unexpected "decodeWord16" ts
go (ConsumeWord32 _) ts = unexpected "decodeWord32" ts
go (ConsumeNegWord _) ts = unexpected "decodeNegWord" ts
go (ConsumeInt _) ts = unexpected "decodeInt" ts
go (ConsumeInt8 _) ts = unexpected "decodeInt8" ts
go (ConsumeInt16 _) ts = unexpected "decodeInt16" ts
go (ConsumeInt32 _) ts = unexpected "decodeInt32" ts
go (ConsumeInteger _) ts = unexpected "decodeInteger" ts
go (ConsumeListLen _) ts = unexpected "decodeListLen" ts
go (ConsumeMapLen _) ts = unexpected "decodeMapLen" ts
go (ConsumeTag _) ts = unexpected "decodeTag" ts
go (ConsumeFloat _) ts = unexpected "decodeFloat" ts
go (ConsumeDouble _) ts = unexpected "decodeDouble" ts
go (ConsumeBytes _) ts = unexpected "decodeBytes" ts
go (ConsumeString _) ts = unexpected "decodeString" ts
go (ConsumeBool _) ts = unexpected "decodeBool" ts
go (ConsumeSimple _) ts = unexpected "decodeSimple" ts
#if defined(ARCH_32bit)
-- 64bit variants for 32bit machines
go (ConsumeWord64 _) ts = unexpected "decodeWord64" ts
go (ConsumeNegWord64 _) ts = unexpected "decodeNegWord64" ts
go (ConsumeInt64 _) ts = unexpected "decodeInt64" ts
go (ConsumeTag64 _) ts = unexpected "decodeTag64" ts
--go (ConsumeListLen64 _) ts = unexpected "decodeListLen64" ts
--go (ConsumeMapLen64 _) ts = unexpected "decodeMapLen64" ts
#endif
go (ConsumeBytesIndef _) ts = unexpected "decodeBytesIndef" ts
go (ConsumeStringIndef _) ts = unexpected "decodeStringIndef" ts
go (ConsumeListLenIndef _) ts = unexpected "decodeListLenIndef" ts
go (ConsumeMapLenIndef _) ts = unexpected "decodeMapLenIndef" ts
go (ConsumeNull _) ts = unexpected "decodeNull" ts
go (ConsumeListLenOrIndef _) ts = unexpected "decodeListLenOrIndef" ts
go (ConsumeMapLenOrIndef _) ts = unexpected "decodeMapLenOrIndef" ts
go (ConsumeBreakOr _) ts = unexpected "decodeBreakOr" ts
unexpected name [] = Left $ name ++ ": unexpected end of input"
unexpected name (tok:_) = Left $ name ++ ": unexpected token " ++ show tok | 8,158 | true | true | 0 | 15 | 2,755 | 3,529 | 1,709 | 1,820 | null | null |
zeyuanxy/haskell-playground | write-yourself-a-scheme/chap7/main.hs | mit | unpackEquals :: LispVal -> LispVal -> Unpacker -> ThrowsError Bool
unpackEquals arg1 arg2 (AnyUnpacker unpacker) = do
unpacked1 <- unpacker arg1
unpacked2 <- unpacker arg2
return $ unpacked1 == unpacked2
`catchError` (const $ return False) | 247 | unpackEquals :: LispVal -> LispVal -> Unpacker -> ThrowsError Bool
unpackEquals arg1 arg2 (AnyUnpacker unpacker) = do
unpacked1 <- unpacker arg1
unpacked2 <- unpacker arg2
return $ unpacked1 == unpacked2
`catchError` (const $ return False) | 247 | unpackEquals arg1 arg2 (AnyUnpacker unpacker) = do
unpacked1 <- unpacker arg1
unpacked2 <- unpacker arg2
return $ unpacked1 == unpacked2
`catchError` (const $ return False) | 180 | false | true | 0 | 9 | 42 | 90 | 42 | 48 | null | null |
xmonad/xmonad-contrib | XMonad/Config/Dmwit.hs | bsd-3-clause | xmobarCommand (S s) = unwords ["xmobar",
"-x", show s,
"-t", template s,
"-C", pipeReader
]
where
template 0 = "}%focus%{%workspaces%"
template _ = "%date%}%focus%{%workspaces%"
pipeReader = "'[\
\Run PipeReader \"" ++ pipeName "focus" s ++ "\" \"focus\",\
\Run PipeReader \"" ++ pipeName "workspaces" s ++ "\" \"workspaces\"\
\]'" | 392 | xmobarCommand (S s) = unwords ["xmobar",
"-x", show s,
"-t", template s,
"-C", pipeReader
]
where
template 0 = "}%focus%{%workspaces%"
template _ = "%date%}%focus%{%workspaces%"
pipeReader = "'[\
\Run PipeReader \"" ++ pipeName "focus" s ++ "\" \"focus\",\
\Run PipeReader \"" ++ pipeName "workspaces" s ++ "\" \"workspaces\"\
\]'" | 392 | xmobarCommand (S s) = unwords ["xmobar",
"-x", show s,
"-t", template s,
"-C", pipeReader
]
where
template 0 = "}%focus%{%workspaces%"
template _ = "%date%}%focus%{%workspaces%"
pipeReader = "'[\
\Run PipeReader \"" ++ pipeName "focus" s ++ "\" \"focus\",\
\Run PipeReader \"" ++ pipeName "workspaces" s ++ "\" \"workspaces\"\
\]'" | 392 | false | false | 0 | 9 | 108 | 95 | 48 | 47 | null | null |
apyrgio/snf-ganeti | src/Ganeti/HTools/Backend/Luxi.hs | bsd-2-clause | annotateConvert :: String -> String -> String -> Result a -> Result a
annotateConvert otype oname oattr =
annotateResult $ otype ++ " '" ++ oname ++
"', error while reading attribute '" ++ oattr ++ "'" | 207 | annotateConvert :: String -> String -> String -> Result a -> Result a
annotateConvert otype oname oattr =
annotateResult $ otype ++ " '" ++ oname ++
"', error while reading attribute '" ++ oattr ++ "'" | 207 | annotateConvert otype oname oattr =
annotateResult $ otype ++ " '" ++ oname ++
"', error while reading attribute '" ++ oattr ++ "'" | 137 | false | true | 2 | 9 | 42 | 70 | 32 | 38 | null | null |
fxmy/haskell-book-exercise | src/Wat.hs | gpl-3.0 | flipMaybe (Just a : rest) =
case flipMaybe rest of
Nothing -> Nothing
Just as -> Just $ a:as | 108 | flipMaybe (Just a : rest) =
case flipMaybe rest of
Nothing -> Nothing
Just as -> Just $ a:as | 108 | flipMaybe (Just a : rest) =
case flipMaybe rest of
Nothing -> Nothing
Just as -> Just $ a:as | 108 | false | false | 0 | 9 | 34 | 50 | 23 | 27 | null | null |
judge0/api-base | tests/ghc/main.hs | gpl-3.0 | main = do
str <- getLine
printf "hello, %s\n" str | 57 | main = do
str <- getLine
printf "hello, %s\n" str | 57 | main = do
str <- getLine
printf "hello, %s\n" str | 57 | false | false | 0 | 7 | 17 | 21 | 9 | 12 | null | null |
ekmett/time-series | src/Data/Time/Series/Literal.hs | bsd-3-clause | double :: Literate t => Double -> t Double
double a = _Literal # Double a | 73 | double :: Literate t => Double -> t Double
double a = _Literal # Double a | 73 | double a = _Literal # Double a | 30 | false | true | 0 | 7 | 15 | 35 | 16 | 19 | null | null |
mboes/dedukti | Dedukti/Module.hs | gpl-3.0 | objPathFromModule :: MName -> FilePath
objPathFromModule = pathFromModule ".dko" | 80 | objPathFromModule :: MName -> FilePath
objPathFromModule = pathFromModule ".dko" | 80 | objPathFromModule = pathFromModule ".dko" | 41 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
joelburget/material-ui-hs | src/React/MaterialUI/Elements.hs | mit | raisedButton :: [AttrOrHandler s] -> ReactNode s
raisedButton attrs = foreignLeaf mui_raisedButton attrs () | 107 | raisedButton :: [AttrOrHandler s] -> ReactNode s
raisedButton attrs = foreignLeaf mui_raisedButton attrs () | 107 | raisedButton attrs = foreignLeaf mui_raisedButton attrs () | 58 | false | true | 0 | 7 | 13 | 36 | 17 | 19 | null | null |
mightymoose/liquidhaskell | src/Language/Haskell/Liquid/RefType.hs | bsd-3-clause | isDecreasing autoenv _ (RApp c _ _ _)
= isJust (sizeFunction (rtc_info c)) -- user specified size or
|| isSizeable autoenv tc
where tc = rtc_tc c | 153 | isDecreasing autoenv _ (RApp c _ _ _)
= isJust (sizeFunction (rtc_info c)) -- user specified size or
|| isSizeable autoenv tc
where tc = rtc_tc c | 153 | isDecreasing autoenv _ (RApp c _ _ _)
= isJust (sizeFunction (rtc_info c)) -- user specified size or
|| isSizeable autoenv tc
where tc = rtc_tc c | 153 | false | false | 1 | 9 | 34 | 56 | 27 | 29 | null | null |
imccoy/utopia | src/Code.hs | mit | frameResult :: Exp -> Exp
frameResult frame = app (var "frameResult")
[("frameResult_frame", frame)] | 124 | frameResult :: Exp -> Exp
frameResult frame = app (var "frameResult")
[("frameResult_frame", frame)] | 124 | frameResult frame = app (var "frameResult")
[("frameResult_frame", frame)] | 98 | false | true | 0 | 7 | 36 | 44 | 21 | 23 | null | null |
OS2World/DEV-UTIL-HUGS | oldlib/PatriciaLoMap.hs | bsd-3-clause | insertWith f k x t@(L j y) = if j == k then L k (f x y) else join k (L k x) j t | 79 | insertWith f k x t@(L j y) = if j == k then L k (f x y) else join k (L k x) j t | 79 | insertWith f k x t@(L j y) = if j == k then L k (f x y) else join k (L k x) j t | 79 | false | false | 0 | 8 | 25 | 68 | 34 | 34 | null | null |
sbditto85/parsedsltest | test/Generators.hs | apache-2.0 | replaceSlash [] = [] | 20 | replaceSlash [] = [] | 20 | replaceSlash [] = [] | 20 | false | false | 0 | 6 | 3 | 13 | 6 | 7 | null | null |
bitemyapp/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | esActionGrow :: String
esActionGrow = "grow" | 44 | esActionGrow :: String
esActionGrow = "grow" | 44 | esActionGrow = "grow" | 21 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
UBMLtonGroup/timberc | src/Common.hs | bsd-3-clause | delete k (x:xs)
| fst x == k = xs
| otherwise = x : delete k xs | 102 | delete k (x:xs)
| fst x == k = xs
| otherwise = x : delete k xs | 102 | delete k (x:xs)
| fst x == k = xs
| otherwise = x : delete k xs | 102 | false | false | 1 | 9 | 56 | 47 | 22 | 25 | null | null |
mmachenry/final-fortune | src/Card.hs | bsd-2-clause | isColor :: Color -> Card -> Bool
isColor color card = color `elem` cardColors card | 82 | isColor :: Color -> Card -> Bool
isColor color card = color `elem` cardColors card | 82 | isColor color card = color `elem` cardColors card | 49 | false | true | 0 | 8 | 14 | 38 | 18 | 20 | null | null |
sdiehl/ghc | compiler/GHC/Iface/Ext/Utils.hs | bsd-3-clause | hieTypeToIface :: HieTypeFix -> IfaceType
hieTypeToIface = foldType go
where
go (HTyVarTy n) = IfaceTyVar $ occNameFS $ getOccName n
go (HAppTy a b) = IfaceAppTy a (hieToIfaceArgs b)
go (HLitTy l) = IfaceLitTy l
go (HForAllTy ((n,k),af) t) = let b = (occNameFS $ getOccName n, k)
in IfaceForAllTy (Bndr (IfaceTvBndr b) af) t
go (HFunTy a b) = IfaceFunTy VisArg a b
go (HQualTy pred b) = IfaceFunTy InvisArg pred b
go (HCastTy a) = a
go HCoercionTy = IfaceTyVar "<coercion type>"
go (HTyConApp a xs) = IfaceTyConApp a (hieToIfaceArgs xs)
-- This isn't fully faithful - we can't produce the 'Inferred' case
hieToIfaceArgs :: HieArgs IfaceType -> IfaceAppArgs
hieToIfaceArgs (HieArgs xs) = go' xs
where
go' [] = IA_Nil
go' ((True ,x):xs) = IA_Arg x Required $ go' xs
go' ((False,x):xs) = IA_Arg x Specified $ go' xs | 936 | hieTypeToIface :: HieTypeFix -> IfaceType
hieTypeToIface = foldType go
where
go (HTyVarTy n) = IfaceTyVar $ occNameFS $ getOccName n
go (HAppTy a b) = IfaceAppTy a (hieToIfaceArgs b)
go (HLitTy l) = IfaceLitTy l
go (HForAllTy ((n,k),af) t) = let b = (occNameFS $ getOccName n, k)
in IfaceForAllTy (Bndr (IfaceTvBndr b) af) t
go (HFunTy a b) = IfaceFunTy VisArg a b
go (HQualTy pred b) = IfaceFunTy InvisArg pred b
go (HCastTy a) = a
go HCoercionTy = IfaceTyVar "<coercion type>"
go (HTyConApp a xs) = IfaceTyConApp a (hieToIfaceArgs xs)
-- This isn't fully faithful - we can't produce the 'Inferred' case
hieToIfaceArgs :: HieArgs IfaceType -> IfaceAppArgs
hieToIfaceArgs (HieArgs xs) = go' xs
where
go' [] = IA_Nil
go' ((True ,x):xs) = IA_Arg x Required $ go' xs
go' ((False,x):xs) = IA_Arg x Specified $ go' xs | 936 | hieTypeToIface = foldType go
where
go (HTyVarTy n) = IfaceTyVar $ occNameFS $ getOccName n
go (HAppTy a b) = IfaceAppTy a (hieToIfaceArgs b)
go (HLitTy l) = IfaceLitTy l
go (HForAllTy ((n,k),af) t) = let b = (occNameFS $ getOccName n, k)
in IfaceForAllTy (Bndr (IfaceTvBndr b) af) t
go (HFunTy a b) = IfaceFunTy VisArg a b
go (HQualTy pred b) = IfaceFunTy InvisArg pred b
go (HCastTy a) = a
go HCoercionTy = IfaceTyVar "<coercion type>"
go (HTyConApp a xs) = IfaceTyConApp a (hieToIfaceArgs xs)
-- This isn't fully faithful - we can't produce the 'Inferred' case
hieToIfaceArgs :: HieArgs IfaceType -> IfaceAppArgs
hieToIfaceArgs (HieArgs xs) = go' xs
where
go' [] = IA_Nil
go' ((True ,x):xs) = IA_Arg x Required $ go' xs
go' ((False,x):xs) = IA_Arg x Specified $ go' xs | 894 | false | true | 17 | 13 | 264 | 356 | 182 | 174 | null | null |
li-zhirui/EoplLangs | src/CallByReference/Parser.hs | bsd-3-clause | unaryOpsMap :: [(String, UnaryOp)]
unaryOpsMap =
[ ("minus", Minus), ("zero?", IsZero) ] | 90 | unaryOpsMap :: [(String, UnaryOp)]
unaryOpsMap =
[ ("minus", Minus), ("zero?", IsZero) ] | 90 | unaryOpsMap =
[ ("minus", Minus), ("zero?", IsZero) ] | 55 | false | true | 0 | 6 | 13 | 38 | 24 | 14 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.