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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
JohnLato/impulse | src/Reactive/Impulse/Internal/RWST.hs | lgpl-3.0 | listen :: (Monad m) => RWST r w s m a -> RWST r w s m (a, w)
listen m = RWST $ \w r s -> do
(a, s', w') <- runRWST' m w r s
return ((a, w'), s', w') | 156 | listen :: (Monad m) => RWST r w s m a -> RWST r w s m (a, w)
listen m = RWST $ \w r s -> do
(a, s', w') <- runRWST' m w r s
return ((a, w'), s', w') | 156 | listen m = RWST $ \w r s -> do
(a, s', w') <- runRWST' m w r s
return ((a, w'), s', w') | 95 | false | true | 0 | 11 | 50 | 114 | 60 | 54 | null | null |
sinelaw/cv-combinators | src/Test.hs | gpl-2.0 | faceDetect :: Processor.IOProcessor Image [CvRect]
faceDetect = haarDetect "/usr/share/opencv/haarcascades/haarcascade_frontalface_alt.xml" 1.1 3 CV.haarFlagNone (CvSize 20 20) | 176 | faceDetect :: Processor.IOProcessor Image [CvRect]
faceDetect = haarDetect "/usr/share/opencv/haarcascades/haarcascade_frontalface_alt.xml" 1.1 3 CV.haarFlagNone (CvSize 20 20) | 176 | faceDetect = haarDetect "/usr/share/opencv/haarcascades/haarcascade_frontalface_alt.xml" 1.1 3 CV.haarFlagNone (CvSize 20 20) | 125 | false | true | 0 | 7 | 14 | 42 | 21 | 21 | null | null |
athanclark/nested-routes-website | src/Application/Types.hs | bsd-3-clause | getAllUsers :: Query UserBase [User]
getAllUsers = do
(UserBase us) <- ask
return $ toAscList (Ix.Proxy :: Ix.Proxy Email) us | 129 | getAllUsers :: Query UserBase [User]
getAllUsers = do
(UserBase us) <- ask
return $ toAscList (Ix.Proxy :: Ix.Proxy Email) us | 129 | getAllUsers = do
(UserBase us) <- ask
return $ toAscList (Ix.Proxy :: Ix.Proxy Email) us | 92 | false | true | 1 | 12 | 23 | 62 | 28 | 34 | null | null |
nevrenato/Hets_Fork | Common/MathLink.hs | gpl-2.0 | dfINPUTSTRPKT = 21 | 18 | dfINPUTSTRPKT = 21 | 18 | dfINPUTSTRPKT = 21 | 18 | false | false | 1 | 5 | 2 | 10 | 3 | 7 | null | null |
phischu/fragnix | tests/packages/scotty/Network.HTTP.Types.Status.hs | bsd-3-clause | -- | Reset Content 205
status205 :: Status
status205 = mkStatus 205 "Reset Content" | 83 | status205 :: Status
status205 = mkStatus 205 "Reset Content" | 60 | status205 = mkStatus 205 "Reset Content" | 40 | true | true | 0 | 5 | 13 | 17 | 9 | 8 | null | null |
google-research/dex-lang | src/lib/Type.hs | bsd-3-clause | typeCheckPrimCon :: Typer m => PrimCon (Atom i) -> m i o (Type o)
typeCheckPrimCon con = case con of
Lit l -> return $ BaseTy $ litType l
ProdCon xs -> ProdTy <$> mapM getTypeE xs
SumCon ty tag payload -> do
ty'@(SumTy caseTys) <- substM ty
unless (0 <= tag && tag < length caseTys) $ throw TypeErr "Invalid SumType tag"
payload |: (caseTys !! tag)
return ty'
SumAsProd ty tag _ -> tag |:TagRepTy >> substM ty -- TODO: check!
ClassDictHole _ ty -> ty |:TyKind >> substM ty
IntRangeVal l h i -> i|:IdxRepTy >> substM (TC $ IntRange l h)
IndexRangeVal t l h i -> i|:IdxRepTy >> substM (TC $ IndexRange t l h)
IndexSliceVal _ _ _ -> error "not implemented"
BaseTypeRef p -> do
(PtrTy (_, b)) <- getTypeE p
return $ RawRefTy $ BaseTy b
TabRef tabTy -> do
Pi (PiType binder Pure (RawRefTy a)) <- getTypeE tabTy
PiBinder _ _ TabArrow <- return binder
return $ RawRefTy $ Pi $ PiType binder Pure a
ConRef conRef -> case conRef of
ProdCon xs -> RawRefTy <$> (ProdTy <$> mapM typeCheckRef xs)
IntRangeVal l h i -> do
l' <- substM l
h' <- substM h
i|:(RawRefTy IdxRepTy) >> return (RawRefTy $ TC $ IntRange l' h')
IndexRangeVal t l h i -> do
t' <- substM t
l' <- mapM substM l
h' <- mapM substM h
i|:(RawRefTy IdxRepTy)
return $ RawRefTy $ TC $ IndexRange t' l' h'
SumAsProd ty tag _ -> do -- TODO: check args!
tag |:(RawRefTy TagRepTy)
RawRefTy <$> substM ty
_ -> error $ "Not a valid ref: " ++ pprint conRef
ParIndexCon t v -> t|:TyKind >> v|:IdxRepTy >> substM t
RecordRef xs -> (RawRefTy . StaticRecordTy) <$> traverse typeCheckRef xs
LabelCon _ -> return $ TC $ LabelType | 1,735 | typeCheckPrimCon :: Typer m => PrimCon (Atom i) -> m i o (Type o)
typeCheckPrimCon con = case con of
Lit l -> return $ BaseTy $ litType l
ProdCon xs -> ProdTy <$> mapM getTypeE xs
SumCon ty tag payload -> do
ty'@(SumTy caseTys) <- substM ty
unless (0 <= tag && tag < length caseTys) $ throw TypeErr "Invalid SumType tag"
payload |: (caseTys !! tag)
return ty'
SumAsProd ty tag _ -> tag |:TagRepTy >> substM ty -- TODO: check!
ClassDictHole _ ty -> ty |:TyKind >> substM ty
IntRangeVal l h i -> i|:IdxRepTy >> substM (TC $ IntRange l h)
IndexRangeVal t l h i -> i|:IdxRepTy >> substM (TC $ IndexRange t l h)
IndexSliceVal _ _ _ -> error "not implemented"
BaseTypeRef p -> do
(PtrTy (_, b)) <- getTypeE p
return $ RawRefTy $ BaseTy b
TabRef tabTy -> do
Pi (PiType binder Pure (RawRefTy a)) <- getTypeE tabTy
PiBinder _ _ TabArrow <- return binder
return $ RawRefTy $ Pi $ PiType binder Pure a
ConRef conRef -> case conRef of
ProdCon xs -> RawRefTy <$> (ProdTy <$> mapM typeCheckRef xs)
IntRangeVal l h i -> do
l' <- substM l
h' <- substM h
i|:(RawRefTy IdxRepTy) >> return (RawRefTy $ TC $ IntRange l' h')
IndexRangeVal t l h i -> do
t' <- substM t
l' <- mapM substM l
h' <- mapM substM h
i|:(RawRefTy IdxRepTy)
return $ RawRefTy $ TC $ IndexRange t' l' h'
SumAsProd ty tag _ -> do -- TODO: check args!
tag |:(RawRefTy TagRepTy)
RawRefTy <$> substM ty
_ -> error $ "Not a valid ref: " ++ pprint conRef
ParIndexCon t v -> t|:TyKind >> v|:IdxRepTy >> substM t
RecordRef xs -> (RawRefTy . StaticRecordTy) <$> traverse typeCheckRef xs
LabelCon _ -> return $ TC $ LabelType | 1,735 | typeCheckPrimCon con = case con of
Lit l -> return $ BaseTy $ litType l
ProdCon xs -> ProdTy <$> mapM getTypeE xs
SumCon ty tag payload -> do
ty'@(SumTy caseTys) <- substM ty
unless (0 <= tag && tag < length caseTys) $ throw TypeErr "Invalid SumType tag"
payload |: (caseTys !! tag)
return ty'
SumAsProd ty tag _ -> tag |:TagRepTy >> substM ty -- TODO: check!
ClassDictHole _ ty -> ty |:TyKind >> substM ty
IntRangeVal l h i -> i|:IdxRepTy >> substM (TC $ IntRange l h)
IndexRangeVal t l h i -> i|:IdxRepTy >> substM (TC $ IndexRange t l h)
IndexSliceVal _ _ _ -> error "not implemented"
BaseTypeRef p -> do
(PtrTy (_, b)) <- getTypeE p
return $ RawRefTy $ BaseTy b
TabRef tabTy -> do
Pi (PiType binder Pure (RawRefTy a)) <- getTypeE tabTy
PiBinder _ _ TabArrow <- return binder
return $ RawRefTy $ Pi $ PiType binder Pure a
ConRef conRef -> case conRef of
ProdCon xs -> RawRefTy <$> (ProdTy <$> mapM typeCheckRef xs)
IntRangeVal l h i -> do
l' <- substM l
h' <- substM h
i|:(RawRefTy IdxRepTy) >> return (RawRefTy $ TC $ IntRange l' h')
IndexRangeVal t l h i -> do
t' <- substM t
l' <- mapM substM l
h' <- mapM substM h
i|:(RawRefTy IdxRepTy)
return $ RawRefTy $ TC $ IndexRange t' l' h'
SumAsProd ty tag _ -> do -- TODO: check args!
tag |:(RawRefTy TagRepTy)
RawRefTy <$> substM ty
_ -> error $ "Not a valid ref: " ++ pprint conRef
ParIndexCon t v -> t|:TyKind >> v|:IdxRepTy >> substM t
RecordRef xs -> (RawRefTy . StaticRecordTy) <$> traverse typeCheckRef xs
LabelCon _ -> return $ TC $ LabelType | 1,669 | false | true | 31 | 14 | 473 | 758 | 346 | 412 | null | null |
beni55/HTTP | test/httpTests.hs | bsd-3-clause | port80Tests =
testGroup "Multiple servers" | 46 | port80Tests =
testGroup "Multiple servers" | 46 | port80Tests =
testGroup "Multiple servers" | 46 | false | false | 1 | 5 | 8 | 13 | 4 | 9 | null | null |
yliu120/K3 | src/Language/K3/Codegen/CPP/Preprocessing.hs | apache-2.0 | flattenApplicationE e = e | 25 | flattenApplicationE e = e | 25 | flattenApplicationE e = e | 25 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
luispedro/hex | hex/TestExpanded.hs | gpl-3.0 | case_csea = simple_expand csea @?= "<b><c>(bye)"
where
csea = "|def|bc{bc}%\n\
\|def|a{|b}%\n\
\|csname|expandafter|string|a c|endcsname%\n\
\|bye\n" | 209 | case_csea = simple_expand csea @?= "<b><c>(bye)"
where
csea = "|def|bc{bc}%\n\
\|def|a{|b}%\n\
\|csname|expandafter|string|a c|endcsname%\n\
\|bye\n" | 209 | case_csea = simple_expand csea @?= "<b><c>(bye)"
where
csea = "|def|bc{bc}%\n\
\|def|a{|b}%\n\
\|csname|expandafter|string|a c|endcsname%\n\
\|bye\n" | 209 | false | false | 2 | 6 | 73 | 28 | 10 | 18 | null | null |
mitchellwrosen/language-lua2 | src/Language/Lua/Lexer.hs | bsd-3-clause | luaStringLit :: RE Char String
luaStringLit = singleQuoted <|> doubleQuoted
where
singleQuoted :: RE Char String
singleQuoted = quoted '\''
doubleQuoted :: RE Char String
doubleQuoted = quoted '\"'
quoted :: Char -> RE Char String
quoted c = between c c $ many (escapeSequence <|> not_c)
where
not_c :: RE Char Char
not_c = psym (/= c)
escapeSequence :: RE Char Char
escapeSequence = sym '\\' *> sequences
where
sequences :: RE Char Char
sequences =
'\a' <$ sym 'a'
<|> '\b' <$ sym 'b'
<|> '\f' <$ sym 'f'
<|> '\n' <$ sym 'n'
<|> '\r' <$ sym 'r'
<|> '\t' <$ sym 't'
<|> '\v' <$ sym 'v'
<|> sym '\\'
<|> sym '"'
<|> sym '\''
<|> sym '\n'
<|> hexEscape
<|> decimalEscape
-- TODO: unicode escape
-- TODO: \z
where
hexEscape :: RE Char Char
hexEscape = go <$> (sym 'x' *> hexDigit) <*> hexDigit
where
go :: Char -> Char -> Char
go x y = let [(n,"")] = readHex [x,y] in chr n
decimalEscape :: RE Char Char
decimalEscape = chr . read <$> betweenN 1 3 digit
-- unicodeEscape :: RE Char String
-- unicodeEscape = (\a b c -> a ++ b ++ [c])
-- <$> "u{"
-- <*> some hexDigit
-- <*> sym '}' | 1,342 | luaStringLit :: RE Char String
luaStringLit = singleQuoted <|> doubleQuoted
where
singleQuoted :: RE Char String
singleQuoted = quoted '\''
doubleQuoted :: RE Char String
doubleQuoted = quoted '\"'
quoted :: Char -> RE Char String
quoted c = between c c $ many (escapeSequence <|> not_c)
where
not_c :: RE Char Char
not_c = psym (/= c)
escapeSequence :: RE Char Char
escapeSequence = sym '\\' *> sequences
where
sequences :: RE Char Char
sequences =
'\a' <$ sym 'a'
<|> '\b' <$ sym 'b'
<|> '\f' <$ sym 'f'
<|> '\n' <$ sym 'n'
<|> '\r' <$ sym 'r'
<|> '\t' <$ sym 't'
<|> '\v' <$ sym 'v'
<|> sym '\\'
<|> sym '"'
<|> sym '\''
<|> sym '\n'
<|> hexEscape
<|> decimalEscape
-- TODO: unicode escape
-- TODO: \z
where
hexEscape :: RE Char Char
hexEscape = go <$> (sym 'x' *> hexDigit) <*> hexDigit
where
go :: Char -> Char -> Char
go x y = let [(n,"")] = readHex [x,y] in chr n
decimalEscape :: RE Char Char
decimalEscape = chr . read <$> betweenN 1 3 digit
-- unicodeEscape :: RE Char String
-- unicodeEscape = (\a b c -> a ++ b ++ [c])
-- <$> "u{"
-- <*> some hexDigit
-- <*> sym '}' | 1,342 | luaStringLit = singleQuoted <|> doubleQuoted
where
singleQuoted :: RE Char String
singleQuoted = quoted '\''
doubleQuoted :: RE Char String
doubleQuoted = quoted '\"'
quoted :: Char -> RE Char String
quoted c = between c c $ many (escapeSequence <|> not_c)
where
not_c :: RE Char Char
not_c = psym (/= c)
escapeSequence :: RE Char Char
escapeSequence = sym '\\' *> sequences
where
sequences :: RE Char Char
sequences =
'\a' <$ sym 'a'
<|> '\b' <$ sym 'b'
<|> '\f' <$ sym 'f'
<|> '\n' <$ sym 'n'
<|> '\r' <$ sym 'r'
<|> '\t' <$ sym 't'
<|> '\v' <$ sym 'v'
<|> sym '\\'
<|> sym '"'
<|> sym '\''
<|> sym '\n'
<|> hexEscape
<|> decimalEscape
-- TODO: unicode escape
-- TODO: \z
where
hexEscape :: RE Char Char
hexEscape = go <$> (sym 'x' *> hexDigit) <*> hexDigit
where
go :: Char -> Char -> Char
go x y = let [(n,"")] = readHex [x,y] in chr n
decimalEscape :: RE Char Char
decimalEscape = chr . read <$> betweenN 1 3 digit
-- unicodeEscape :: RE Char String
-- unicodeEscape = (\a b c -> a ++ b ++ [c])
-- <$> "u{"
-- <*> some hexDigit
-- <*> sym '}' | 1,311 | false | true | 62 | 10 | 477 | 508 | 238 | 270 | null | null |
hamaxx/unity-2d-for-xmonad | xmonad-files/DBus-0.4/dist/build/autogen/Paths_DBus.hs | gpl-3.0 | version :: Version
version = Version {versionBranch = [0,4], versionTags = []} | 78 | version :: Version
version = Version {versionBranch = [0,4], versionTags = []} | 78 | version = Version {versionBranch = [0,4], versionTags = []} | 59 | false | true | 0 | 7 | 11 | 33 | 20 | 13 | null | null |
rueshyna/gogol | gogol-useraccounts/gen/Network/Google/UserAccounts/Types/Product.hs | mpl-2.0 | -- | [Output Only] Server-defined URL for this resource.
olSelfLink :: Lens' OperationList (Maybe Text)
olSelfLink
= lens _olSelfLink (\ s a -> s{_olSelfLink = a}) | 165 | olSelfLink :: Lens' OperationList (Maybe Text)
olSelfLink
= lens _olSelfLink (\ s a -> s{_olSelfLink = a}) | 108 | olSelfLink
= lens _olSelfLink (\ s a -> s{_olSelfLink = a}) | 61 | true | true | 0 | 9 | 27 | 48 | 25 | 23 | null | null |
kim/amazonka | amazonka-elb/gen/Network/AWS/ELB/AddTags.hs | mpl-2.0 | -- | The name of the load balancer to tag. You can specify a maximum of one load
-- balancer name.
atLoadBalancerNames :: Lens' AddTags [Text]
atLoadBalancerNames =
lens _atLoadBalancerNames (\s a -> s { _atLoadBalancerNames = a })
. _List | 251 | atLoadBalancerNames :: Lens' AddTags [Text]
atLoadBalancerNames =
lens _atLoadBalancerNames (\s a -> s { _atLoadBalancerNames = a })
. _List | 152 | atLoadBalancerNames =
lens _atLoadBalancerNames (\s a -> s { _atLoadBalancerNames = a })
. _List | 108 | true | true | 0 | 10 | 52 | 48 | 27 | 21 | null | null |
FranklinChen/musicxml2 | src/Data/Music/MusicXml/Pitch.hs | bsd-3-clause | pitchToFifths 3 1 = 6 | 21 | pitchToFifths 3 1 = 6 | 21 | pitchToFifths 3 1 = 6 | 21 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
martinnj/PMPH2015 | Assignment1/Task2+3/LHexamples.hs | mit | --------------------
-- sum --
--------------------
sumLH :: [Int] -> Int
sumLH [] = 0 | 98 | sumLH :: [Int] -> Int
sumLH [] = 0 | 35 | sumLH [] = 0 | 13 | true | true | 0 | 6 | 25 | 30 | 16 | 14 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2018/M06/D26/Solution.hs | mit | -- which means converting these properties into ... something? a Properties?
-- Nah: a Map already converts to a (JSON) Value, so just do that:
lines2Map :: [String] -> Map String String
lines2Map = Map.fromList . map (second (drop 2) . break ( == ':')) | 254 | lines2Map :: [String] -> Map String String
lines2Map = Map.fromList . map (second (drop 2) . break ( == ':')) | 109 | lines2Map = Map.fromList . map (second (drop 2) . break ( == ':')) | 66 | true | true | 1 | 10 | 45 | 64 | 31 | 33 | null | null |
teleshoes/taffybar | src/System/Taffybar/DBus.hs | bsd-3-clause | withToggleServer :: TaffybarConfig -> TaffybarConfig
withToggleServer = handleDBusToggles | 89 | withToggleServer :: TaffybarConfig -> TaffybarConfig
withToggleServer = handleDBusToggles | 89 | withToggleServer = handleDBusToggles | 36 | false | true | 0 | 5 | 7 | 15 | 8 | 7 | null | null |
jwbuurlage/category-theory-programmers | examples/haskell/functors.hs | mit | hed (Cons x xs) = Just x | 24 | hed (Cons x xs) = Just x | 24 | hed (Cons x xs) = Just x | 24 | false | false | 0 | 7 | 6 | 20 | 9 | 11 | null | null |
PierreR/streaming | benchmarks/StreamingTest.hs | bsd-3-clause | pipes_basic :: IO Int
pipes_basic = do
xs <- P.toListM $ P.each [1..1000000]
>-> P.filter even
>-> P.map (+1)
>-> P.drop 1000
>-> P.map (+1)
>-> P.filter (\x -> x `mod` 2 == 0)
assert (Prelude.length xs == 499000) $
return (Prelude.length xs) | 288 | pipes_basic :: IO Int
pipes_basic = do
xs <- P.toListM $ P.each [1..1000000]
>-> P.filter even
>-> P.map (+1)
>-> P.drop 1000
>-> P.map (+1)
>-> P.filter (\x -> x `mod` 2 == 0)
assert (Prelude.length xs == 499000) $
return (Prelude.length xs) | 288 | pipes_basic = do
xs <- P.toListM $ P.each [1..1000000]
>-> P.filter even
>-> P.map (+1)
>-> P.drop 1000
>-> P.map (+1)
>-> P.filter (\x -> x `mod` 2 == 0)
assert (Prelude.length xs == 499000) $
return (Prelude.length xs) | 266 | false | true | 0 | 15 | 88 | 141 | 70 | 71 | null | null |
ramaciotti/dependent-types | src/lib/DependentTypes/Data.hs | gpl-3.0 | typeName (DepType name _) = name | 32 | typeName (DepType name _) = name | 32 | typeName (DepType name _) = name | 32 | false | false | 0 | 6 | 5 | 18 | 8 | 10 | null | null |
markuspf/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | doOp v (LSRem (ATInt (ITFixed ty))) [x, y] = bitOp v "SRem" ty [x, y] | 69 | doOp v (LSRem (ATInt (ITFixed ty))) [x, y] = bitOp v "SRem" ty [x, y] | 69 | doOp v (LSRem (ATInt (ITFixed ty))) [x, y] = bitOp v "SRem" ty [x, y] | 69 | false | false | 1 | 11 | 14 | 55 | 27 | 28 | null | null |
dtekcth/DtekPortalen | src/Foundation.hs | bsd-2-clause | routePrivileges' (DocumentR (flip lookup documentPrivileges -> Just fs)) = Just fs | 82 | routePrivileges' (DocumentR (flip lookup documentPrivileges -> Just fs)) = Just fs | 82 | routePrivileges' (DocumentR (flip lookup documentPrivileges -> Just fs)) = Just fs | 82 | false | false | 0 | 10 | 10 | 33 | 15 | 18 | null | null |
siddhanathan/yi | yi-core/src/Yi/Buffer/HighLevel.hs | gpl-2.0 | -- | Return true if the current point is the end of a line
atEol :: BufferM Bool
atEol = atBoundaryB Line Forward | 113 | atEol :: BufferM Bool
atEol = atBoundaryB Line Forward | 54 | atEol = atBoundaryB Line Forward | 32 | true | true | 0 | 5 | 22 | 20 | 10 | 10 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/ApplePaySession.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/ApplePaySession.supportsVersion Mozilla ApplePaySession.supportsVersion documentation>
supportsVersion_ :: (MonadDOM m) => Word -> m ()
supportsVersion_ version
= liftDOM
(void
((jsg "ApplePaySession") ^. jsf "supportsVersion"
[toJSVal version])) | 331 | supportsVersion_ :: (MonadDOM m) => Word -> m ()
supportsVersion_ version
= liftDOM
(void
((jsg "ApplePaySession") ^. jsf "supportsVersion"
[toJSVal version])) | 188 | supportsVersion_ version
= liftDOM
(void
((jsg "ApplePaySession") ^. jsf "supportsVersion"
[toJSVal version])) | 139 | true | true | 0 | 12 | 56 | 66 | 33 | 33 | null | null |
Helium4Haskell/helium | src/Helium/Parser/Parser.hs | gpl-3.0 | exp_ :: ParsecT [Token] SourcePos Identity Expression
exp_ = addRange (
do
e <- exp0
option (\_ -> e) $
do
lexCOLCOL
t <- contextAndType
return $ \r -> Expression_Typed r e t
)
<?> Texts.parserExpression | 291 | exp_ :: ParsecT [Token] SourcePos Identity Expression
exp_ = addRange (
do
e <- exp0
option (\_ -> e) $
do
lexCOLCOL
t <- contextAndType
return $ \r -> Expression_Typed r e t
)
<?> Texts.parserExpression | 291 | exp_ = addRange (
do
e <- exp0
option (\_ -> e) $
do
lexCOLCOL
t <- contextAndType
return $ \r -> Expression_Typed r e t
)
<?> Texts.parserExpression | 237 | false | true | 2 | 13 | 123 | 96 | 44 | 52 | null | null |
brendanhay/gogol | gogol-firebase-rules/gen/Network/Google/FirebaseRules/Types/Product.hs | mpl-2.0 | -- | Syntactic and semantic \`Source\` issues of varying severity. Issues of
-- \`ERROR\` severity will prevent tests from executing.
trrIssues :: Lens' TestRulesetResponse [Issue]
trrIssues
= lens _trrIssues (\ s a -> s{_trrIssues = a}) .
_Default
. _Coerce | 272 | trrIssues :: Lens' TestRulesetResponse [Issue]
trrIssues
= lens _trrIssues (\ s a -> s{_trrIssues = a}) .
_Default
. _Coerce | 138 | trrIssues
= lens _trrIssues (\ s a -> s{_trrIssues = a}) .
_Default
. _Coerce | 91 | true | true | 0 | 11 | 53 | 54 | 29 | 25 | null | null |
christiaanb/ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | seqRules :: [CoreRule] -> ()
seqRules [] = () | 45 | seqRules :: [CoreRule] -> ()
seqRules [] = () | 45 | seqRules [] = () | 16 | false | true | 0 | 8 | 8 | 33 | 15 | 18 | null | null |
nfjinjing/mps | src/MPS/Math/HilbertFunction.hs | bsd-3-clause | numMonomials' n i = product [n'..n'+i'-1] `div` product [1..i']
where (n',i') = (toInteger n, toInteger i) | 108 | numMonomials' n i = product [n'..n'+i'-1] `div` product [1..i']
where (n',i') = (toInteger n, toInteger i) | 108 | numMonomials' n i = product [n'..n'+i'-1] `div` product [1..i']
where (n',i') = (toInteger n, toInteger i) | 108 | false | false | 0 | 9 | 17 | 67 | 35 | 32 | null | null |
kernelim/gitomail | Setup.hs | apache-2.0 | gitVersion :: IO ()
gitVersion = do
let filename = "src/Gitomail/Version.hs"
versionSh = "./version.sh"
hasVersionSh <- doesFileExist versionSh
when hasVersionSh $ do
ver <- fmap BS.pack $ readProcess versionSh [] ""
let override = BS.writeFile filename ver
e <- doesFileExist filename
if e then do orig_ver <- BS.readFile filename
when (ver /= orig_ver) $ do
override
else override | 498 | gitVersion :: IO ()
gitVersion = do
let filename = "src/Gitomail/Version.hs"
versionSh = "./version.sh"
hasVersionSh <- doesFileExist versionSh
when hasVersionSh $ do
ver <- fmap BS.pack $ readProcess versionSh [] ""
let override = BS.writeFile filename ver
e <- doesFileExist filename
if e then do orig_ver <- BS.readFile filename
when (ver /= orig_ver) $ do
override
else override | 498 | gitVersion = do
let filename = "src/Gitomail/Version.hs"
versionSh = "./version.sh"
hasVersionSh <- doesFileExist versionSh
when hasVersionSh $ do
ver <- fmap BS.pack $ readProcess versionSh [] ""
let override = BS.writeFile filename ver
e <- doesFileExist filename
if e then do orig_ver <- BS.readFile filename
when (ver /= orig_ver) $ do
override
else override | 478 | false | true | 0 | 16 | 173 | 150 | 66 | 84 | null | null |
prannayk/conj | Assignment 1/ques2.hs | gpl-3.0 | map :: (a->b) -> [a] -> [b]
map func input = foldr (\x acc -> (func x):acc) [] input | 84 | map :: (a->b) -> [a] -> [b]
map func input = foldr (\x acc -> (func x):acc) [] input | 84 | map func input = foldr (\x acc -> (func x):acc) [] input | 56 | false | true | 0 | 10 | 18 | 70 | 36 | 34 | null | null |
Happy0/snowdrift | Model/User.hs | agpl-3.0 | -- | Fetch a User's number of unviewed comments on each WikiPage of a Project.
fetchNumUnviewedCommentsOnProjectWikiPagesDB :: UserId -> ProjectId -> DB (Map WikiPageId Int)
fetchNumUnviewedCommentsOnProjectWikiPagesDB user_id project_id = fmap (M.fromList . map unwrapValues) $
select $
from $ \(c `InnerJoin` wp) -> do
on_ (c ^. CommentDiscussion ==. wp ^. WikiPageDiscussion)
where_ $
exprWikiPageOnProject wp project_id &&.
c ^. CommentId `notIn` exprUserViewedComments user_id
groupBy (wp ^. WikiPageId)
let countRows' = countRows :: SqlExpr (Value Int)
having (countRows' >. val 0)
return (wp ^. WikiPageId, countRows') | 673 | fetchNumUnviewedCommentsOnProjectWikiPagesDB :: UserId -> ProjectId -> DB (Map WikiPageId Int)
fetchNumUnviewedCommentsOnProjectWikiPagesDB user_id project_id = fmap (M.fromList . map unwrapValues) $
select $
from $ \(c `InnerJoin` wp) -> do
on_ (c ^. CommentDiscussion ==. wp ^. WikiPageDiscussion)
where_ $
exprWikiPageOnProject wp project_id &&.
c ^. CommentId `notIn` exprUserViewedComments user_id
groupBy (wp ^. WikiPageId)
let countRows' = countRows :: SqlExpr (Value Int)
having (countRows' >. val 0)
return (wp ^. WikiPageId, countRows') | 594 | fetchNumUnviewedCommentsOnProjectWikiPagesDB user_id project_id = fmap (M.fromList . map unwrapValues) $
select $
from $ \(c `InnerJoin` wp) -> do
on_ (c ^. CommentDiscussion ==. wp ^. WikiPageDiscussion)
where_ $
exprWikiPageOnProject wp project_id &&.
c ^. CommentId `notIn` exprUserViewedComments user_id
groupBy (wp ^. WikiPageId)
let countRows' = countRows :: SqlExpr (Value Int)
having (countRows' >. val 0)
return (wp ^. WikiPageId, countRows') | 499 | true | true | 0 | 14 | 133 | 193 | 95 | 98 | null | null |
purcell/adventofcodeteam | app/Eight.hs | bsd-3-clause | calculateExtraSpace :: [String] -> Int
calculateExtraSpace input = sum allLines
where allLines = map extraSpace input | 119 | calculateExtraSpace :: [String] -> Int
calculateExtraSpace input = sum allLines
where allLines = map extraSpace input | 119 | calculateExtraSpace input = sum allLines
where allLines = map extraSpace input | 80 | false | true | 1 | 7 | 17 | 47 | 19 | 28 | null | null |
23Skidoo/xmlhtml | src/Text/XmlHtml/Common.hs | bsd-3-clause | nodeText (Element _ _ c) = T.concat (map nodeText c) | 52 | nodeText (Element _ _ c) = T.concat (map nodeText c) | 52 | nodeText (Element _ _ c) = T.concat (map nodeText c) | 52 | false | false | 0 | 7 | 9 | 32 | 15 | 17 | null | null |
xmonad/xmonad-contrib | XMonad/Actions/WindowGo.hs | bsd-3-clause | -- | A manage hook that raises the window.
raiseHook :: ManageHook
raiseHook = ask >>= doF . W.focusWindow | 106 | raiseHook :: ManageHook
raiseHook = ask >>= doF . W.focusWindow | 63 | raiseHook = ask >>= doF . W.focusWindow | 39 | true | true | 0 | 6 | 18 | 22 | 12 | 10 | null | null |
keera-studios/sdl-ttf | Graphics/UI/SDL/TTF/Attributes.hs | bsd-3-clause | getFontStyle :: Font -> IO [FontStyle]
getFontStyle font
= withForeignPtr font $
fmap (fromBitmask . fromIntegral) . ttfGetFontStyle | 142 | getFontStyle :: Font -> IO [FontStyle]
getFontStyle font
= withForeignPtr font $
fmap (fromBitmask . fromIntegral) . ttfGetFontStyle | 142 | getFontStyle font
= withForeignPtr font $
fmap (fromBitmask . fromIntegral) . ttfGetFontStyle | 103 | false | true | 0 | 9 | 27 | 45 | 22 | 23 | null | null |
Noeda/adeonbot | terminal-emulator/src/Terminal/Screen.hs | mit | backgroundCode :: ScreenColor -> B.ByteString
backgroundCode Black = "40" | 73 | backgroundCode :: ScreenColor -> B.ByteString
backgroundCode Black = "40" | 73 | backgroundCode Black = "40" | 27 | false | true | 0 | 8 | 8 | 26 | 11 | 15 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2017/M02/D01/Exercise.hs | mit | {--
Okey-dokey, then! Let's GO THE DISTANCE!
or: what are the distances between the EMbary and Mars at any given time, t?
At which time t is the least-distance between the two points?
What is that distance?
TUNE IN TODAY TO FIND THE ANSWERS TO THESE QUESTIONS ... AND MORE!
--}
distance :: Triple -> Triple -> Double
distance = undefined | 342 | distance :: Triple -> Triple -> Double
distance = undefined | 59 | distance = undefined | 20 | true | true | 0 | 8 | 65 | 27 | 12 | 15 | null | null |
Lainepress/hledger | hledger-lib/Hledger/Data/Dates.hs | gpl-3.0 | latest (Just d1) (Just d2) = Just $ max d1 d2 | 45 | latest (Just d1) (Just d2) = Just $ max d1 d2 | 45 | latest (Just d1) (Just d2) = Just $ max d1 d2 | 45 | false | false | 0 | 7 | 10 | 32 | 15 | 17 | null | null |
timthelion/git-toggle | git-pile.hs | gpl-3.0 | subreposWarning = Warn "Recursive actions must search your directory tree. They may take a long time. Typically about 1 seccond per 2000 files." | 144 | subreposWarning = Warn "Recursive actions must search your directory tree. They may take a long time. Typically about 1 seccond per 2000 files." | 144 | subreposWarning = Warn "Recursive actions must search your directory tree. They may take a long time. Typically about 1 seccond per 2000 files." | 144 | false | false | 0 | 5 | 22 | 9 | 4 | 5 | null | null |
spacekitteh/smcghc | compiler/nativeGen/PPC/CodeGen.hs | bsd-3-clause | getRegister' :: DynFlags -> CmmExpr -> NatM Register
getRegister' _ (CmmReg (CmmGlobal PicBaseReg))
= do
reg <- getPicBaseNat archWordSize
return (Fixed archWordSize reg nilOL) | 191 | getRegister' :: DynFlags -> CmmExpr -> NatM Register
getRegister' _ (CmmReg (CmmGlobal PicBaseReg))
= do
reg <- getPicBaseNat archWordSize
return (Fixed archWordSize reg nilOL) | 190 | getRegister' _ (CmmReg (CmmGlobal PicBaseReg))
= do
reg <- getPicBaseNat archWordSize
return (Fixed archWordSize reg nilOL) | 137 | false | true | 0 | 12 | 38 | 70 | 31 | 39 | null | null |
a10nik/midiRhythm | src/MidiRhythm/Search.hs | bsd-3-clause | fixSizeRev :: [ElapsedTime] -> ElapsedTime -> [ElapsedTime]
fixSizeRev bars@(lastBar : restBars) lastT
| sum' bars < lastT = fixSizeRev (lastBar : bars) lastT
| sum' restBars > lastT = fixSizeRev restBars lastT
| otherwise = bars | 235 | fixSizeRev :: [ElapsedTime] -> ElapsedTime -> [ElapsedTime]
fixSizeRev bars@(lastBar : restBars) lastT
| sum' bars < lastT = fixSizeRev (lastBar : bars) lastT
| sum' restBars > lastT = fixSizeRev restBars lastT
| otherwise = bars | 235 | fixSizeRev bars@(lastBar : restBars) lastT
| sum' bars < lastT = fixSizeRev (lastBar : bars) lastT
| sum' restBars > lastT = fixSizeRev restBars lastT
| otherwise = bars | 175 | false | true | 0 | 9 | 41 | 109 | 50 | 59 | null | null |
uuhan/Idris-dev | src/Util/DynamicLinker.hs | bsd-3-clause | firstExisting (f:fs) = do exists <- doesFileExist f
if exists
then return (Just f)
else firstExisting fs | 186 | firstExisting (f:fs) = do exists <- doesFileExist f
if exists
then return (Just f)
else firstExisting fs | 186 | firstExisting (f:fs) = do exists <- doesFileExist f
if exists
then return (Just f)
else firstExisting fs | 186 | false | false | 0 | 10 | 98 | 50 | 23 | 27 | null | null |
epsilonhalbe/VocabuLambda | Test/Trainer.hs | bsd-3-clause | main :: IO ()
main = do runTestTT allTests
print "all HUnit tests passed"
mapM_ quickCheck allProps | 119 | main :: IO ()
main = do runTestTT allTests
print "all HUnit tests passed"
mapM_ quickCheck allProps | 119 | main = do runTestTT allTests
print "all HUnit tests passed"
mapM_ quickCheck allProps | 105 | false | true | 0 | 7 | 36 | 36 | 15 | 21 | null | null |
stevely/DumpTruck | src/Web/DumpTruck/EndPoint.hs | bsd-3-clause | -- | Given a function that takes a list of 'Header's and produces a 'Response',
-- produces an 'EndPoint' that feeds the current set of 'Header's to produce the
-- 'Response' for this request.
buildResponse :: Monad m => ([Header] -> Response) -> EndPoint s m a
buildResponse f = EndPoint (\_ hs _ -> return (Left (f (reverse hs)))) | 332 | buildResponse :: Monad m => ([Header] -> Response) -> EndPoint s m a
buildResponse f = EndPoint (\_ hs _ -> return (Left (f (reverse hs)))) | 139 | buildResponse f = EndPoint (\_ hs _ -> return (Left (f (reverse hs)))) | 70 | true | true | 0 | 14 | 59 | 85 | 43 | 42 | null | null |
23Skidoo/erp | Demo.hs | gpl-3.0 | -- Interpreter.
simpleApp :: AST
simpleApp = (app (lambda (var "x") (var "x")) (int 2)) | 87 | simpleApp :: AST
simpleApp = (app (lambda (var "x") (var "x")) (int 2)) | 71 | simpleApp = (app (lambda (var "x") (var "x")) (int 2)) | 54 | true | true | 0 | 10 | 14 | 46 | 24 | 22 | null | null |
shlevy/ghc | compiler/main/DriverPhases.hs | bsd-3-clause | phaseInputExt (As True) = "S" | 39 | phaseInputExt (As True) = "S" | 39 | phaseInputExt (As True) = "S" | 39 | false | false | 0 | 7 | 14 | 15 | 7 | 8 | null | null |
rodrigogribeiro/mptc | src/Language/Haskell/Exts/Syntax.hs | bsd-3-clause | export_name, safe_name, unsafe_name, threadsafe_name,
stdcall_name, ccall_name, cplusplus_name, dotnet_name,
jvm_name, js_name, forall_name, family_name :: Name
export_name = Ident "export" | 197 | export_name, safe_name, unsafe_name, threadsafe_name,
stdcall_name, ccall_name, cplusplus_name, dotnet_name,
jvm_name, js_name, forall_name, family_name :: Name
export_name = Ident "export" | 197 | export_name = Ident "export" | 32 | false | true | 0 | 5 | 25 | 36 | 29 | 7 | null | null |
jeannekamikaze/Nexus | Nexus/Nexus.hs | bsd-3-clause | -- | Handle the request.
handle :: Nexus -> ClientRequest -> (NexusReply, Nexus)
handle nexus (Login user) =
if L.notElem user $ users nexus
then (UserLoggedIn user, nexus { users = user : users nexus })
else (UserAlreadyExists, nexus) | 248 | handle :: Nexus -> ClientRequest -> (NexusReply, Nexus)
handle nexus (Login user) =
if L.notElem user $ users nexus
then (UserLoggedIn user, nexus { users = user : users nexus })
else (UserAlreadyExists, nexus) | 222 | handle nexus (Login user) =
if L.notElem user $ users nexus
then (UserLoggedIn user, nexus { users = user : users nexus })
else (UserAlreadyExists, nexus) | 166 | true | true | 0 | 10 | 51 | 87 | 47 | 40 | null | null |
urbanslug/ghc | testsuite/tests/deSugar/should_compile/ds046.hs | bsd-3-clause | m (F a b c) = a | 15 | m (F a b c) = a | 15 | m (F a b c) = a | 15 | false | false | 0 | 6 | 6 | 20 | 9 | 11 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/DOMParser.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/DOMParser.parseFromString Mozilla DOMParser.parseFromString documentation>
parseFromString ::
(MonadDOM m, ToJSString string, ToJSString contentType) =>
DOMParser -> string -> contentType -> m Document
parseFromString self string contentType
= liftDOM
((self ^. jsf "parseFromString"
[toJSVal string, toJSVal contentType])
>>= fromJSValUnchecked) | 463 | parseFromString ::
(MonadDOM m, ToJSString string, ToJSString contentType) =>
DOMParser -> string -> contentType -> m Document
parseFromString self string contentType
= liftDOM
((self ^. jsf "parseFromString"
[toJSVal string, toJSVal contentType])
>>= fromJSValUnchecked) | 332 | parseFromString self string contentType
= liftDOM
((self ^. jsf "parseFromString"
[toJSVal string, toJSVal contentType])
>>= fromJSValUnchecked) | 171 | true | true | 0 | 12 | 100 | 89 | 45 | 44 | null | null |
FranklinChen/hugs98-plus-Sep2006 | packages/parsec/examples/while/Main.hs | bsd-3-clause | main = prettyWhileFromFile "fib.wh" | 36 | main = prettyWhileFromFile "fib.wh" | 36 | main = prettyWhileFromFile "fib.wh" | 36 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
hansonkd/StrappedTemplates | src/Text/Strapped/Parser.hs | bsd-3-clause | -- | Parse content between `tagStart` and `tagEnd`
tag :: ParserM a -> ParserM a
tag p = between (tagStart >> spaces) (spaces >> tagEnd) p <?> "Tag" | 148 | tag :: ParserM a -> ParserM a
tag p = between (tagStart >> spaces) (spaces >> tagEnd) p <?> "Tag" | 97 | tag p = between (tagStart >> spaces) (spaces >> tagEnd) p <?> "Tag" | 67 | true | true | 0 | 8 | 27 | 50 | 25 | 25 | null | null |
spechub/Hets | Temporal/Mu.hs | gpl-2.0 | nnfS (E phi ) = E (nnfP phi) | 28 | nnfS (E phi ) = E (nnfP phi) | 28 | nnfS (E phi ) = E (nnfP phi) | 28 | false | false | 0 | 6 | 7 | 25 | 11 | 14 | null | null |
sheyll/b9-vm-image-builder | src/lib/B9/B9Error.hs | mit | -- | 'SomeException' wrapped into 'Exc'ecption 'Eff'ects
--
-- @since 0.5.64
throwSomeException :: (Member ExcB9 e, Exception x) => x -> Eff e a
throwSomeException = throwError . toException | 190 | throwSomeException :: (Member ExcB9 e, Exception x) => x -> Eff e a
throwSomeException = throwError . toException | 113 | throwSomeException = throwError . toException | 45 | true | true | 0 | 8 | 28 | 50 | 25 | 25 | null | null |
phischu/fragnix | tests/packages/scotty/Control.Applicative.Lift.hs | bsd-3-clause | -- | Eliminator for 'Lift'.
--
-- * @'elimLift' f g . 'pure' = f@
--
-- * @'elimLift' f g . 'Other' = g@
--
elimLift :: (a -> r) -> (f a -> r) -> Lift f a -> r
elimLift f _ (Pure x) = f x | 187 | elimLift :: (a -> r) -> (f a -> r) -> Lift f a -> r
elimLift f _ (Pure x) = f x | 79 | elimLift f _ (Pure x) = f x | 27 | true | true | 0 | 9 | 49 | 67 | 36 | 31 | null | null |
CalumMcCall/hokey | src/Hokey/Hand.hs | gpl-3.0 | hasTwoPair _ = [] | 17 | hasTwoPair _ = [] | 17 | hasTwoPair _ = [] | 17 | false | false | 0 | 5 | 3 | 11 | 5 | 6 | null | null |
aconbere/redis | Redis/Base.hs | mit | getReplyType :: Handle -> Char -> IO (Maybe RedisValue)
getReplyType h prefix =
case prefix of
'$' -> bulkReply h
':' -> integerReply h
'+' -> singleLineReply h
'-' -> singleLineReply h
'*' -> multiBulkReply h
_ -> singleLineReply h | 284 | getReplyType :: Handle -> Char -> IO (Maybe RedisValue)
getReplyType h prefix =
case prefix of
'$' -> bulkReply h
':' -> integerReply h
'+' -> singleLineReply h
'-' -> singleLineReply h
'*' -> multiBulkReply h
_ -> singleLineReply h | 284 | getReplyType h prefix =
case prefix of
'$' -> bulkReply h
':' -> integerReply h
'+' -> singleLineReply h
'-' -> singleLineReply h
'*' -> multiBulkReply h
_ -> singleLineReply h | 228 | false | true | 0 | 9 | 91 | 91 | 42 | 49 | null | null |
flipstone/orville | orville-postgresql-libpq/test/Test/FieldDefinition.hs | mit | doubleField :: Pool.Pool Connection.Connection -> [(HH.PropertyName, HH.Property)]
doubleField pool =
testFieldProperties pool "doubleField" $
FieldDefinitionTest
{ roundTripFieldDef = FieldDef.doubleField "foo"
, roundTripDefaultValueTests = [RoundTripDefaultTest DefaultValue.doubleDefault]
, roundTripGen = PgGen.pgDouble
} | 356 | doubleField :: Pool.Pool Connection.Connection -> [(HH.PropertyName, HH.Property)]
doubleField pool =
testFieldProperties pool "doubleField" $
FieldDefinitionTest
{ roundTripFieldDef = FieldDef.doubleField "foo"
, roundTripDefaultValueTests = [RoundTripDefaultTest DefaultValue.doubleDefault]
, roundTripGen = PgGen.pgDouble
} | 356 | doubleField pool =
testFieldProperties pool "doubleField" $
FieldDefinitionTest
{ roundTripFieldDef = FieldDef.doubleField "foo"
, roundTripDefaultValueTests = [RoundTripDefaultTest DefaultValue.doubleDefault]
, roundTripGen = PgGen.pgDouble
} | 273 | false | true | 0 | 10 | 59 | 82 | 44 | 38 | null | null |
Drezil/neat | Handler/Orders.hs | gpl-3.0 | getOrdersR :: Handler Html
getOrdersR = loginOrDo (\(uid,user) -> do
-- using raw because model does not know about CCP-Data-Dump
let sql = "select ??, t.\"typeName\", s.\"stationName\", s.\"regionID\" from \"order\" join \"invTypes\" t on (\"order\".type_id = t.\"typeID\") join \"staStations\" s on (\"order\".station_id = s.\"stationID\") where \"user\"=? order by \"order\".is_sell asc, t.\"typeName\" asc"
(orders :: [(Entity Order, Single Text, Single Text, Single Text)]) <- runDB $ rawSql sql [toPersistValue uid]
let f = \(a,_,_,_) -> a
let sellorders = filter (\(Entity _ o, _, _, _) -> orderIsSell o && orderOrderState o == (fromIntegral . fromEnum) MO.Open) orders
let sellsum = foldl' sumOrders 0 (f <$> sellorders)
let sellescrow = foldl' sumEscrow 0 (f <$> sellorders)
let buyorders = filter (\(Entity _ o, _, _, _) -> not (orderIsSell o) && orderOrderState o == (fromIntegral . fromEnum) MO.Open) orders
let buysum = foldl' sumOrders 0 (f <$> buyorders)
let buyescrow = foldl' sumEscrow 0 (f <$> buyorders)
loginLayout user [whamlet|
<div class="btn-group btn-group-justified">
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="checkOrders();">Check Over/Undercut
<div class="btn-group">
<button type="button" class="btn btn-primary">Feature x
<div class="btn-group">
<button type="button" class="btn btn-primary">Feature y
<div .panel .panel-default>
<div .panel-heading>Current Sell Orders:
<table .table .table-condensed .small .sellOrders>
<tr>
<th .text-center>Last changed
<th .text-center>Item
<th .text-center>Price
<th .text-center>Quantity (min)
<th .text-center>Value
<th .text-center>Range
<th .text-center>Duration
<th .text-center>Escrow
<th .text-center>Station
$forall (Entity _ o, Single name, Single stationname, Single regionid) <- sellorders
<tr .order data="#{orderTypeId o};#{regionid};#{orderPriceCents o}">
<td>#{showDateTime $ orderIssued $ o}
<td><a href="@{ItemR (orderTypeId o)}">#{name}</a>
<td .numeric .price>#{prettyISK $ orderPriceCents o}
<td .numeric>#{orderVolRemaining o}/#{orderVolEntered o} (#{orderMinVolume o})
<td .numeric>#{prettyISK $ orderVolRemaining o * orderPriceCents o}
<td .numeric>#{prettyRange $ orderRange o}
<td .numeric>#{orderDuration o}
<td .numeric>#{prettyISK $ orderEscrowCents o}
<td>#{stationname}
<tr .total>
<td>Total
<td>
<td>
<td>
<td .numeric>#{prettyISK $ sellsum}
<td>
<td>
<td .numeric>#{prettyISK $ sellescrow}
<td>
<div .panel .panel-default>
<div .panel-heading>Current Buy Orders:
<table .table .table-condensed .small .buyOrders>
<tr>
<th .text-center>Last changed
<th .text-center>Item
<th .text-center>Price
<th .text-center>Quantity (min)
<th .text-center>Value
<th .text-center>Range
<th .text-center>Duration
<th .text-center>Escrow
<th .text-center>Station
$forall (Entity _ o, Single name, Single stationname, Single regionid) <- buyorders
<tr .order data="#{orderTypeId o};#{regionid};#{orderPriceCents o}">
<td>#{showDateTime $ orderIssued $ o}
<td><a href="@{ItemR (orderTypeId o)}">#{name}</a>
<td .numeric .price>#{prettyISK $ orderPriceCents o}
<td .numeric>#{orderVolRemaining o}/#{orderVolEntered o} (#{orderMinVolume o})
<td .numeric>#{prettyISK $ orderPriceCents o * orderVolRemaining o}
<td .numeric>#{prettyRange $ orderRange o}
<td .numeric>#{orderDuration o}
<td .numeric>#{prettyISK $ orderEscrowCents o}
<td>#{stationname}
<tr .total>
<td>Total
<td>
<td>
<td>
<td .numeric>#{prettyISK $ buysum}
<td>
<td>
<td .numeric>#{prettyISK $ buyescrow}
<td>
|]
) | 5,237 | getOrdersR :: Handler Html
getOrdersR = loginOrDo (\(uid,user) -> do
-- using raw because model does not know about CCP-Data-Dump
let sql = "select ??, t.\"typeName\", s.\"stationName\", s.\"regionID\" from \"order\" join \"invTypes\" t on (\"order\".type_id = t.\"typeID\") join \"staStations\" s on (\"order\".station_id = s.\"stationID\") where \"user\"=? order by \"order\".is_sell asc, t.\"typeName\" asc"
(orders :: [(Entity Order, Single Text, Single Text, Single Text)]) <- runDB $ rawSql sql [toPersistValue uid]
let f = \(a,_,_,_) -> a
let sellorders = filter (\(Entity _ o, _, _, _) -> orderIsSell o && orderOrderState o == (fromIntegral . fromEnum) MO.Open) orders
let sellsum = foldl' sumOrders 0 (f <$> sellorders)
let sellescrow = foldl' sumEscrow 0 (f <$> sellorders)
let buyorders = filter (\(Entity _ o, _, _, _) -> not (orderIsSell o) && orderOrderState o == (fromIntegral . fromEnum) MO.Open) orders
let buysum = foldl' sumOrders 0 (f <$> buyorders)
let buyescrow = foldl' sumEscrow 0 (f <$> buyorders)
loginLayout user [whamlet|
<div class="btn-group btn-group-justified">
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="checkOrders();">Check Over/Undercut
<div class="btn-group">
<button type="button" class="btn btn-primary">Feature x
<div class="btn-group">
<button type="button" class="btn btn-primary">Feature y
<div .panel .panel-default>
<div .panel-heading>Current Sell Orders:
<table .table .table-condensed .small .sellOrders>
<tr>
<th .text-center>Last changed
<th .text-center>Item
<th .text-center>Price
<th .text-center>Quantity (min)
<th .text-center>Value
<th .text-center>Range
<th .text-center>Duration
<th .text-center>Escrow
<th .text-center>Station
$forall (Entity _ o, Single name, Single stationname, Single regionid) <- sellorders
<tr .order data="#{orderTypeId o};#{regionid};#{orderPriceCents o}">
<td>#{showDateTime $ orderIssued $ o}
<td><a href="@{ItemR (orderTypeId o)}">#{name}</a>
<td .numeric .price>#{prettyISK $ orderPriceCents o}
<td .numeric>#{orderVolRemaining o}/#{orderVolEntered o} (#{orderMinVolume o})
<td .numeric>#{prettyISK $ orderVolRemaining o * orderPriceCents o}
<td .numeric>#{prettyRange $ orderRange o}
<td .numeric>#{orderDuration o}
<td .numeric>#{prettyISK $ orderEscrowCents o}
<td>#{stationname}
<tr .total>
<td>Total
<td>
<td>
<td>
<td .numeric>#{prettyISK $ sellsum}
<td>
<td>
<td .numeric>#{prettyISK $ sellescrow}
<td>
<div .panel .panel-default>
<div .panel-heading>Current Buy Orders:
<table .table .table-condensed .small .buyOrders>
<tr>
<th .text-center>Last changed
<th .text-center>Item
<th .text-center>Price
<th .text-center>Quantity (min)
<th .text-center>Value
<th .text-center>Range
<th .text-center>Duration
<th .text-center>Escrow
<th .text-center>Station
$forall (Entity _ o, Single name, Single stationname, Single regionid) <- buyorders
<tr .order data="#{orderTypeId o};#{regionid};#{orderPriceCents o}">
<td>#{showDateTime $ orderIssued $ o}
<td><a href="@{ItemR (orderTypeId o)}">#{name}</a>
<td .numeric .price>#{prettyISK $ orderPriceCents o}
<td .numeric>#{orderVolRemaining o}/#{orderVolEntered o} (#{orderMinVolume o})
<td .numeric>#{prettyISK $ orderPriceCents o * orderVolRemaining o}
<td .numeric>#{prettyRange $ orderRange o}
<td .numeric>#{orderDuration o}
<td .numeric>#{prettyISK $ orderEscrowCents o}
<td>#{stationname}
<tr .total>
<td>Total
<td>
<td>
<td>
<td .numeric>#{prettyISK $ buysum}
<td>
<td>
<td .numeric>#{prettyISK $ buyescrow}
<td>
|]
) | 5,237 | getOrdersR = loginOrDo (\(uid,user) -> do
-- using raw because model does not know about CCP-Data-Dump
let sql = "select ??, t.\"typeName\", s.\"stationName\", s.\"regionID\" from \"order\" join \"invTypes\" t on (\"order\".type_id = t.\"typeID\") join \"staStations\" s on (\"order\".station_id = s.\"stationID\") where \"user\"=? order by \"order\".is_sell asc, t.\"typeName\" asc"
(orders :: [(Entity Order, Single Text, Single Text, Single Text)]) <- runDB $ rawSql sql [toPersistValue uid]
let f = \(a,_,_,_) -> a
let sellorders = filter (\(Entity _ o, _, _, _) -> orderIsSell o && orderOrderState o == (fromIntegral . fromEnum) MO.Open) orders
let sellsum = foldl' sumOrders 0 (f <$> sellorders)
let sellescrow = foldl' sumEscrow 0 (f <$> sellorders)
let buyorders = filter (\(Entity _ o, _, _, _) -> not (orderIsSell o) && orderOrderState o == (fromIntegral . fromEnum) MO.Open) orders
let buysum = foldl' sumOrders 0 (f <$> buyorders)
let buyescrow = foldl' sumEscrow 0 (f <$> buyorders)
loginLayout user [whamlet|
<div class="btn-group btn-group-justified">
<div class="btn-group">
<button type="button" class="btn btn-primary" onclick="checkOrders();">Check Over/Undercut
<div class="btn-group">
<button type="button" class="btn btn-primary">Feature x
<div class="btn-group">
<button type="button" class="btn btn-primary">Feature y
<div .panel .panel-default>
<div .panel-heading>Current Sell Orders:
<table .table .table-condensed .small .sellOrders>
<tr>
<th .text-center>Last changed
<th .text-center>Item
<th .text-center>Price
<th .text-center>Quantity (min)
<th .text-center>Value
<th .text-center>Range
<th .text-center>Duration
<th .text-center>Escrow
<th .text-center>Station
$forall (Entity _ o, Single name, Single stationname, Single regionid) <- sellorders
<tr .order data="#{orderTypeId o};#{regionid};#{orderPriceCents o}">
<td>#{showDateTime $ orderIssued $ o}
<td><a href="@{ItemR (orderTypeId o)}">#{name}</a>
<td .numeric .price>#{prettyISK $ orderPriceCents o}
<td .numeric>#{orderVolRemaining o}/#{orderVolEntered o} (#{orderMinVolume o})
<td .numeric>#{prettyISK $ orderVolRemaining o * orderPriceCents o}
<td .numeric>#{prettyRange $ orderRange o}
<td .numeric>#{orderDuration o}
<td .numeric>#{prettyISK $ orderEscrowCents o}
<td>#{stationname}
<tr .total>
<td>Total
<td>
<td>
<td>
<td .numeric>#{prettyISK $ sellsum}
<td>
<td>
<td .numeric>#{prettyISK $ sellescrow}
<td>
<div .panel .panel-default>
<div .panel-heading>Current Buy Orders:
<table .table .table-condensed .small .buyOrders>
<tr>
<th .text-center>Last changed
<th .text-center>Item
<th .text-center>Price
<th .text-center>Quantity (min)
<th .text-center>Value
<th .text-center>Range
<th .text-center>Duration
<th .text-center>Escrow
<th .text-center>Station
$forall (Entity _ o, Single name, Single stationname, Single regionid) <- buyorders
<tr .order data="#{orderTypeId o};#{regionid};#{orderPriceCents o}">
<td>#{showDateTime $ orderIssued $ o}
<td><a href="@{ItemR (orderTypeId o)}">#{name}</a>
<td .numeric .price>#{prettyISK $ orderPriceCents o}
<td .numeric>#{orderVolRemaining o}/#{orderVolEntered o} (#{orderMinVolume o})
<td .numeric>#{prettyISK $ orderPriceCents o * orderVolRemaining o}
<td .numeric>#{prettyRange $ orderRange o}
<td .numeric>#{orderDuration o}
<td .numeric>#{prettyISK $ orderEscrowCents o}
<td>#{stationname}
<tr .total>
<td>Total
<td>
<td>
<td>
<td .numeric>#{prettyISK $ buysum}
<td>
<td>
<td .numeric>#{prettyISK $ buyescrow}
<td>
|]
) | 5,210 | false | true | 0 | 20 | 2,146 | 363 | 185 | 178 | null | null |
olsner/m3 | Types/Conv.hs | bsd-3-clause | integralPromo = Search $ traceFun "integralPromo" $ \t -> case t of
TChar -> [(TInt,cast),(t,retype)]
TBool -> [(TInt,boolToInt),(t,retype)]
_ -> [] | 154 | integralPromo = Search $ traceFun "integralPromo" $ \t -> case t of
TChar -> [(TInt,cast),(t,retype)]
TBool -> [(TInt,boolToInt),(t,retype)]
_ -> [] | 154 | integralPromo = Search $ traceFun "integralPromo" $ \t -> case t of
TChar -> [(TInt,cast),(t,retype)]
TBool -> [(TInt,boolToInt),(t,retype)]
_ -> [] | 154 | false | false | 3 | 11 | 26 | 87 | 47 | 40 | null | null |
tdidriksen/copatterns | src/findus/test/TypeCheckerTests.hs | mit | negativeDataWrongName :: Test
negativeDataWrongName = testCheckDef (DData "bat" natRec)
inEmpty
(toFailWith $ Err "") | 164 | negativeDataWrongName :: Test
negativeDataWrongName = testCheckDef (DData "bat" natRec)
inEmpty
(toFailWith $ Err "") | 164 | negativeDataWrongName = testCheckDef (DData "bat" natRec)
inEmpty
(toFailWith $ Err "") | 134 | false | true | 0 | 8 | 60 | 36 | 18 | 18 | null | null |
warreee/Algorithm-Implementations | A_Star_Search/Haskell/abhin4v/AStarSearch_test.hs | mit | prop_path_starts_with_start_square startSq goalSq =
head (knightsShortestPath startSq goalSq) == startSq | 106 | prop_path_starts_with_start_square startSq goalSq =
head (knightsShortestPath startSq goalSq) == startSq | 106 | prop_path_starts_with_start_square startSq goalSq =
head (knightsShortestPath startSq goalSq) == startSq | 106 | false | false | 0 | 8 | 11 | 26 | 12 | 14 | null | null |
jdublu10/toy_lang | src/Lang.hs | mit | step (Force e) = e | 18 | step (Force e) = e | 18 | step (Force e) = e | 18 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
luisgepeto/HaskellLearning | 08 Own Types/01_algebraic.hs | mit | -- create a function that moves a shape on x and y1
nudge :: Shape' -> Float -> Float -> Shape'
nudge (Circle' (Point x y) r) a b = Circle' (Point (x+a) (y+b)) r | 161 | nudge :: Shape' -> Float -> Float -> Shape'
nudge (Circle' (Point x y) r) a b = Circle' (Point (x+a) (y+b)) r | 109 | nudge (Circle' (Point x y) r) a b = Circle' (Point (x+a) (y+b)) r | 65 | true | true | 0 | 9 | 34 | 74 | 38 | 36 | null | null |
osa1/dolap-chat | src/Parser.hs | mit | leaveCmd :: Parser Cmd
leaveCmd = do
string "leave"
spaces
chan <- many1 anyChar
eof
return $ LeaveCmd chan | 127 | leaveCmd :: Parser Cmd
leaveCmd = do
string "leave"
spaces
chan <- many1 anyChar
eof
return $ LeaveCmd chan | 127 | leaveCmd = do
string "leave"
spaces
chan <- many1 anyChar
eof
return $ LeaveCmd chan | 104 | false | true | 0 | 8 | 38 | 46 | 19 | 27 | null | null |
janrain/snap | src/Snap/Extension/Heist/Impl.hs | bsd-3-clause | heistInitializer :: MonadSnap m => FilePath -> Initializer (HeistState m)
heistInitializer p = do
heistState <- liftIO $ do
(origTs,sts) <- bindStaticTag emptyTemplateState
loadTemplates p origTs >>= either error (\ts -> do
tsMVar <- newMVar ts
return $ HeistState p origTs tsMVar sts id)
mkInitializer heistState
------------------------------------------------------------------------------ | 442 | heistInitializer :: MonadSnap m => FilePath -> Initializer (HeistState m)
heistInitializer p = do
heistState <- liftIO $ do
(origTs,sts) <- bindStaticTag emptyTemplateState
loadTemplates p origTs >>= either error (\ts -> do
tsMVar <- newMVar ts
return $ HeistState p origTs tsMVar sts id)
mkInitializer heistState
------------------------------------------------------------------------------ | 442 | heistInitializer p = do
heistState <- liftIO $ do
(origTs,sts) <- bindStaticTag emptyTemplateState
loadTemplates p origTs >>= either error (\ts -> do
tsMVar <- newMVar ts
return $ HeistState p origTs tsMVar sts id)
mkInitializer heistState
------------------------------------------------------------------------------ | 368 | false | true | 0 | 18 | 96 | 121 | 56 | 65 | null | null |
mdsteele/fallback | src/Fallback/State/Item.hs | gpl-3.0 | weaponIconCoords IronSpear = (13, 3) | 36 | weaponIconCoords IronSpear = (13, 3) | 36 | weaponIconCoords IronSpear = (13, 3) | 36 | false | false | 1 | 5 | 4 | 18 | 8 | 10 | null | null |
tibbe/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | genericWordMul2Op _ _ = panic "genericWordMul2Op" | 49 | genericWordMul2Op _ _ = panic "genericWordMul2Op" | 49 | genericWordMul2Op _ _ = panic "genericWordMul2Op" | 49 | false | false | 0 | 5 | 5 | 14 | 6 | 8 | null | null |
afcastano/cafe-duty | src/App/TeamDetails/Types.hs | bsd-3-clause | newPerson :: String -> Person
newPerson personName = Person personName True 0 | 77 | newPerson :: String -> Person
newPerson personName = Person personName True 0 | 77 | newPerson personName = Person personName True 0 | 47 | false | true | 0 | 5 | 11 | 25 | 12 | 13 | null | null |
keithodulaigh/Hets | HasCASL/AsUtils.hs | gpl-2.0 | -- | get the kind of an analyzed type variable
toKind :: VarKind -> Kind
toKind vk = case vk of
VarKind k -> k
Downset t -> case t of
KindedType _ k _ | Set.size k == 1 -> Set.findMin k
_ -> error "toKind: Downset"
MissingKind -> error "toKind: Missing"
-- | try to reparse the pretty printed input as an identifier | 344 | toKind :: VarKind -> Kind
toKind vk = case vk of
VarKind k -> k
Downset t -> case t of
KindedType _ k _ | Set.size k == 1 -> Set.findMin k
_ -> error "toKind: Downset"
MissingKind -> error "toKind: Missing"
-- | try to reparse the pretty printed input as an identifier | 297 | toKind vk = case vk of
VarKind k -> k
Downset t -> case t of
KindedType _ k _ | Set.size k == 1 -> Set.findMin k
_ -> error "toKind: Downset"
MissingKind -> error "toKind: Missing"
-- | try to reparse the pretty printed input as an identifier | 271 | true | true | 0 | 16 | 93 | 102 | 46 | 56 | null | null |
sergv/tags-server | tests/Haskell/Language/Lexer/Tests.hs | bsd-3-clause | testTokenizeCpp :: TestTree
testTokenizeCpp = testGroup "Tokenize with preprocessor"
[ testCase "Stripping of #define" $
"#define FOO foo\n\
\bar :: a -> a\n\
\bar x = x"
==>
[ Newline 0
, Newline 0
, T "bar", DoubleColon, T "a", Arrow, T "a", Newline 0
, T "bar", T "x", Equals, T "x", Newline 0
]
, testCase "Stripping of multi-line #define #1" $
"#define \\\n\
\ FOO \\\n\
\ foo\n\
\bar :: a -> a\n\
\bar x = x"
==>
[ Newline 0
, Newline 0
, T "bar", DoubleColon, T "a", Arrow, T "a", Newline 0
, T "bar", T "x", Equals, T "x", Newline 0
]
, testCase "Stripping of multi-line #define #2" $
"#define FOO(T) \\\n\
\{- hello there -} ;\\\n\
\foo :: T -> T ;\\\n\
\foo x = x\n\
\bar :: a -> a\n\
\bar x = x"
==>
[ Newline 0
, Newline 0
, T "bar", DoubleColon, T "a", Arrow, T "a", Newline 0
, T "bar", T "x", Equals, T "x", Newline 0
]
, testCase "Regression in 'text-show' package" $
textShowSource
==>
[ Newline 0
, Newline 0
, Newline 0
, Newline 0
, T "bar", DoubleColon, T "a", Arrow, T "a", Newline 0
, T "bar", T "x", Equals, T "x", Newline 0
]
]
where
(==>) = makeAssertion f
f = map valOf . tokenize' filename Vanilla | 1,313 | testTokenizeCpp :: TestTree
testTokenizeCpp = testGroup "Tokenize with preprocessor"
[ testCase "Stripping of #define" $
"#define FOO foo\n\
\bar :: a -> a\n\
\bar x = x"
==>
[ Newline 0
, Newline 0
, T "bar", DoubleColon, T "a", Arrow, T "a", Newline 0
, T "bar", T "x", Equals, T "x", Newline 0
]
, testCase "Stripping of multi-line #define #1" $
"#define \\\n\
\ FOO \\\n\
\ foo\n\
\bar :: a -> a\n\
\bar x = x"
==>
[ Newline 0
, Newline 0
, T "bar", DoubleColon, T "a", Arrow, T "a", Newline 0
, T "bar", T "x", Equals, T "x", Newline 0
]
, testCase "Stripping of multi-line #define #2" $
"#define FOO(T) \\\n\
\{- hello there -} ;\\\n\
\foo :: T -> T ;\\\n\
\foo x = x\n\
\bar :: a -> a\n\
\bar x = x"
==>
[ Newline 0
, Newline 0
, T "bar", DoubleColon, T "a", Arrow, T "a", Newline 0
, T "bar", T "x", Equals, T "x", Newline 0
]
, testCase "Regression in 'text-show' package" $
textShowSource
==>
[ Newline 0
, Newline 0
, Newline 0
, Newline 0
, T "bar", DoubleColon, T "a", Arrow, T "a", Newline 0
, T "bar", T "x", Equals, T "x", Newline 0
]
]
where
(==>) = makeAssertion f
f = map valOf . tokenize' filename Vanilla | 1,313 | testTokenizeCpp = testGroup "Tokenize with preprocessor"
[ testCase "Stripping of #define" $
"#define FOO foo\n\
\bar :: a -> a\n\
\bar x = x"
==>
[ Newline 0
, Newline 0
, T "bar", DoubleColon, T "a", Arrow, T "a", Newline 0
, T "bar", T "x", Equals, T "x", Newline 0
]
, testCase "Stripping of multi-line #define #1" $
"#define \\\n\
\ FOO \\\n\
\ foo\n\
\bar :: a -> a\n\
\bar x = x"
==>
[ Newline 0
, Newline 0
, T "bar", DoubleColon, T "a", Arrow, T "a", Newline 0
, T "bar", T "x", Equals, T "x", Newline 0
]
, testCase "Stripping of multi-line #define #2" $
"#define FOO(T) \\\n\
\{- hello there -} ;\\\n\
\foo :: T -> T ;\\\n\
\foo x = x\n\
\bar :: a -> a\n\
\bar x = x"
==>
[ Newline 0
, Newline 0
, T "bar", DoubleColon, T "a", Arrow, T "a", Newline 0
, T "bar", T "x", Equals, T "x", Newline 0
]
, testCase "Regression in 'text-show' package" $
textShowSource
==>
[ Newline 0
, Newline 0
, Newline 0
, Newline 0
, T "bar", DoubleColon, T "a", Arrow, T "a", Newline 0
, T "bar", T "x", Equals, T "x", Newline 0
]
]
where
(==>) = makeAssertion f
f = map valOf . tokenize' filename Vanilla | 1,285 | false | true | 3 | 8 | 417 | 404 | 202 | 202 | null | null |
kawu/ltag | src/NLP/LTAG/Early4.hs | bsd-2-clause | -- | Show the symbol.
viewSym :: View n => Sym n -> String
viewSym (x, Just i) = "(" ++ view x ++ ", " ++ show i ++ ")" | 119 | viewSym :: View n => Sym n -> String
viewSym (x, Just i) = "(" ++ view x ++ ", " ++ show i ++ ")" | 97 | viewSym (x, Just i) = "(" ++ view x ++ ", " ++ show i ++ ")" | 60 | true | true | 0 | 9 | 30 | 64 | 30 | 34 | null | null |
taylor1791/adventofcode | 2015/src/Day8.hs | bsd-2-clause | charIncr :: Int -> String -> Int
charIncr n [] = n + 2 | 56 | charIncr :: Int -> String -> Int
charIncr n [] = n + 2 | 54 | charIncr n [] = n + 2 | 21 | false | true | 0 | 6 | 15 | 30 | 15 | 15 | null | null |
hbasold/Sandbox | OTTTests/DecideEquiv.hs | mit | subst a x (Prod b1 b2) = Prod (subst a x b1) (subst a x b2) | 59 | subst a x (Prod b1 b2) = Prod (subst a x b1) (subst a x b2) | 59 | subst a x (Prod b1 b2) = Prod (subst a x b1) (subst a x b2) | 59 | false | false | 0 | 7 | 15 | 50 | 22 | 28 | null | null |
romanb/amazonka | amazonka-ec2/gen/Network/AWS/EC2/Types.hs | mpl-2.0 | -- | The status of the Reserved Instance listing.
rilStatus :: Lens' ReservedInstancesListing (Maybe ListingStatus)
rilStatus = lens _rilStatus (\s a -> s { _rilStatus = a }) | 174 | rilStatus :: Lens' ReservedInstancesListing (Maybe ListingStatus)
rilStatus = lens _rilStatus (\s a -> s { _rilStatus = a }) | 124 | rilStatus = lens _rilStatus (\s a -> s { _rilStatus = a }) | 58 | true | true | 1 | 9 | 27 | 52 | 25 | 27 | null | null |
lancelet/bored-robot | src/CI/Proc.hs | apache-2.0 | isSuccess _ = False | 29 | isSuccess _ = False | 29 | isSuccess _ = False | 29 | false | false | 0 | 5 | 13 | 9 | 4 | 5 | null | null |
ddssff/process-listlike-old | Tests/Test5.hs | mit | main =
do (code, out, err) <- readCreateProcessWithExitCode id (RawCommand "Tests/Test4.hs" []) "abcde"
putStrLn ("code=" ++ show code ++ "\nout=" ++ show out ++ "\nerr=" ++ show err) | 194 | main =
do (code, out, err) <- readCreateProcessWithExitCode id (RawCommand "Tests/Test4.hs" []) "abcde"
putStrLn ("code=" ++ show code ++ "\nout=" ++ show out ++ "\nerr=" ++ show err) | 194 | main =
do (code, out, err) <- readCreateProcessWithExitCode id (RawCommand "Tests/Test4.hs" []) "abcde"
putStrLn ("code=" ++ show code ++ "\nout=" ++ show out ++ "\nerr=" ++ show err) | 194 | false | false | 0 | 14 | 38 | 77 | 37 | 40 | null | null |
brendanhay/gogol | gogol-analytics/gen/Network/Google/Analytics/Types/Product.hs | mpl-2.0 | -- | Web property name.
wpsName :: Lens' WebPropertySummary (Maybe Text)
wpsName = lens _wpsName (\ s a -> s{_wpsName = a}) | 123 | wpsName :: Lens' WebPropertySummary (Maybe Text)
wpsName = lens _wpsName (\ s a -> s{_wpsName = a}) | 99 | wpsName = lens _wpsName (\ s a -> s{_wpsName = a}) | 50 | true | true | 0 | 9 | 21 | 46 | 25 | 21 | null | null |
ChaosCabbage/my-haskell-flailing | src/CPU/Instructions.hs | bsd-3-clause | doCall :: Word16 -> CPU s Cycles
doCall a16 = do
readWord PC >>= pushOntoStack
jumpTo a16
return 24 | 111 | doCall :: Word16 -> CPU s Cycles
doCall a16 = do
readWord PC >>= pushOntoStack
jumpTo a16
return 24 | 111 | doCall a16 = do
readWord PC >>= pushOntoStack
jumpTo a16
return 24 | 78 | false | true | 0 | 8 | 30 | 45 | 19 | 26 | null | null |
mitchellwrosen/persistent | persistent/Database/Persist/Sql/Migration.hs | mit | safeSql :: CautiousMigration -> [Sql]
safeSql = allSql . filter (not . fst) | 75 | safeSql :: CautiousMigration -> [Sql]
safeSql = allSql . filter (not . fst) | 75 | safeSql = allSql . filter (not . fst) | 37 | false | true | 0 | 8 | 12 | 32 | 17 | 15 | null | null |
conal/hermit-extras | src/HERMIT/Extras.hs | bsd-3-clause | listT :: Monad m => [Transform c m a b] -> Transform c m [a] [b]
listT rs =
do es <- id
guardMsg (length rs == length es) "listT: length mismatch"
sequence (zipWith ($*) rs es) | 188 | listT :: Monad m => [Transform c m a b] -> Transform c m [a] [b]
listT rs =
do es <- id
guardMsg (length rs == length es) "listT: length mismatch"
sequence (zipWith ($*) rs es) | 188 | listT rs =
do es <- id
guardMsg (length rs == length es) "listT: length mismatch"
sequence (zipWith ($*) rs es) | 123 | false | true | 0 | 11 | 48 | 103 | 48 | 55 | null | null |
CulpaBS/wbBach | src/Futhark/Representation/AST/Attributes/Types.hs | bsd-3-clause | hasStaticShape (Mem size space) =
Just $ Mem size space | 57 | hasStaticShape (Mem size space) =
Just $ Mem size space | 57 | hasStaticShape (Mem size space) =
Just $ Mem size space | 57 | false | false | 2 | 6 | 11 | 30 | 12 | 18 | null | null |
sdiehl/ghc | testsuite/tests/callarity/unittest/CallArity1.hs | bsd-3-clause | mkTestId :: Int -> String -> Type -> Id
mkTestId i s ty = mkSysLocal (mkFastString s) (mkBuiltinUnique i) ty | 108 | mkTestId :: Int -> String -> Type -> Id
mkTestId i s ty = mkSysLocal (mkFastString s) (mkBuiltinUnique i) ty | 108 | mkTestId i s ty = mkSysLocal (mkFastString s) (mkBuiltinUnique i) ty | 68 | false | true | 0 | 7 | 19 | 54 | 25 | 29 | null | null |
Tomoaki-Hashizaki/pesca | src/Axioms.hs | gpl-2.0 | findInstanceOfAtoms :: [Atom] -> [Formula] -> Maybe [(Ident,Term)]
findInstanceOfAtoms atoms formulae =
case (atoms,formulae) of
([],_) -> Just []
(_, []) -> Nothing
(_, f:fs) -> findOne [f:fs' | fs' <- subsets (length atoms - 1) fs]
where
findOne [] = Nothing
findOne (s:ss) = case instanceOfAtoms atoms s of
Just i -> Just i
_ -> findOne ss | 417 | findInstanceOfAtoms :: [Atom] -> [Formula] -> Maybe [(Ident,Term)]
findInstanceOfAtoms atoms formulae =
case (atoms,formulae) of
([],_) -> Just []
(_, []) -> Nothing
(_, f:fs) -> findOne [f:fs' | fs' <- subsets (length atoms - 1) fs]
where
findOne [] = Nothing
findOne (s:ss) = case instanceOfAtoms atoms s of
Just i -> Just i
_ -> findOne ss | 417 | findInstanceOfAtoms atoms formulae =
case (atoms,formulae) of
([],_) -> Just []
(_, []) -> Nothing
(_, f:fs) -> findOne [f:fs' | fs' <- subsets (length atoms - 1) fs]
where
findOne [] = Nothing
findOne (s:ss) = case instanceOfAtoms atoms s of
Just i -> Just i
_ -> findOne ss | 350 | false | true | 1 | 15 | 133 | 200 | 100 | 100 | null | null |
kmate/HaRe | old/testing/simplifyExpr/ListToMaybeIn2AST.hs | bsd-3-clause | f x = listToMaybe x | 19 | f x = listToMaybe x | 19 | f x = listToMaybe x | 19 | false | false | 1 | 5 | 4 | 16 | 5 | 11 | null | null |
bakineggs/k-framework | tools/OutputFilter/InfixOperators.hs | gpl-2.0 | parseNonOpParens :: ContentParser Content
parseNonOpParens = do openParen
innards <- parseContentsTop
endParen
return . ParenedContent $ innards | 218 | parseNonOpParens :: ContentParser Content
parseNonOpParens = do openParen
innards <- parseContentsTop
endParen
return . ParenedContent $ innards | 216 | parseNonOpParens = do openParen
innards <- parseContentsTop
endParen
return . ParenedContent $ innards | 174 | false | true | 1 | 8 | 90 | 42 | 17 | 25 | null | null |
trskop/cabal | Cabal/Distribution/Simple/Program/Db.hs | bsd-3-clause | -- | Update a configured program in the database.
updateProgram :: ConfiguredProgram -> ProgramDb
-> ProgramDb
updateProgram prog = updateConfiguredProgs $
Map.insert (programId prog) prog | 225 | updateProgram :: ConfiguredProgram -> ProgramDb
-> ProgramDb
updateProgram prog = updateConfiguredProgs $
Map.insert (programId prog) prog | 175 | updateProgram prog = updateConfiguredProgs $
Map.insert (programId prog) prog | 79 | true | true | 0 | 8 | 61 | 47 | 21 | 26 | null | null |
leshchevds/ganeti | test/hs/Test/Ganeti/Hypervisor/Xen/XmParser.hs | bsd-2-clause | canBeNumber [c] = canBeNumberChar c | 35 | canBeNumber [c] = canBeNumberChar c | 35 | canBeNumber [c] = canBeNumberChar c | 35 | false | false | 0 | 5 | 4 | 16 | 7 | 9 | null | null |
martin-kolinek/some-board-game-rules | src/Universe/Actions.hs | mit | actionPrecondition _ _ _ _ _ = True | 35 | actionPrecondition _ _ _ _ _ = True | 35 | actionPrecondition _ _ _ _ _ = True | 35 | false | false | 1 | 5 | 7 | 16 | 7 | 9 | null | null |
Fuuzetsu/yi-emacs-colours | src/Yi/Style/EmacsColours.hs | gpl-2.0 | -- | Names: @["gray68"]@
--
-- R173 G173 B173, 0xadadad
gray68 :: Color
gray68 = RGB 173 173 173 | 96 | gray68 :: Color
gray68 = RGB 173 173 173 | 40 | gray68 = RGB 173 173 173 | 24 | true | true | 0 | 6 | 18 | 27 | 13 | 14 | null | null |
dat2/haskell-scheme | src/Eval.hs | mit | makestring :: [LispVal] -> Throws LispVal
makestring [Number n, Character c] = return $ String $ replicate (fromIntegral n) c | 125 | makestring :: [LispVal] -> Throws LispVal
makestring [Number n, Character c] = return $ String $ replicate (fromIntegral n) c | 125 | makestring [Number n, Character c] = return $ String $ replicate (fromIntegral n) c | 83 | false | true | 0 | 8 | 19 | 55 | 27 | 28 | null | null |
bitc/instantrun | src/Config.hs | mit | defaultSocketFilename, defaultConfigFilename :: FilePath
defaultSocketFilename = "instantrun.sock" | 98 | defaultSocketFilename, defaultConfigFilename :: FilePath
defaultSocketFilename = "instantrun.sock" | 98 | defaultSocketFilename = "instantrun.sock" | 41 | false | true | 0 | 4 | 6 | 13 | 8 | 5 | null | null |
rodrigogribeiro/mptc | test/Data/TestCase1TcExp.hs | bsd-3-clause | qnamename = UnQual (Ident "name") | 33 | qnamename = UnQual (Ident "name") | 33 | qnamename = UnQual (Ident "name") | 33 | false | false | 0 | 7 | 4 | 15 | 7 | 8 | null | null |
gridaphobe/liquid-fixpoint | src/Language/Fixpoint/Types/Names.hs | bsd-3-clause | symbolSafeString :: Symbol -> String
symbolSafeString = T.unpack . symbolSafeText | 81 | symbolSafeString :: Symbol -> String
symbolSafeString = T.unpack . symbolSafeText | 81 | symbolSafeString = T.unpack . symbolSafeText | 44 | false | true | 0 | 6 | 9 | 21 | 11 | 10 | null | null |
TOSPIO/yi | src/library/Yi/Buffer/HighLevel.hs | gpl-2.0 | nextNParagraphs :: Int -> BufferM ()
nextNParagraphs n = replicateM_ n $ moveB unitEmacsParagraph Forward | 105 | nextNParagraphs :: Int -> BufferM ()
nextNParagraphs n = replicateM_ n $ moveB unitEmacsParagraph Forward | 105 | nextNParagraphs n = replicateM_ n $ moveB unitEmacsParagraph Forward | 68 | false | true | 0 | 7 | 14 | 35 | 16 | 19 | null | null |
ian-ross/c2hs-macos-test | c2hs-0.26.1/src/C2HS/Gen/Bind.hs | mit | alignment (CUFieldPT bs) = fieldAlignment bs | 45 | alignment (CUFieldPT bs) = fieldAlignment bs | 45 | alignment (CUFieldPT bs) = fieldAlignment bs | 45 | false | false | 0 | 7 | 6 | 18 | 8 | 10 | null | null |
martialboniou/Dots | X/xmonad.symlink/xmonad.hs | mit | -- Hook
--
marsCommonSystemHook :: XConfig a -> XConfig a
marsCommonSystemHook c = c
{ borderWidth = wThickness mars
, modMask = controlKey mars
, workspaces = spaceList mars
, startupHook = startupHook c +++ setWMName "LG3D"
, handleEventHook = handleEventHook c
}
where
x +++ y = mappend x y
-- Mains
-- | 414 | marsCommonSystemHook :: XConfig a -> XConfig a
marsCommonSystemHook c = c
{ borderWidth = wThickness mars
, modMask = controlKey mars
, workspaces = spaceList mars
, startupHook = startupHook c +++ setWMName "LG3D"
, handleEventHook = handleEventHook c
}
where
x +++ y = mappend x y
-- Mains
-- | 403 | marsCommonSystemHook c = c
{ borderWidth = wThickness mars
, modMask = controlKey mars
, workspaces = spaceList mars
, startupHook = startupHook c +++ setWMName "LG3D"
, handleEventHook = handleEventHook c
}
where
x +++ y = mappend x y
-- Mains
-- | 356 | true | true | 3 | 8 | 162 | 112 | 54 | 58 | null | null |
adscib/monad-bayes | models/LDA.hs | mit | word_index :: Map.Map String Int
word_index = Map.fromList $ zip vocabluary [0..] | 81 | word_index :: Map.Map String Int
word_index = Map.fromList $ zip vocabluary [0..] | 81 | word_index = Map.fromList $ zip vocabluary [0..] | 48 | false | true | 0 | 7 | 11 | 32 | 16 | 16 | null | null |
penguinland/nlp | Analysis.hs | gpl-3.0 | isWellFormed :: (Analyzable a) => [a] -> Bool
isWellFormed = (isSingleSentence `andAlso` (not . isAmbiguous)) . toNodes | 119 | isWellFormed :: (Analyzable a) => [a] -> Bool
isWellFormed = (isSingleSentence `andAlso` (not . isAmbiguous)) . toNodes | 119 | isWellFormed = (isSingleSentence `andAlso` (not . isAmbiguous)) . toNodes | 73 | false | true | 0 | 9 | 16 | 54 | 28 | 26 | null | null |
GRACeFUL-project/haskelzinc | src/Interfaces/MZBuiltIns.hs | bsd-3-clause | mz_smallest = Annotation "smallest" | 43 | mz_smallest = Annotation "smallest" | 43 | mz_smallest = Annotation "smallest" | 43 | false | false | 0 | 5 | 11 | 9 | 4 | 5 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.