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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rahulmutt/ghcvm
|
compiler/Eta/CodeGen/Rts.hs
|
bsd-3-clause
|
stgArrayType = obj stgArray
| 32
|
stgArrayType = obj stgArray
| 32
|
stgArrayType = obj stgArray
| 32
| false
| false
| 0
| 5
| 8
| 9
| 4
| 5
| null | null |
pandaychen/PFQ
|
Development/SimpleBuilder.hs
|
gpl-2.0
|
make_install = tellCmd $ StaticCmd "make install"
| 52
|
make_install = tellCmd $ StaticCmd "make install"
| 52
|
make_install = tellCmd $ StaticCmd "make install"
| 52
| false
| false
| 1
| 6
| 9
| 16
| 6
| 10
| null | null |
TransformingMusicology/tabcode-haskell
|
src/TabCode/Parser.hs
|
gpl-3.0
|
comment :: GenParser Char st Comment
comment = do
manyTill (char ' ') (try $ char '{')
notFollowedBy $ (try $ string "^}") <|> (try $ string ">}{^}")
c <- manyTill anyChar (try $ char '}')
return $ Comment c
| 215
|
comment :: GenParser Char st Comment
comment = do
manyTill (char ' ') (try $ char '{')
notFollowedBy $ (try $ string "^}") <|> (try $ string ">}{^}")
c <- manyTill anyChar (try $ char '}')
return $ Comment c
| 215
|
comment = do
manyTill (char ' ') (try $ char '{')
notFollowedBy $ (try $ string "^}") <|> (try $ string ">}{^}")
c <- manyTill anyChar (try $ char '}')
return $ Comment c
| 178
| false
| true
| 0
| 12
| 47
| 111
| 50
| 61
| null | null |
Shimuuar/math-functions
|
Numeric/SpecFunctions/Extra.hs
|
bsd-2-clause
|
-- | Evaluate the deviance term @x log(x/np) + np - x@.
bd0 :: Double -- ^ @x@
-> Double -- ^ @np@
-> Double
bd0 x np
| isInfinite x || isInfinite np || np == 0 = m_NaN
| abs x_np >= 0.1*(x+np) = x * log (x/np) - x_np
| otherwise = loop 1 (ej0*vv) s0
where
x_np = x - np
v = x_np / (x+np)
s0 = x_np * v
ej0 = 2*x*v
vv = v*v
loop j ej s = case s + ej/(2*j+1) of
s' | s' == s -> s' -- FIXME: Comparing Doubles for equality!
| otherwise -> loop (j+1) (ej*vv) s'
-- | Compute the logarithm of the gamma function Γ(/x/). Uses
-- Algorithm AS 245 by Macleod.
--
-- Gives an accuracy of 10-12 significant decimal digits, except
-- for small regions around /x/ = 1 and /x/ = 2, where the function
-- goes to zero. For greater accuracy, use 'logGammaL'.
--
-- Returns ∞ if the input is outside of the range (0 < /x/ ≤ 1e305).
| 1,003
|
bd0 :: Double -- ^ @x@
-> Double -- ^ @np@
-> Double
bd0 x np
| isInfinite x || isInfinite np || np == 0 = m_NaN
| abs x_np >= 0.1*(x+np) = x * log (x/np) - x_np
| otherwise = loop 1 (ej0*vv) s0
where
x_np = x - np
v = x_np / (x+np)
s0 = x_np * v
ej0 = 2*x*v
vv = v*v
loop j ej s = case s + ej/(2*j+1) of
s' | s' == s -> s' -- FIXME: Comparing Doubles for equality!
| otherwise -> loop (j+1) (ej*vv) s'
-- | Compute the logarithm of the gamma function Γ(/x/). Uses
-- Algorithm AS 245 by Macleod.
--
-- Gives an accuracy of 10-12 significant decimal digits, except
-- for small regions around /x/ = 1 and /x/ = 2, where the function
-- goes to zero. For greater accuracy, use 'logGammaL'.
--
-- Returns ∞ if the input is outside of the range (0 < /x/ ≤ 1e305).
| 946
|
bd0 x np
| isInfinite x || isInfinite np || np == 0 = m_NaN
| abs x_np >= 0.1*(x+np) = x * log (x/np) - x_np
| otherwise = loop 1 (ej0*vv) s0
where
x_np = x - np
v = x_np / (x+np)
s0 = x_np * v
ej0 = 2*x*v
vv = v*v
loop j ej s = case s + ej/(2*j+1) of
s' | s' == s -> s' -- FIXME: Comparing Doubles for equality!
| otherwise -> loop (j+1) (ej*vv) s'
-- | Compute the logarithm of the gamma function Γ(/x/). Uses
-- Algorithm AS 245 by Macleod.
--
-- Gives an accuracy of 10-12 significant decimal digits, except
-- for small regions around /x/ = 1 and /x/ = 2, where the function
-- goes to zero. For greater accuracy, use 'logGammaL'.
--
-- Returns ∞ if the input is outside of the range (0 < /x/ ≤ 1e305).
| 849
| true
| true
| 8
| 11
| 366
| 294
| 141
| 153
| null | null |
green-haskell/ghc
|
compiler/typecheck/TcGenDeriv.hs
|
bsd-3-clause
|
{-
************************************************************************
* *
Enum instances
* *
************************************************************************
@Enum@ can only be derived for enumeration types. For a type
\begin{verbatim}
data Foo ... = N1 | N2 | ... | Nn
\end{verbatim}
we use both @con2tag_Foo@ and @tag2con_Foo@ functions, as well as a
@maxtag_Foo@ variable (all generated by @gen_tag_n_con_binds@).
\begin{verbatim}
instance ... Enum (Foo ...) where
succ x = toEnum (1 + fromEnum x)
pred x = toEnum (fromEnum x - 1)
toEnum i = tag2con_Foo i
enumFrom a = map tag2con_Foo [con2tag_Foo a .. maxtag_Foo]
-- or, really...
enumFrom a
= case con2tag_Foo a of
a# -> map tag2con_Foo (enumFromTo (I# a#) maxtag_Foo)
enumFromThen a b
= map tag2con_Foo [con2tag_Foo a, con2tag_Foo b .. maxtag_Foo]
-- or, really...
enumFromThen a b
= case con2tag_Foo a of { a# ->
case con2tag_Foo b of { b# ->
map tag2con_Foo (enumFromThenTo (I# a#) (I# b#) maxtag_Foo)
}}
\end{verbatim}
For @enumFromTo@ and @enumFromThenTo@, we use the default methods.
-}
gen_Enum_binds :: SrcSpan -> TyCon -> (LHsBinds RdrName, BagDerivStuff)
gen_Enum_binds loc tycon
= (method_binds, aux_binds)
where
method_binds = listToBag [
succ_enum,
pred_enum,
to_enum,
enum_from,
enum_from_then,
from_enum
]
aux_binds = listToBag $ map DerivAuxBind
[DerivCon2Tag tycon, DerivTag2Con tycon, DerivMaxTag tycon]
occ_nm = getOccString tycon
succ_enum
= mk_easy_FunBind loc succ_RDR [a_Pat] $
untag_Expr tycon [(a_RDR, ah_RDR)] $
nlHsIf (nlHsApps eq_RDR [nlHsVar (maxtag_RDR tycon),
nlHsVarApps intDataCon_RDR [ah_RDR]])
(illegal_Expr "succ" occ_nm "tried to take `succ' of last tag in enumeration")
(nlHsApp (nlHsVar (tag2con_RDR tycon))
(nlHsApps plus_RDR [nlHsVarApps intDataCon_RDR [ah_RDR],
nlHsIntLit 1]))
pred_enum
= mk_easy_FunBind loc pred_RDR [a_Pat] $
untag_Expr tycon [(a_RDR, ah_RDR)] $
nlHsIf (nlHsApps eq_RDR [nlHsIntLit 0,
nlHsVarApps intDataCon_RDR [ah_RDR]])
(illegal_Expr "pred" occ_nm "tried to take `pred' of first tag in enumeration")
(nlHsApp (nlHsVar (tag2con_RDR tycon))
(nlHsApps plus_RDR [nlHsVarApps intDataCon_RDR [ah_RDR],
nlHsLit (HsInt "-1" (-1))]))
to_enum
= mk_easy_FunBind loc toEnum_RDR [a_Pat] $
nlHsIf (nlHsApps and_RDR
[nlHsApps ge_RDR [nlHsVar a_RDR, nlHsIntLit 0],
nlHsApps le_RDR [nlHsVar a_RDR, nlHsVar (maxtag_RDR tycon)]])
(nlHsVarApps (tag2con_RDR tycon) [a_RDR])
(illegal_toEnum_tag occ_nm (maxtag_RDR tycon))
enum_from
= mk_easy_FunBind loc enumFrom_RDR [a_Pat] $
untag_Expr tycon [(a_RDR, ah_RDR)] $
nlHsApps map_RDR
[nlHsVar (tag2con_RDR tycon),
nlHsPar (enum_from_to_Expr
(nlHsVarApps intDataCon_RDR [ah_RDR])
(nlHsVar (maxtag_RDR tycon)))]
enum_from_then
= mk_easy_FunBind loc enumFromThen_RDR [a_Pat, b_Pat] $
untag_Expr tycon [(a_RDR, ah_RDR), (b_RDR, bh_RDR)] $
nlHsApp (nlHsVarApps map_RDR [tag2con_RDR tycon]) $
nlHsPar (enum_from_then_to_Expr
(nlHsVarApps intDataCon_RDR [ah_RDR])
(nlHsVarApps intDataCon_RDR [bh_RDR])
(nlHsIf (nlHsApps gt_RDR [nlHsVarApps intDataCon_RDR [ah_RDR],
nlHsVarApps intDataCon_RDR [bh_RDR]])
(nlHsIntLit 0)
(nlHsVar (maxtag_RDR tycon))
))
from_enum
= mk_easy_FunBind loc fromEnum_RDR [a_Pat] $
untag_Expr tycon [(a_RDR, ah_RDR)] $
(nlHsVarApps intDataCon_RDR [ah_RDR])
{-
************************************************************************
* *
Bounded instances
* *
************************************************************************
-}
| 4,765
|
gen_Enum_binds :: SrcSpan -> TyCon -> (LHsBinds RdrName, BagDerivStuff)
gen_Enum_binds loc tycon
= (method_binds, aux_binds)
where
method_binds = listToBag [
succ_enum,
pred_enum,
to_enum,
enum_from,
enum_from_then,
from_enum
]
aux_binds = listToBag $ map DerivAuxBind
[DerivCon2Tag tycon, DerivTag2Con tycon, DerivMaxTag tycon]
occ_nm = getOccString tycon
succ_enum
= mk_easy_FunBind loc succ_RDR [a_Pat] $
untag_Expr tycon [(a_RDR, ah_RDR)] $
nlHsIf (nlHsApps eq_RDR [nlHsVar (maxtag_RDR tycon),
nlHsVarApps intDataCon_RDR [ah_RDR]])
(illegal_Expr "succ" occ_nm "tried to take `succ' of last tag in enumeration")
(nlHsApp (nlHsVar (tag2con_RDR tycon))
(nlHsApps plus_RDR [nlHsVarApps intDataCon_RDR [ah_RDR],
nlHsIntLit 1]))
pred_enum
= mk_easy_FunBind loc pred_RDR [a_Pat] $
untag_Expr tycon [(a_RDR, ah_RDR)] $
nlHsIf (nlHsApps eq_RDR [nlHsIntLit 0,
nlHsVarApps intDataCon_RDR [ah_RDR]])
(illegal_Expr "pred" occ_nm "tried to take `pred' of first tag in enumeration")
(nlHsApp (nlHsVar (tag2con_RDR tycon))
(nlHsApps plus_RDR [nlHsVarApps intDataCon_RDR [ah_RDR],
nlHsLit (HsInt "-1" (-1))]))
to_enum
= mk_easy_FunBind loc toEnum_RDR [a_Pat] $
nlHsIf (nlHsApps and_RDR
[nlHsApps ge_RDR [nlHsVar a_RDR, nlHsIntLit 0],
nlHsApps le_RDR [nlHsVar a_RDR, nlHsVar (maxtag_RDR tycon)]])
(nlHsVarApps (tag2con_RDR tycon) [a_RDR])
(illegal_toEnum_tag occ_nm (maxtag_RDR tycon))
enum_from
= mk_easy_FunBind loc enumFrom_RDR [a_Pat] $
untag_Expr tycon [(a_RDR, ah_RDR)] $
nlHsApps map_RDR
[nlHsVar (tag2con_RDR tycon),
nlHsPar (enum_from_to_Expr
(nlHsVarApps intDataCon_RDR [ah_RDR])
(nlHsVar (maxtag_RDR tycon)))]
enum_from_then
= mk_easy_FunBind loc enumFromThen_RDR [a_Pat, b_Pat] $
untag_Expr tycon [(a_RDR, ah_RDR), (b_RDR, bh_RDR)] $
nlHsApp (nlHsVarApps map_RDR [tag2con_RDR tycon]) $
nlHsPar (enum_from_then_to_Expr
(nlHsVarApps intDataCon_RDR [ah_RDR])
(nlHsVarApps intDataCon_RDR [bh_RDR])
(nlHsIf (nlHsApps gt_RDR [nlHsVarApps intDataCon_RDR [ah_RDR],
nlHsVarApps intDataCon_RDR [bh_RDR]])
(nlHsIntLit 0)
(nlHsVar (maxtag_RDR tycon))
))
from_enum
= mk_easy_FunBind loc fromEnum_RDR [a_Pat] $
untag_Expr tycon [(a_RDR, ah_RDR)] $
(nlHsVarApps intDataCon_RDR [ah_RDR])
{-
************************************************************************
* *
Bounded instances
* *
************************************************************************
-}
| 3,456
|
gen_Enum_binds loc tycon
= (method_binds, aux_binds)
where
method_binds = listToBag [
succ_enum,
pred_enum,
to_enum,
enum_from,
enum_from_then,
from_enum
]
aux_binds = listToBag $ map DerivAuxBind
[DerivCon2Tag tycon, DerivTag2Con tycon, DerivMaxTag tycon]
occ_nm = getOccString tycon
succ_enum
= mk_easy_FunBind loc succ_RDR [a_Pat] $
untag_Expr tycon [(a_RDR, ah_RDR)] $
nlHsIf (nlHsApps eq_RDR [nlHsVar (maxtag_RDR tycon),
nlHsVarApps intDataCon_RDR [ah_RDR]])
(illegal_Expr "succ" occ_nm "tried to take `succ' of last tag in enumeration")
(nlHsApp (nlHsVar (tag2con_RDR tycon))
(nlHsApps plus_RDR [nlHsVarApps intDataCon_RDR [ah_RDR],
nlHsIntLit 1]))
pred_enum
= mk_easy_FunBind loc pred_RDR [a_Pat] $
untag_Expr tycon [(a_RDR, ah_RDR)] $
nlHsIf (nlHsApps eq_RDR [nlHsIntLit 0,
nlHsVarApps intDataCon_RDR [ah_RDR]])
(illegal_Expr "pred" occ_nm "tried to take `pred' of first tag in enumeration")
(nlHsApp (nlHsVar (tag2con_RDR tycon))
(nlHsApps plus_RDR [nlHsVarApps intDataCon_RDR [ah_RDR],
nlHsLit (HsInt "-1" (-1))]))
to_enum
= mk_easy_FunBind loc toEnum_RDR [a_Pat] $
nlHsIf (nlHsApps and_RDR
[nlHsApps ge_RDR [nlHsVar a_RDR, nlHsIntLit 0],
nlHsApps le_RDR [nlHsVar a_RDR, nlHsVar (maxtag_RDR tycon)]])
(nlHsVarApps (tag2con_RDR tycon) [a_RDR])
(illegal_toEnum_tag occ_nm (maxtag_RDR tycon))
enum_from
= mk_easy_FunBind loc enumFrom_RDR [a_Pat] $
untag_Expr tycon [(a_RDR, ah_RDR)] $
nlHsApps map_RDR
[nlHsVar (tag2con_RDR tycon),
nlHsPar (enum_from_to_Expr
(nlHsVarApps intDataCon_RDR [ah_RDR])
(nlHsVar (maxtag_RDR tycon)))]
enum_from_then
= mk_easy_FunBind loc enumFromThen_RDR [a_Pat, b_Pat] $
untag_Expr tycon [(a_RDR, ah_RDR), (b_RDR, bh_RDR)] $
nlHsApp (nlHsVarApps map_RDR [tag2con_RDR tycon]) $
nlHsPar (enum_from_then_to_Expr
(nlHsVarApps intDataCon_RDR [ah_RDR])
(nlHsVarApps intDataCon_RDR [bh_RDR])
(nlHsIf (nlHsApps gt_RDR [nlHsVarApps intDataCon_RDR [ah_RDR],
nlHsVarApps intDataCon_RDR [bh_RDR]])
(nlHsIntLit 0)
(nlHsVar (maxtag_RDR tycon))
))
from_enum
= mk_easy_FunBind loc fromEnum_RDR [a_Pat] $
untag_Expr tycon [(a_RDR, ah_RDR)] $
(nlHsVarApps intDataCon_RDR [ah_RDR])
{-
************************************************************************
* *
Bounded instances
* *
************************************************************************
-}
| 3,384
| true
| true
| 6
| 16
| 1,770
| 809
| 413
| 396
| null | null |
taojang/haskell-programming-book-exercise
|
src/ch09/Chapter9.hs
|
bsd-3-clause
|
capAll :: String -> String
capAll [] = []
| 48
|
capAll :: String -> String
capAll [] = []
| 48
|
capAll [] = []
| 21
| false
| true
| 0
| 8
| 15
| 28
| 12
| 16
| null | null |
aisamanra/tansu-berkeleydb
|
Database/Tansu/Backend/BerkeleyDb.hs
|
gpl-3.0
|
bdbDel :: Db -> ByteString -> IO (Either TansuError ())
bdbDel db key =
catchIO $ db_del [] db Nothing key
| 108
|
bdbDel :: Db -> ByteString -> IO (Either TansuError ())
bdbDel db key =
catchIO $ db_del [] db Nothing key
| 108
|
bdbDel db key =
catchIO $ db_del [] db Nothing key
| 52
| false
| true
| 2
| 11
| 22
| 61
| 26
| 35
| null | null |
alphaHeavy/hako
|
Text/Hako/Parsing.hs
|
bsd-3-clause
|
-- | Hako's main parser, suitable as a quoteExpr.
parseTemplateFromString :: String -> Q Exp
parseTemplateFromString s = do
exp <- runParserT template () "Hako" s
return $ either (error . show) id exp
| 204
|
parseTemplateFromString :: String -> Q Exp
parseTemplateFromString s = do
exp <- runParserT template () "Hako" s
return $ either (error . show) id exp
| 154
|
parseTemplateFromString s = do
exp <- runParserT template () "Hako" s
return $ either (error . show) id exp
| 111
| true
| true
| 0
| 11
| 37
| 66
| 30
| 36
| null | null |
alexander-at-github/eta
|
compiler/ETA/StgSyn/CoreToStg.hs
|
bsd-3-clause
|
isLetBound _ = False
| 33
|
isLetBound _ = False
| 33
|
isLetBound _ = False
| 33
| false
| false
| 0
| 4
| 16
| 10
| 4
| 6
| null | null |
nvasilakis/pandoc
|
src/Text/Pandoc/Readers/LaTeX.hs
|
gpl-2.0
|
hacek 'I' = "Ǐ"
| 15
|
hacek 'I' = "Ǐ"
| 15
|
hacek 'I' = "Ǐ"
| 15
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
spikelynch/annales
|
app/Annales/Succession.hs
|
bsd-3-clause
|
embellishName :: Empire -> TextGenCh -> IO ( TextGenCh, TextGenCh )
embellishName e style = do
r <- randn 4
case r of
3 -> do
epithet <- generate $ vocabGet e "epithets"
stext <- generate style
sname <- return $ ( dumbjoin stext )
ep <- return $ ( cap $ dumbjoin epithet )
longname <- return $ sname ++ " the " ++ ep
nstyle <- return $ choose [ style, word longname ]
phrases <- return $ choose [ word "later called the", word "surnamed the" ]
intro <- return $ list [ word sname, phrase $ list [ phrases, word ep ] ]
return ( intro, nstyle )
otherwise -> return ( style, style )
-- TODO: multiple levels of heirs
-- Default: favouring males
| 731
|
embellishName :: Empire -> TextGenCh -> IO ( TextGenCh, TextGenCh )
embellishName e style = do
r <- randn 4
case r of
3 -> do
epithet <- generate $ vocabGet e "epithets"
stext <- generate style
sname <- return $ ( dumbjoin stext )
ep <- return $ ( cap $ dumbjoin epithet )
longname <- return $ sname ++ " the " ++ ep
nstyle <- return $ choose [ style, word longname ]
phrases <- return $ choose [ word "later called the", word "surnamed the" ]
intro <- return $ list [ word sname, phrase $ list [ phrases, word ep ] ]
return ( intro, nstyle )
otherwise -> return ( style, style )
-- TODO: multiple levels of heirs
-- Default: favouring males
| 731
|
embellishName e style = do
r <- randn 4
case r of
3 -> do
epithet <- generate $ vocabGet e "epithets"
stext <- generate style
sname <- return $ ( dumbjoin stext )
ep <- return $ ( cap $ dumbjoin epithet )
longname <- return $ sname ++ " the " ++ ep
nstyle <- return $ choose [ style, word longname ]
phrases <- return $ choose [ word "later called the", word "surnamed the" ]
intro <- return $ list [ word sname, phrase $ list [ phrases, word ep ] ]
return ( intro, nstyle )
otherwise -> return ( style, style )
-- TODO: multiple levels of heirs
-- Default: favouring males
| 663
| false
| true
| 0
| 20
| 218
| 261
| 124
| 137
| null | null |
flowbox-public/mainland-pretty
|
Text/PrettyPrint/Mainland.hs
|
bsd-3-clause
|
-- | The document @'text' s@ consists of the string @s@, which should not
-- contain any newlines. For a string that may include newlines, use 'string'.
text :: String -> Doc
text s = String (length s) s
| 203
|
text :: String -> Doc
text s = String (length s) s
| 50
|
text s = String (length s) s
| 28
| true
| true
| 0
| 7
| 38
| 31
| 16
| 15
| null | null |
eryx67/haskell-libtorrent
|
src/Network/Libtorrent/Session/SessionStatus.hs
|
bsd-3-clause
|
getSessionNumPeers :: MonadIO m => SessionStatus -> m CInt
getSessionNumPeers ho =
liftIO . withPtr ho $ \hoPtr ->
[CU.exp| int { $(session_status * hoPtr)->num_peers } |]
| 176
|
getSessionNumPeers :: MonadIO m => SessionStatus -> m CInt
getSessionNumPeers ho =
liftIO . withPtr ho $ \hoPtr ->
[CU.exp| int { $(session_status * hoPtr)->num_peers } |]
| 176
|
getSessionNumPeers ho =
liftIO . withPtr ho $ \hoPtr ->
[CU.exp| int { $(session_status * hoPtr)->num_peers } |]
| 116
| false
| true
| 0
| 7
| 31
| 50
| 26
| 24
| null | null |
davidfontenot/haskell-stuff
|
BasicArrays.hs
|
gpl-2.0
|
assocsVals :: (Num a) => [((Int,Int),a)] -> [a]
assocsVals lst = map (\((_,_),v) -> v) lst
| 90
|
assocsVals :: (Num a) => [((Int,Int),a)] -> [a]
assocsVals lst = map (\((_,_),v) -> v) lst
| 90
|
assocsVals lst = map (\((_,_),v) -> v) lst
| 42
| false
| true
| 0
| 9
| 15
| 70
| 41
| 29
| null | null |
fmapfmapfmap/amazonka
|
amazonka-cloudsearch/gen/Network/AWS/CloudSearch/UpdateServiceAccessPolicies.hs
|
mpl-2.0
|
-- | Creates a value of 'UpdateServiceAccessPoliciesResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'usaprsResponseStatus'
--
-- * 'usaprsAccessPolicies'
updateServiceAccessPoliciesResponse
:: Int -- ^ 'usaprsResponseStatus'
-> AccessPoliciesStatus -- ^ 'usaprsAccessPolicies'
-> UpdateServiceAccessPoliciesResponse
updateServiceAccessPoliciesResponse pResponseStatus_ pAccessPolicies_ =
UpdateServiceAccessPoliciesResponse'
{ _usaprsResponseStatus = pResponseStatus_
, _usaprsAccessPolicies = pAccessPolicies_
}
| 635
|
updateServiceAccessPoliciesResponse
:: Int -- ^ 'usaprsResponseStatus'
-> AccessPoliciesStatus -- ^ 'usaprsAccessPolicies'
-> UpdateServiceAccessPoliciesResponse
updateServiceAccessPoliciesResponse pResponseStatus_ pAccessPolicies_ =
UpdateServiceAccessPoliciesResponse'
{ _usaprsResponseStatus = pResponseStatus_
, _usaprsAccessPolicies = pAccessPolicies_
}
| 386
|
updateServiceAccessPoliciesResponse pResponseStatus_ pAccessPolicies_ =
UpdateServiceAccessPoliciesResponse'
{ _usaprsResponseStatus = pResponseStatus_
, _usaprsAccessPolicies = pAccessPolicies_
}
| 212
| true
| true
| 0
| 6
| 92
| 47
| 30
| 17
| null | null |
abhishekkr/tutorials_as_code
|
talks-articles/languages-n-runtimes/haskell/misc/prajitr.github.io--quick-haskell-syntax.hs
|
mit
|
-- | fOFgOFx head last "abcd"
-- | alternatively composition function
f . g = (\x -> f (g x))
| 93
|
f . g = (\x -> f (g x))
| 23
|
f . g = (\x -> f (g x))
| 23
| true
| false
| 2
| 10
| 19
| 34
| 16
| 18
| null | null |
accelas/socks5
|
src/Socks5/Internal.hs
|
mit
|
connSuccess :: Socks5Addr -> CmdResp
connSuccess addr = CmdResp (0, Just addr)
| 78
|
connSuccess :: Socks5Addr -> CmdResp
connSuccess addr = CmdResp (0, Just addr)
| 78
|
connSuccess addr = CmdResp (0, Just addr)
| 41
| false
| true
| 0
| 7
| 11
| 30
| 15
| 15
| null | null |
tdox/elevators
|
Elevators/Logic.hs
|
gpl-3.0
|
isCompatiblePickUpGoal (PickUpG r1) (PickUpG r2) =
start1 == start2 && riderDir r1 == riderDir r2
where
start1 = rStart r1
start2 = rStart r2
| 153
|
isCompatiblePickUpGoal (PickUpG r1) (PickUpG r2) =
start1 == start2 && riderDir r1 == riderDir r2
where
start1 = rStart r1
start2 = rStart r2
| 153
|
isCompatiblePickUpGoal (PickUpG r1) (PickUpG r2) =
start1 == start2 && riderDir r1 == riderDir r2
where
start1 = rStart r1
start2 = rStart r2
| 153
| false
| false
| 1
| 7
| 35
| 60
| 28
| 32
| null | null |
kim/amazonka
|
amazonka-elastictranscoder/gen/Network/AWS/ElasticTranscoder/UpdatePipelineNotifications.hs
|
mpl-2.0
|
-- | 'UpdatePipelineNotifications' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'upnId' @::@ 'Text'
--
-- * 'upnNotifications' @::@ 'Notifications'
--
updatePipelineNotifications :: Text -- ^ 'upnId'
-> Notifications -- ^ 'upnNotifications'
-> UpdatePipelineNotifications
updatePipelineNotifications p1 p2 = UpdatePipelineNotifications
{ _upnId = p1
, _upnNotifications = p2
}
| 493
|
updatePipelineNotifications :: Text -- ^ 'upnId'
-> Notifications -- ^ 'upnNotifications'
-> UpdatePipelineNotifications
updatePipelineNotifications p1 p2 = UpdatePipelineNotifications
{ _upnId = p1
, _upnNotifications = p2
}
| 304
|
updatePipelineNotifications p1 p2 = UpdatePipelineNotifications
{ _upnId = p1
, _upnNotifications = p2
}
| 127
| true
| true
| 0
| 7
| 131
| 52
| 32
| 20
| null | null |
xmonad/xmonad-contrib
|
XMonad/Util/Parser.hs
|
bsd-3-clause
|
-- | @endBy p sep@ parses one or more occurrences of @p@, separated and
-- ended by @sep@.
endBy1 :: Parser a -> Parser sep -> Parser [a]
endBy1 p sep = many1 (p <* sep)
| 169
|
endBy1 :: Parser a -> Parser sep -> Parser [a]
endBy1 p sep = many1 (p <* sep)
| 78
|
endBy1 p sep = many1 (p <* sep)
| 31
| true
| true
| 0
| 9
| 35
| 52
| 25
| 27
| null | null |
printedheart/Dao
|
tests/Dao/Test/Interval.hs
|
agpl-3.0
|
testSuite_intersectionOperations :: [TestSuite (EqISets, EqISets) EqISets]
testSuite_intersectionOperations = testSuite_binaryOperations '&' intersectEqISets
| 157
|
testSuite_intersectionOperations :: [TestSuite (EqISets, EqISets) EqISets]
testSuite_intersectionOperations = testSuite_binaryOperations '&' intersectEqISets
| 157
|
testSuite_intersectionOperations = testSuite_binaryOperations '&' intersectEqISets
| 82
| false
| true
| 0
| 7
| 10
| 30
| 16
| 14
| null | null |
Paow/encore
|
src/types/Typechecker/Typechecker.hs
|
bsd-3-clause
|
matchArgumentLength :: Type -> FunctionHeader -> Arguments -> TypecheckM ()
matchArgumentLength targetType header args =
unless (actual == expected) $
tcError $ WrongNumberOfMethodArgumentsError
(hname header) targetType expected actual
where
actual = length args
expected = length (hparams header)
| 338
|
matchArgumentLength :: Type -> FunctionHeader -> Arguments -> TypecheckM ()
matchArgumentLength targetType header args =
unless (actual == expected) $
tcError $ WrongNumberOfMethodArgumentsError
(hname header) targetType expected actual
where
actual = length args
expected = length (hparams header)
| 338
|
matchArgumentLength targetType header args =
unless (actual == expected) $
tcError $ WrongNumberOfMethodArgumentsError
(hname header) targetType expected actual
where
actual = length args
expected = length (hparams header)
| 262
| false
| true
| 6
| 10
| 77
| 107
| 46
| 61
| null | null |
nobsun/oi
|
sample/recdircs.hs
|
bsd-3-clause
|
choice :: a -> a -> Bool -> a
choice t f c = if c then t else f
| 63
|
choice :: a -> a -> Bool -> a
choice t f c = if c then t else f
| 63
|
choice t f c = if c then t else f
| 33
| false
| true
| 0
| 9
| 19
| 44
| 21
| 23
| null | null |
mariefarrell/Hets
|
GMP/GMP-CoLoSS/GMP/Logics/SysS.hs
|
gpl-2.0
|
diagonal :: [Int] -> [(Int, Int)]
diagonal = map (\ w -> (w, w))
| 64
|
diagonal :: [Int] -> [(Int, Int)]
diagonal = map (\ w -> (w, w))
| 64
|
diagonal = map (\ w -> (w, w))
| 30
| false
| true
| 0
| 8
| 13
| 44
| 26
| 18
| null | null |
ianbollinger/nomegen
|
gui/Main.hs
|
mit
|
buildWindow :: Application -> IO Gtk.Window
buildWindow app = do
window <- Gtk.windowNew
_ <- Gtk.on window Gtk.objectDestroy Gtk.mainQuit
Gtk.set window [
Gtk.containerBorderWidth := 10,
Gtk.windowTitle := "nomegen"
]
connectSignals app
hBox <- Gtk.hBoxNew False 10
Gtk.containerAdd hBox (fileChooserButton app)
Gtk.containerAdd hBox (generateButton app)
vBox <- Gtk.vBoxNew False 10
Gtk.boxPackStart vBox (nameLabel app) Gtk.PackGrow 0
Gtk.boxPackStart vBox hBox Gtk.PackNatural 0
Gtk.containerAdd window vBox
return window
| 597
|
buildWindow :: Application -> IO Gtk.Window
buildWindow app = do
window <- Gtk.windowNew
_ <- Gtk.on window Gtk.objectDestroy Gtk.mainQuit
Gtk.set window [
Gtk.containerBorderWidth := 10,
Gtk.windowTitle := "nomegen"
]
connectSignals app
hBox <- Gtk.hBoxNew False 10
Gtk.containerAdd hBox (fileChooserButton app)
Gtk.containerAdd hBox (generateButton app)
vBox <- Gtk.vBoxNew False 10
Gtk.boxPackStart vBox (nameLabel app) Gtk.PackGrow 0
Gtk.boxPackStart vBox hBox Gtk.PackNatural 0
Gtk.containerAdd window vBox
return window
| 597
|
buildWindow app = do
window <- Gtk.windowNew
_ <- Gtk.on window Gtk.objectDestroy Gtk.mainQuit
Gtk.set window [
Gtk.containerBorderWidth := 10,
Gtk.windowTitle := "nomegen"
]
connectSignals app
hBox <- Gtk.hBoxNew False 10
Gtk.containerAdd hBox (fileChooserButton app)
Gtk.containerAdd hBox (generateButton app)
vBox <- Gtk.vBoxNew False 10
Gtk.boxPackStart vBox (nameLabel app) Gtk.PackGrow 0
Gtk.boxPackStart vBox hBox Gtk.PackNatural 0
Gtk.containerAdd window vBox
return window
| 553
| false
| true
| 0
| 10
| 136
| 200
| 89
| 111
| null | null |
bgold-cosmos/Tidal
|
src/Sound/Tidal/Params.hs
|
gpl-3.0
|
-- |
slider10 :: Pattern Double -> ControlPattern
slider10 = pF "slider10"
| 75
|
slider10 :: Pattern Double -> ControlPattern
slider10 = pF "slider10"
| 69
|
slider10 = pF "slider10"
| 24
| true
| true
| 0
| 7
| 12
| 29
| 12
| 17
| null | null |
fmapfmapfmap/amazonka
|
amazonka-s3/gen/Network/AWS/S3/UploadPart.hs
|
mpl-2.0
|
-- | Undocumented member.
upRequestPayer :: Lens' UploadPart (Maybe RequestPayer)
upRequestPayer = lens _upRequestPayer (\ s a -> s{_upRequestPayer = a})
| 153
|
upRequestPayer :: Lens' UploadPart (Maybe RequestPayer)
upRequestPayer = lens _upRequestPayer (\ s a -> s{_upRequestPayer = a})
| 127
|
upRequestPayer = lens _upRequestPayer (\ s a -> s{_upRequestPayer = a})
| 71
| true
| true
| 0
| 9
| 20
| 46
| 25
| 21
| null | null |
nushio3/ghc
|
compiler/typecheck/TcRnTypes.hs
|
bsd-3-clause
|
setCtLoc :: Ct -> CtLoc -> Ct
setCtLoc ct loc = ct { cc_ev = (cc_ev ct) { ctev_loc = loc } }
| 92
|
setCtLoc :: Ct -> CtLoc -> Ct
setCtLoc ct loc = ct { cc_ev = (cc_ev ct) { ctev_loc = loc } }
| 92
|
setCtLoc ct loc = ct { cc_ev = (cc_ev ct) { ctev_loc = loc } }
| 62
| false
| true
| 0
| 10
| 22
| 55
| 27
| 28
| null | null |
cornell-pl/HsAdapton
|
weak-hashtables/src/Data/HashTable/Weak/Internal/Linear/Bucket.hs
|
bsd-3-clause
|
toList :: Bucket s k v -> ST s [(k,v)]
toList bucketKey | keyIsEmpty bucketKey = return []
| otherwise = toList' $ fromKey bucketKey
where
toList' (Bucket _ hwRef keys values) = do
hw <- readSTRef hwRef
go [] hw 0
where
go !l !hw !i | i >= hw = return l
| otherwise = do
k <- readArray keys i
v <- readArray values i
go ((k,v):l) hw $ i+1
------------------------------------------------------------------------------
-- fromList needs to reverse the input in order to make fromList . toList == id
| 612
|
toList :: Bucket s k v -> ST s [(k,v)]
toList bucketKey | keyIsEmpty bucketKey = return []
| otherwise = toList' $ fromKey bucketKey
where
toList' (Bucket _ hwRef keys values) = do
hw <- readSTRef hwRef
go [] hw 0
where
go !l !hw !i | i >= hw = return l
| otherwise = do
k <- readArray keys i
v <- readArray values i
go ((k,v):l) hw $ i+1
------------------------------------------------------------------------------
-- fromList needs to reverse the input in order to make fromList . toList == id
| 612
|
toList bucketKey | keyIsEmpty bucketKey = return []
| otherwise = toList' $ fromKey bucketKey
where
toList' (Bucket _ hwRef keys values) = do
hw <- readSTRef hwRef
go [] hw 0
where
go !l !hw !i | i >= hw = return l
| otherwise = do
k <- readArray keys i
v <- readArray values i
go ((k,v):l) hw $ i+1
------------------------------------------------------------------------------
-- fromList needs to reverse the input in order to make fromList . toList == id
| 573
| false
| true
| 0
| 15
| 204
| 208
| 95
| 113
| null | null |
ianthehenry/basilica
|
Main.hs
|
mit
|
isValidName :: Text -> Bool
isValidName name = all isAlphaNum name && (len >= 2) && (len < 20)
where len = length name
| 120
|
isValidName :: Text -> Bool
isValidName name = all isAlphaNum name && (len >= 2) && (len < 20)
where len = length name
| 120
|
isValidName name = all isAlphaNum name && (len >= 2) && (len < 20)
where len = length name
| 92
| false
| true
| 0
| 8
| 25
| 56
| 28
| 28
| null | null |
IreneKnapp/Eyeshadow
|
Haskell/Main.hs
|
mit
|
takeOptions :: [String] -> ([Diagnostic], InvocationOptions, [String])
takeOptions arguments =
let loop ("--" : rest) diagnosticsSoFar optionsSoFar =
(diagnosticsSoFar, optionsSoFar, rest)
loop ("--help" : rest) diagnosticsSoFar optionsSoFar =
loop rest diagnosticsSoFar $ optionsSoFar {
invocationOptionsMode = HelpInvocationMode
}
loop ("--text" : rest) diagnosticsSoFar optionsSoFar =
loop rest diagnosticsSoFar $ optionsSoFar {
invocationOptionsDiagnostic =
(invocationOptionsDiagnostic optionsSoFar) {
diagnosticOptionsOutputFormat =
TextDiagnosticOutputFormat
}
}
loop ("--terminal" : rest) diagnosticsSoFar optionsSoFar =
loop rest diagnosticsSoFar $ optionsSoFar {
invocationOptionsDiagnostic =
(invocationOptionsDiagnostic optionsSoFar) {
diagnosticOptionsOutputFormat =
TerminalDiagnosticOutputFormat
}
}
loop ("--json" : rest) diagnosticsSoFar optionsSoFar =
loop rest diagnosticsSoFar $ optionsSoFar {
invocationOptionsDiagnostic =
(invocationOptionsDiagnostic optionsSoFar) {
diagnosticOptionsOutputFormat =
JSONDiagnosticOutputFormat
}
}
loop ("--snippets" : rest) diagnosticsSoFar optionsSoFar =
loop rest diagnosticsSoFar $ optionsSoFar {
invocationOptionsDiagnostic =
(invocationOptionsDiagnostic optionsSoFar) {
diagnosticOptionsOutputSourceSnippets =
True
}
}
loop ("--no-snippets" : rest) diagnosticsSoFar optionsSoFar =
loop rest diagnosticsSoFar $ optionsSoFar {
invocationOptionsDiagnostic =
(invocationOptionsDiagnostic optionsSoFar) {
diagnosticOptionsOutputSourceSnippets =
False
}
}
loop (option@('-' : _) : rest) diagnosticsSoFar optionsSoFar =
loop rest (diagnosticsSoFar ++ [unknownOptionDiagnostic option])
optionsSoFar
loop rest diagnosticsSoFar optionsSoFar =
(diagnosticsSoFar, optionsSoFar, rest)
in loop arguments []
$ InvocationOptions {
invocationOptionsDiagnostic =
DiagnosticOptions {
diagnosticOptionsOutputFormat =
TerminalDiagnosticOutputFormat,
diagnosticOptionsOutputSourceSnippets = True
},
invocationOptionsMode = CompilationInvocationMode
}
| 3,107
|
takeOptions :: [String] -> ([Diagnostic], InvocationOptions, [String])
takeOptions arguments =
let loop ("--" : rest) diagnosticsSoFar optionsSoFar =
(diagnosticsSoFar, optionsSoFar, rest)
loop ("--help" : rest) diagnosticsSoFar optionsSoFar =
loop rest diagnosticsSoFar $ optionsSoFar {
invocationOptionsMode = HelpInvocationMode
}
loop ("--text" : rest) diagnosticsSoFar optionsSoFar =
loop rest diagnosticsSoFar $ optionsSoFar {
invocationOptionsDiagnostic =
(invocationOptionsDiagnostic optionsSoFar) {
diagnosticOptionsOutputFormat =
TextDiagnosticOutputFormat
}
}
loop ("--terminal" : rest) diagnosticsSoFar optionsSoFar =
loop rest diagnosticsSoFar $ optionsSoFar {
invocationOptionsDiagnostic =
(invocationOptionsDiagnostic optionsSoFar) {
diagnosticOptionsOutputFormat =
TerminalDiagnosticOutputFormat
}
}
loop ("--json" : rest) diagnosticsSoFar optionsSoFar =
loop rest diagnosticsSoFar $ optionsSoFar {
invocationOptionsDiagnostic =
(invocationOptionsDiagnostic optionsSoFar) {
diagnosticOptionsOutputFormat =
JSONDiagnosticOutputFormat
}
}
loop ("--snippets" : rest) diagnosticsSoFar optionsSoFar =
loop rest diagnosticsSoFar $ optionsSoFar {
invocationOptionsDiagnostic =
(invocationOptionsDiagnostic optionsSoFar) {
diagnosticOptionsOutputSourceSnippets =
True
}
}
loop ("--no-snippets" : rest) diagnosticsSoFar optionsSoFar =
loop rest diagnosticsSoFar $ optionsSoFar {
invocationOptionsDiagnostic =
(invocationOptionsDiagnostic optionsSoFar) {
diagnosticOptionsOutputSourceSnippets =
False
}
}
loop (option@('-' : _) : rest) diagnosticsSoFar optionsSoFar =
loop rest (diagnosticsSoFar ++ [unknownOptionDiagnostic option])
optionsSoFar
loop rest diagnosticsSoFar optionsSoFar =
(diagnosticsSoFar, optionsSoFar, rest)
in loop arguments []
$ InvocationOptions {
invocationOptionsDiagnostic =
DiagnosticOptions {
diagnosticOptionsOutputFormat =
TerminalDiagnosticOutputFormat,
diagnosticOptionsOutputSourceSnippets = True
},
invocationOptionsMode = CompilationInvocationMode
}
| 3,107
|
takeOptions arguments =
let loop ("--" : rest) diagnosticsSoFar optionsSoFar =
(diagnosticsSoFar, optionsSoFar, rest)
loop ("--help" : rest) diagnosticsSoFar optionsSoFar =
loop rest diagnosticsSoFar $ optionsSoFar {
invocationOptionsMode = HelpInvocationMode
}
loop ("--text" : rest) diagnosticsSoFar optionsSoFar =
loop rest diagnosticsSoFar $ optionsSoFar {
invocationOptionsDiagnostic =
(invocationOptionsDiagnostic optionsSoFar) {
diagnosticOptionsOutputFormat =
TextDiagnosticOutputFormat
}
}
loop ("--terminal" : rest) diagnosticsSoFar optionsSoFar =
loop rest diagnosticsSoFar $ optionsSoFar {
invocationOptionsDiagnostic =
(invocationOptionsDiagnostic optionsSoFar) {
diagnosticOptionsOutputFormat =
TerminalDiagnosticOutputFormat
}
}
loop ("--json" : rest) diagnosticsSoFar optionsSoFar =
loop rest diagnosticsSoFar $ optionsSoFar {
invocationOptionsDiagnostic =
(invocationOptionsDiagnostic optionsSoFar) {
diagnosticOptionsOutputFormat =
JSONDiagnosticOutputFormat
}
}
loop ("--snippets" : rest) diagnosticsSoFar optionsSoFar =
loop rest diagnosticsSoFar $ optionsSoFar {
invocationOptionsDiagnostic =
(invocationOptionsDiagnostic optionsSoFar) {
diagnosticOptionsOutputSourceSnippets =
True
}
}
loop ("--no-snippets" : rest) diagnosticsSoFar optionsSoFar =
loop rest diagnosticsSoFar $ optionsSoFar {
invocationOptionsDiagnostic =
(invocationOptionsDiagnostic optionsSoFar) {
diagnosticOptionsOutputSourceSnippets =
False
}
}
loop (option@('-' : _) : rest) diagnosticsSoFar optionsSoFar =
loop rest (diagnosticsSoFar ++ [unknownOptionDiagnostic option])
optionsSoFar
loop rest diagnosticsSoFar optionsSoFar =
(diagnosticsSoFar, optionsSoFar, rest)
in loop arguments []
$ InvocationOptions {
invocationOptionsDiagnostic =
DiagnosticOptions {
diagnosticOptionsOutputFormat =
TerminalDiagnosticOutputFormat,
diagnosticOptionsOutputSourceSnippets = True
},
invocationOptionsMode = CompilationInvocationMode
}
| 3,036
| false
| true
| 0
| 14
| 1,317
| 465
| 254
| 211
| null | null |
ribag/ganeti-experiments
|
src/Ganeti/Metad/WebServer.hs
|
gpl-2.0
|
handleMetadata params GET "ganeti" "latest" script | isScript script =
do remoteAddr <- ByteString.unpack . rqRemoteAddr <$> getRequest
instanceParams <- liftIO $ do
Logging.logInfo $ "OS package for " ++ show remoteAddr
readMVar params
serveOsScript remoteAddr instanceParams (last $ split script) `catchError`
\err -> do
liftIO . Logging.logWarning $ "Could not serve OS scripts: " ++ err
error404
where isScript =
(`elem` [ "os/scripts/create"
, "os/scripts/export"
, "os/scripts/import"
, "os/scripts/rename"
, "os/scripts/verify"
])
| 691
|
handleMetadata params GET "ganeti" "latest" script | isScript script =
do remoteAddr <- ByteString.unpack . rqRemoteAddr <$> getRequest
instanceParams <- liftIO $ do
Logging.logInfo $ "OS package for " ++ show remoteAddr
readMVar params
serveOsScript remoteAddr instanceParams (last $ split script) `catchError`
\err -> do
liftIO . Logging.logWarning $ "Could not serve OS scripts: " ++ err
error404
where isScript =
(`elem` [ "os/scripts/create"
, "os/scripts/export"
, "os/scripts/import"
, "os/scripts/rename"
, "os/scripts/verify"
])
| 691
|
handleMetadata params GET "ganeti" "latest" script | isScript script =
do remoteAddr <- ByteString.unpack . rqRemoteAddr <$> getRequest
instanceParams <- liftIO $ do
Logging.logInfo $ "OS package for " ++ show remoteAddr
readMVar params
serveOsScript remoteAddr instanceParams (last $ split script) `catchError`
\err -> do
liftIO . Logging.logWarning $ "Could not serve OS scripts: " ++ err
error404
where isScript =
(`elem` [ "os/scripts/create"
, "os/scripts/export"
, "os/scripts/import"
, "os/scripts/rename"
, "os/scripts/verify"
])
| 691
| false
| false
| 0
| 15
| 226
| 156
| 77
| 79
| null | null |
bjornbm/aeq
|
tests/Tests.hs
|
bsd-3-clause
|
test_minNaN_F1 = minNaN nan 1 @?== (nan :: F)
| 45
|
test_minNaN_F1 = minNaN nan 1 @?== (nan :: F)
| 45
|
test_minNaN_F1 = minNaN nan 1 @?== (nan :: F)
| 45
| false
| false
| 0
| 6
| 8
| 21
| 11
| 10
| null | null |
SEEK-Org/evaporate
|
src/StackParameters.hs
|
mit
|
convertToTags :: Tags -> [Tag]
convertToTags = fmap makeTag . HashMap.toList
where makeTag (key, value) =
tag & tagKey ?~ key
& tagValue ?~ value
| 171
|
convertToTags :: Tags -> [Tag]
convertToTags = fmap makeTag . HashMap.toList
where makeTag (key, value) =
tag & tagKey ?~ key
& tagValue ?~ value
| 171
|
convertToTags = fmap makeTag . HashMap.toList
where makeTag (key, value) =
tag & tagKey ?~ key
& tagValue ?~ value
| 140
| false
| true
| 6
| 8
| 50
| 70
| 32
| 38
| null | null |
merijn/GPU-benchmarks
|
benchmark-analysis/src/RuntimeData.hs
|
gpl-3.0
|
checkVirtualEnv
:: (MonadIO m, MonadLogger m, MonadMask m)
=> FilePath -> FilePath -> m ()
checkVirtualEnv virtualEnv requirements = do
(reqHash :: Digest SHA512) <- hashFile requirements
virtualVersion <- liftIO . Catch.try $ BS.readFile initialisedFile
case virtualVersion of
Right bs | digestFromByteString bs == Just reqHash -> return ()
Right _ -> do
logInfoN $ "Removing out of date virtualenv"
liftIO $ Dir.removeDirectoryRecursive virtualEnv
initVirtualEnv reqHash
Left (SomeException _) -> initVirtualEnv reqHash
where
initialisedFile :: FilePath
initialisedFile = virtualEnv </> "initialised"
initVirtualEnv
:: (MonadIO m, MonadLogger m, MonadMask m) => Digest SHA512 -> m ()
initVirtualEnv reqHash = do
logInfoN $ "Creating virtualenv"
pythonExe <- findPython
runProcess_ pythonExe ["-m", "venv", virtualEnv]
logInfoN $ "Initialising virtualenv"
pipExe <- liftIO $ getDataFileName "runtime-data/virtualenv/bin/pip3"
runProcess_ pipExe ["install", "--upgrade", "pip"]
runProcess_ pipExe ["install", "wheel"]
runProcess_ pipExe ["install", "-r", requirements]
liftIO $ BS.writeFile initialisedFile (ByteArray.convert reqHash)
`Catch.onError` tryRemoveFile initialisedFile
tryRemoveFile :: FilePath -> IO (Either SomeException ())
tryRemoveFile path = Catch.try $ Dir.removeFile path
| 1,492
|
checkVirtualEnv
:: (MonadIO m, MonadLogger m, MonadMask m)
=> FilePath -> FilePath -> m ()
checkVirtualEnv virtualEnv requirements = do
(reqHash :: Digest SHA512) <- hashFile requirements
virtualVersion <- liftIO . Catch.try $ BS.readFile initialisedFile
case virtualVersion of
Right bs | digestFromByteString bs == Just reqHash -> return ()
Right _ -> do
logInfoN $ "Removing out of date virtualenv"
liftIO $ Dir.removeDirectoryRecursive virtualEnv
initVirtualEnv reqHash
Left (SomeException _) -> initVirtualEnv reqHash
where
initialisedFile :: FilePath
initialisedFile = virtualEnv </> "initialised"
initVirtualEnv
:: (MonadIO m, MonadLogger m, MonadMask m) => Digest SHA512 -> m ()
initVirtualEnv reqHash = do
logInfoN $ "Creating virtualenv"
pythonExe <- findPython
runProcess_ pythonExe ["-m", "venv", virtualEnv]
logInfoN $ "Initialising virtualenv"
pipExe <- liftIO $ getDataFileName "runtime-data/virtualenv/bin/pip3"
runProcess_ pipExe ["install", "--upgrade", "pip"]
runProcess_ pipExe ["install", "wheel"]
runProcess_ pipExe ["install", "-r", requirements]
liftIO $ BS.writeFile initialisedFile (ByteArray.convert reqHash)
`Catch.onError` tryRemoveFile initialisedFile
tryRemoveFile :: FilePath -> IO (Either SomeException ())
tryRemoveFile path = Catch.try $ Dir.removeFile path
| 1,492
|
checkVirtualEnv virtualEnv requirements = do
(reqHash :: Digest SHA512) <- hashFile requirements
virtualVersion <- liftIO . Catch.try $ BS.readFile initialisedFile
case virtualVersion of
Right bs | digestFromByteString bs == Just reqHash -> return ()
Right _ -> do
logInfoN $ "Removing out of date virtualenv"
liftIO $ Dir.removeDirectoryRecursive virtualEnv
initVirtualEnv reqHash
Left (SomeException _) -> initVirtualEnv reqHash
where
initialisedFile :: FilePath
initialisedFile = virtualEnv </> "initialised"
initVirtualEnv
:: (MonadIO m, MonadLogger m, MonadMask m) => Digest SHA512 -> m ()
initVirtualEnv reqHash = do
logInfoN $ "Creating virtualenv"
pythonExe <- findPython
runProcess_ pythonExe ["-m", "venv", virtualEnv]
logInfoN $ "Initialising virtualenv"
pipExe <- liftIO $ getDataFileName "runtime-data/virtualenv/bin/pip3"
runProcess_ pipExe ["install", "--upgrade", "pip"]
runProcess_ pipExe ["install", "wheel"]
runProcess_ pipExe ["install", "-r", requirements]
liftIO $ BS.writeFile initialisedFile (ByteArray.convert reqHash)
`Catch.onError` tryRemoveFile initialisedFile
tryRemoveFile :: FilePath -> IO (Either SomeException ())
tryRemoveFile path = Catch.try $ Dir.removeFile path
| 1,393
| false
| true
| 0
| 14
| 359
| 421
| 199
| 222
| null | null |
ComputationWithBoundedResources/ara-inference
|
doc/tpdb_trs/Haskell/basic_haskell/enumFromTo_7.hs
|
mit
|
toEnum2 MyTrue vy = EQ
| 22
|
toEnum2 MyTrue vy = EQ
| 22
|
toEnum2 MyTrue vy = EQ
| 22
| false
| false
| 0
| 5
| 4
| 11
| 5
| 6
| null | null |
input-output-hk/pos-haskell-prototype
|
tools/src/cli-docs/Main.hs
|
mit
|
-- | Top section for Markdown chapter.
topSection :: Markdown
topSection = [text|
---
layout: default
title: Cardano SL CLI Options
permalink: /technical/cli-options/
group: technical
---
<!-- THIS IS AUTOGENERATED CHAPTER. DO NOT CHANGE IT MANUALLY! -->
Cardano SL CLI Options
----------------------
This guide describes all executable files that are used in Cardano SL and all corresponding CLI-options/parameters.
|]
| 423
|
topSection :: Markdown
topSection = [text|
---
layout: default
title: Cardano SL CLI Options
permalink: /technical/cli-options/
group: technical
---
<!-- THIS IS AUTOGENERATED CHAPTER. DO NOT CHANGE IT MANUALLY! -->
Cardano SL CLI Options
----------------------
This guide describes all executable files that are used in Cardano SL and all corresponding CLI-options/parameters.
|]
| 384
|
topSection = [text|
---
layout: default
title: Cardano SL CLI Options
permalink: /technical/cli-options/
group: technical
---
<!-- THIS IS AUTOGENERATED CHAPTER. DO NOT CHANGE IT MANUALLY! -->
Cardano SL CLI Options
----------------------
This guide describes all executable files that are used in Cardano SL and all corresponding CLI-options/parameters.
|]
| 361
| true
| true
| 0
| 6
| 62
| 23
| 12
| 11
| null | null |
ahodgen/archer-calc
|
src/BuiltIn/Text.hs
|
bsd-2-clause
|
right :: [Value] -> Interpreter EvalError Value
right [VText xs, VNum cnt]
| cnt < 0 = biErr "'right' cannot take a negative number."
| otherwise = return . VText . reverse . take (floor cnt) $ reverse xs
| 214
|
right :: [Value] -> Interpreter EvalError Value
right [VText xs, VNum cnt]
| cnt < 0 = biErr "'right' cannot take a negative number."
| otherwise = return . VText . reverse . take (floor cnt) $ reverse xs
| 214
|
right [VText xs, VNum cnt]
| cnt < 0 = biErr "'right' cannot take a negative number."
| otherwise = return . VText . reverse . take (floor cnt) $ reverse xs
| 166
| false
| true
| 1
| 9
| 48
| 86
| 41
| 45
| null | null |
yamadapc/stack-run
|
unix/System/Console/Questioner/ProgressIndicators.hs
|
mit
|
simple9SpinnerTheme = "←↑→↓"
| 28
|
simple9SpinnerTheme = "←↑→↓"
| 28
|
simple9SpinnerTheme = "←↑→↓"
| 28
| false
| false
| 1
| 5
| 2
| 10
| 3
| 7
| null | null |
AlexeyRaga/eta
|
compiler/ETA/Prelude/PrimOp.hs
|
bsd-3-clause
|
primOpOutOfLine TraceEventOp = True
| 35
|
primOpOutOfLine TraceEventOp = True
| 35
|
primOpOutOfLine TraceEventOp = True
| 35
| false
| false
| 0
| 4
| 3
| 10
| 4
| 6
| null | null |
jwiegley/ghc-release
|
libraries/containers/Data/Map/Strict.hs
|
gpl-3.0
|
-- | /O(n+m)/. Difference with a combining function. When two equal keys are
-- encountered, the combining function is applied to the key and both values.
-- If it returns 'Nothing', the element is discarded (proper set difference). If
-- it returns (@'Just' y@), the element is updated with a new value @y@.
-- The implementation uses an efficient /hedge/ algorithm comparable with /hedge-union/.
--
-- > let f k al ar = if al == "b" then Just ((show k) ++ ":" ++ al ++ "|" ++ ar) else Nothing
-- > differenceWithKey f (fromList [(5, "a"), (3, "b")]) (fromList [(5, "A"), (3, "B"), (10, "C")])
-- > == singleton 3 "3:b|B"
differenceWithKey :: Ord k => (k -> a -> b -> Maybe a) -> Map k a -> Map k b -> Map k a
differenceWithKey f t1 t2 = mergeWithKey f id (const Tip) t1 t2
| 779
|
differenceWithKey :: Ord k => (k -> a -> b -> Maybe a) -> Map k a -> Map k b -> Map k a
differenceWithKey f t1 t2 = mergeWithKey f id (const Tip) t1 t2
| 151
|
differenceWithKey f t1 t2 = mergeWithKey f id (const Tip) t1 t2
| 63
| true
| true
| 0
| 12
| 154
| 102
| 51
| 51
| null | null |
tomjaguarpaw/postgresql-simple
|
src/Database/PostgreSQL/Simple/TypeInfo/Static.hs
|
bsd-3-clause
|
timestampOid :: Oid
timestampOid = Oid 1114
| 43
|
timestampOid :: Oid
timestampOid = Oid 1114
| 43
|
timestampOid = Oid 1114
| 23
| false
| true
| 0
| 5
| 6
| 14
| 7
| 7
| null | null |
ribag/ganeti-experiments
|
src/Ganeti/WConfd/TempRes.hs
|
gpl-2.0
|
-- | Embeds a state-modifying computation in a stateful monad.
modifyM :: (MonadState s m) => (s -> m s) -> m ()
modifyM f = get >>= f >>= put
| 142
|
modifyM :: (MonadState s m) => (s -> m s) -> m ()
modifyM f = get >>= f >>= put
| 79
|
modifyM f = get >>= f >>= put
| 29
| true
| true
| 0
| 9
| 30
| 53
| 27
| 26
| null | null |
tonyday567/mvc-extended
|
test/TestSerialize.hs
|
mit
|
setupFiles :: Int -> IO ()
setupFiles n =
do ins <-
replicateM n
(generate arbitrary)
toView n ins (MVC.outShow "test/vc.read")
toView n ins (outBuild "test/vc.parse" (bTestF delim))
-- toView n ins (outBinary "test/vc.binary")
| 271
|
setupFiles :: Int -> IO ()
setupFiles n =
do ins <-
replicateM n
(generate arbitrary)
toView n ins (MVC.outShow "test/vc.read")
toView n ins (outBuild "test/vc.parse" (bTestF delim))
-- toView n ins (outBinary "test/vc.binary")
| 271
|
setupFiles n =
do ins <-
replicateM n
(generate arbitrary)
toView n ins (MVC.outShow "test/vc.read")
toView n ins (outBuild "test/vc.parse" (bTestF delim))
-- toView n ins (outBinary "test/vc.binary")
| 244
| false
| true
| 0
| 12
| 77
| 89
| 40
| 49
| null | null |
frantisekfarka/ghc-dsi
|
compiler/main/DynFlags.hs
|
bsd-3-clause
|
updateWays :: DynFlags -> DynFlags
updateWays dflags
= let theWays = sort $ nub $ ways dflags
f = if WayDyn `elem` theWays then unSetGeneralFlag'
else setGeneralFlag'
in f Opt_Static
$ dflags {
ways = theWays,
buildTag = mkBuildTag (filter (not . wayRTSOnly) theWays),
rtsBuildTag = mkBuildTag theWays
}
| 454
|
updateWays :: DynFlags -> DynFlags
updateWays dflags
= let theWays = sort $ nub $ ways dflags
f = if WayDyn `elem` theWays then unSetGeneralFlag'
else setGeneralFlag'
in f Opt_Static
$ dflags {
ways = theWays,
buildTag = mkBuildTag (filter (not . wayRTSOnly) theWays),
rtsBuildTag = mkBuildTag theWays
}
| 454
|
updateWays dflags
= let theWays = sort $ nub $ ways dflags
f = if WayDyn `elem` theWays then unSetGeneralFlag'
else setGeneralFlag'
in f Opt_Static
$ dflags {
ways = theWays,
buildTag = mkBuildTag (filter (not . wayRTSOnly) theWays),
rtsBuildTag = mkBuildTag theWays
}
| 419
| false
| true
| 2
| 12
| 199
| 109
| 57
| 52
| null | null |
mrd/camfort
|
src/Camfort/Specification/Units/InferenceBackend.hs
|
apache-2.0
|
simplifyUnits :: UnitInfo -> UnitInfo
simplifyUnits = rewrite rw
where
rw (UnitMul (UnitMul u1 u2) u3) = Just $ UnitMul u1 (UnitMul u2 u3)
rw (UnitMul u1 u2) | u1 == u2 = Just $ UnitPow u1 2
rw (UnitPow (UnitPow u1 p1) p2) = Just $ UnitPow u1 (p1 * p2)
rw (UnitMul (UnitPow u1 p1) (UnitPow u2 p2)) | u1 == u2 = Just $ UnitPow u1 (p1 + p2)
rw (UnitPow _ p) | p `approxEq` 0 = Just UnitlessLit
rw (UnitMul UnitlessLit u) = Just u
rw (UnitMul u UnitlessLit) = Just u
rw _ = Nothing
| 725
|
simplifyUnits :: UnitInfo -> UnitInfo
simplifyUnits = rewrite rw
where
rw (UnitMul (UnitMul u1 u2) u3) = Just $ UnitMul u1 (UnitMul u2 u3)
rw (UnitMul u1 u2) | u1 == u2 = Just $ UnitPow u1 2
rw (UnitPow (UnitPow u1 p1) p2) = Just $ UnitPow u1 (p1 * p2)
rw (UnitMul (UnitPow u1 p1) (UnitPow u2 p2)) | u1 == u2 = Just $ UnitPow u1 (p1 + p2)
rw (UnitPow _ p) | p `approxEq` 0 = Just UnitlessLit
rw (UnitMul UnitlessLit u) = Just u
rw (UnitMul u UnitlessLit) = Just u
rw _ = Nothing
| 725
|
simplifyUnits = rewrite rw
where
rw (UnitMul (UnitMul u1 u2) u3) = Just $ UnitMul u1 (UnitMul u2 u3)
rw (UnitMul u1 u2) | u1 == u2 = Just $ UnitPow u1 2
rw (UnitPow (UnitPow u1 p1) p2) = Just $ UnitPow u1 (p1 * p2)
rw (UnitMul (UnitPow u1 p1) (UnitPow u2 p2)) | u1 == u2 = Just $ UnitPow u1 (p1 + p2)
rw (UnitPow _ p) | p `approxEq` 0 = Just UnitlessLit
rw (UnitMul UnitlessLit u) = Just u
rw (UnitMul u UnitlessLit) = Just u
rw _ = Nothing
| 687
| false
| true
| 0
| 9
| 347
| 287
| 132
| 155
| null | null |
mightymoose/liquidhaskell
|
benchmarks/text-0.11.2.3/Data/Text/Lazy/Builder/RealFloat/Functions.hs
|
bsd-3-clause
|
roundTo :: Int -> [Int] -> (Int,[Int])
roundTo d is =
case f d is of
x@(0,_) -> x
(1,xs) -> (1, 1:xs)
_ -> error "roundTo: bad Value"
where
f n [] = (0, replicate n 0)
f 0 (x:_) = (if x >= 5 then 1 else 0, [])
f n (i:xs)
| i' == 10 = (1,0:ds)
| otherwise = (0,i':ds)
where
(c,ds) = f (n-1) xs
i' = c + i
| 371
|
roundTo :: Int -> [Int] -> (Int,[Int])
roundTo d is =
case f d is of
x@(0,_) -> x
(1,xs) -> (1, 1:xs)
_ -> error "roundTo: bad Value"
where
f n [] = (0, replicate n 0)
f 0 (x:_) = (if x >= 5 then 1 else 0, [])
f n (i:xs)
| i' == 10 = (1,0:ds)
| otherwise = (0,i':ds)
where
(c,ds) = f (n-1) xs
i' = c + i
| 371
|
roundTo d is =
case f d is of
x@(0,_) -> x
(1,xs) -> (1, 1:xs)
_ -> error "roundTo: bad Value"
where
f n [] = (0, replicate n 0)
f 0 (x:_) = (if x >= 5 then 1 else 0, [])
f n (i:xs)
| i' == 10 = (1,0:ds)
| otherwise = (0,i':ds)
where
(c,ds) = f (n-1) xs
i' = c + i
| 332
| false
| true
| 3
| 10
| 142
| 260
| 133
| 127
| null | null |
ComputationWithBoundedResources/ara-inference
|
doc/tpdb_trs/Haskell/basic_haskell/show_2.hs
|
mit
|
showParen0 p MyTrue = pt (showChar (Char (Pos (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ Zero))))))))))))))))))))))))))))))))))))))))))) (pt p (showChar (Char (Pos (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ Zero)))))))))))))))))))))))))))))))))))))))))))))
| 656
|
showParen0 p MyTrue = pt (showChar (Char (Pos (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ Zero))))))))))))))))))))))))))))))))))))))))))) (pt p (showChar (Char (Pos (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ Zero)))))))))))))))))))))))))))))))))))))))))))))
| 656
|
showParen0 p MyTrue = pt (showChar (Char (Pos (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ Zero))))))))))))))))))))))))))))))))))))))))))) (pt p (showChar (Char (Pos (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ (Succ Zero)))))))))))))))))))))))))))))))))))))))))))))
| 656
| false
| false
| 1
| 95
| 95
| 551
| 272
| 279
| null | null |
arybczak/happstack-server
|
attic/Examples/AllIn.hs
|
bsd-3-clause
|
entryPoint :: Proxy State
entryPoint = Proxy
| 44
|
entryPoint :: Proxy State
entryPoint = Proxy
| 44
|
entryPoint = Proxy
| 18
| false
| true
| 0
| 5
| 6
| 14
| 7
| 7
| null | null |
alexvong1995/pandoc
|
src/Text/Pandoc/Parsing.hs
|
gpl-2.0
|
-- | Parse a string with a given parser and state
readWith :: Parser [Char] st a
-> st
-> String
-> Either PandocError a
readWith p t inp = runIdentity $ readWithM p t inp
| 198
|
readWith :: Parser [Char] st a
-> st
-> String
-> Either PandocError a
readWith p t inp = runIdentity $ readWithM p t inp
| 148
|
readWith p t inp = runIdentity $ readWithM p t inp
| 50
| true
| true
| 0
| 8
| 62
| 57
| 28
| 29
| null | null |
mxswd/rss-buffer
|
server.hs
|
bsd-3-clause
|
fmtHeader x = let txt = L.pack . strContent . fromJust . find (\(Element (QName x _ _) _ _ _) -> x == "title") . onlyElems . parseXML . T.unpack . L.decodeUtf8 $ x
in "# " <> txt <> "\n\n"
| 202
|
fmtHeader x = let txt = L.pack . strContent . fromJust . find (\(Element (QName x _ _) _ _ _) -> x == "title") . onlyElems . parseXML . T.unpack . L.decodeUtf8 $ x
in "# " <> txt <> "\n\n"
| 202
|
fmtHeader x = let txt = L.pack . strContent . fromJust . find (\(Element (QName x _ _) _ _ _) -> x == "title") . onlyElems . parseXML . T.unpack . L.decodeUtf8 $ x
in "# " <> txt <> "\n\n"
| 202
| false
| false
| 5
| 21
| 55
| 109
| 51
| 58
| null | null |
shinjiro-itagaki/shinjirecs
|
shinjirecs-api/src/Job.hs
|
gpl-3.0
|
setOptionToJob j (Priority v) = j { priority = v }
| 54
|
setOptionToJob j (Priority v) = j { priority = v }
| 54
|
setOptionToJob j (Priority v) = j { priority = v }
| 54
| false
| false
| 0
| 6
| 14
| 27
| 13
| 14
| null | null |
frantisekfarka/ghc-dsi
|
libraries/base/System/Posix/Internals.hs
|
bsd-3-clause
|
setNonBlockingFD fd set = do
flags <- throwErrnoIfMinus1Retry "setNonBlockingFD"
(c_fcntl_read fd const_f_getfl)
let flags' | set = flags .|. o_NONBLOCK
| otherwise = flags .&. complement o_NONBLOCK
unless (flags == flags') $ do
-- An error when setting O_NONBLOCK isn't fatal: on some systems
-- there are certain file handles on which this will fail (eg. /dev/null
-- on FreeBSD) so we throw away the return code from fcntl_write.
_ <- c_fcntl_write fd const_f_setfl (fromIntegral flags')
return ()
#else
-- bogus defns for win32
setNonBlockingFD _ _ = return ()
#endif
-- -----------------------------------------------------------------------------
-- Set close-on-exec for a file descriptor
#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
| 816
|
setNonBlockingFD fd set = do
flags <- throwErrnoIfMinus1Retry "setNonBlockingFD"
(c_fcntl_read fd const_f_getfl)
let flags' | set = flags .|. o_NONBLOCK
| otherwise = flags .&. complement o_NONBLOCK
unless (flags == flags') $ do
-- An error when setting O_NONBLOCK isn't fatal: on some systems
-- there are certain file handles on which this will fail (eg. /dev/null
-- on FreeBSD) so we throw away the return code from fcntl_write.
_ <- c_fcntl_write fd const_f_setfl (fromIntegral flags')
return ()
#else
-- bogus defns for win32
setNonBlockingFD _ _ = return ()
#endif
-- -----------------------------------------------------------------------------
-- Set close-on-exec for a file descriptor
#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
| 816
|
setNonBlockingFD fd set = do
flags <- throwErrnoIfMinus1Retry "setNonBlockingFD"
(c_fcntl_read fd const_f_getfl)
let flags' | set = flags .|. o_NONBLOCK
| otherwise = flags .&. complement o_NONBLOCK
unless (flags == flags') $ do
-- An error when setting O_NONBLOCK isn't fatal: on some systems
-- there are certain file handles on which this will fail (eg. /dev/null
-- on FreeBSD) so we throw away the return code from fcntl_write.
_ <- c_fcntl_write fd const_f_setfl (fromIntegral flags')
return ()
#else
-- bogus defns for win32
setNonBlockingFD _ _ = return ()
#endif
-- -----------------------------------------------------------------------------
-- Set close-on-exec for a file descriptor
#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
| 816
| false
| false
| 0
| 13
| 169
| 119
| 57
| 62
| null | null |
Verites/verigraph
|
src/library/GrLang/Monad.hs
|
apache-2.0
|
-- | Given the path to a module and an action that imports it, executes the
-- action unless the module was already imported. Makes the imported module
-- visible, as well as its transitive imports.
--
-- When running the import action, the only visible module will be the
-- one being imported.
importIfNeeded_ :: MonadGrLang m => FilePath -> ExceptT Error m a -> ExceptT Error m ()
importIfNeeded_ path action = void $ importIfNeeded path action
| 447
|
importIfNeeded_ :: MonadGrLang m => FilePath -> ExceptT Error m a -> ExceptT Error m ()
importIfNeeded_ path action = void $ importIfNeeded path action
| 151
|
importIfNeeded_ path action = void $ importIfNeeded path action
| 63
| true
| true
| 0
| 9
| 78
| 62
| 32
| 30
| null | null |
sjakobi/stack
|
src/Stack/Types/Package.hs
|
bsd-3-clause
|
-- | Maybe get the module name from the .cabal descriptor.
dotCabalModule :: DotCabalDescriptor -> Maybe ModuleName
dotCabalModule (DotCabalModule m) = Just m
| 158
|
dotCabalModule :: DotCabalDescriptor -> Maybe ModuleName
dotCabalModule (DotCabalModule m) = Just m
| 99
|
dotCabalModule (DotCabalModule m) = Just m
| 42
| true
| true
| 0
| 7
| 22
| 31
| 15
| 16
| null | null |
ryantm/ghc
|
compiler/nativeGen/X86/CodeGen.hs
|
bsd-3-clause
|
assignMem_I64Code :: CmmExpr -> CmmExpr -> NatM InstrBlock
assignMem_I64Code addrTree valueTree = do
Amode addr addr_code <- getAmode addrTree
ChildCode64 vcode rlo <- iselExpr64 valueTree
let
rhi = getHiVRegFromLo rlo
-- Little-endian store
mov_lo = MOV II32 (OpReg rlo) (OpAddr addr)
mov_hi = MOV II32 (OpReg rhi) (OpAddr (fromJust (addrOffset addr 4)))
return (vcode `appOL` addr_code `snocOL` mov_lo `snocOL` mov_hi)
| 461
|
assignMem_I64Code :: CmmExpr -> CmmExpr -> NatM InstrBlock
assignMem_I64Code addrTree valueTree = do
Amode addr addr_code <- getAmode addrTree
ChildCode64 vcode rlo <- iselExpr64 valueTree
let
rhi = getHiVRegFromLo rlo
-- Little-endian store
mov_lo = MOV II32 (OpReg rlo) (OpAddr addr)
mov_hi = MOV II32 (OpReg rhi) (OpAddr (fromJust (addrOffset addr 4)))
return (vcode `appOL` addr_code `snocOL` mov_lo `snocOL` mov_hi)
| 461
|
assignMem_I64Code addrTree valueTree = do
Amode addr addr_code <- getAmode addrTree
ChildCode64 vcode rlo <- iselExpr64 valueTree
let
rhi = getHiVRegFromLo rlo
-- Little-endian store
mov_lo = MOV II32 (OpReg rlo) (OpAddr addr)
mov_hi = MOV II32 (OpReg rhi) (OpAddr (fromJust (addrOffset addr 4)))
return (vcode `appOL` addr_code `snocOL` mov_lo `snocOL` mov_hi)
| 402
| false
| true
| 0
| 16
| 100
| 159
| 78
| 81
| null | null |
fpco/stackage-sandbox
|
main/Sandbox.hs
|
mit
|
sandboxInit :: Maybe Snapshot -> IO ()
sandboxInit msnapshot = do
cabalSandboxConfigExists <- doesFileExist "cabal.sandbox.config"
when cabalSandboxConfigExists $ do
throwIO ConfigAlreadyExists
verifyGhcCompat msnapshot
cabalConfigExists <- doesFileExist "cabal.config"
configAdded <- if (not cabalConfigExists)
then do
runStackagePlugin "init" (mSnapshotToArgs msnapshot)
return True
else
return False
configSnapshot <- parseConfigSnapshot
snapshot <- case msnapshot of
Just s | snapshotEq s configSnapshot -> return configSnapshot
Just s -> throwIO $ SnapshotMismatch s configSnapshot
Nothing -> return configSnapshot
-- TODO: MonadLogger
T.putStrLn $ "Initializing at snapshot: " <> snapshot
dir <- getSnapshotDir snapshot
createDirectoryIfMissing True dir
cabalSandboxInit dir
appendFileToFile "cabal.config" "cabal.sandbox.config"
when configAdded $ removeFile "cabal.config"
sandboxVerify
| 971
|
sandboxInit :: Maybe Snapshot -> IO ()
sandboxInit msnapshot = do
cabalSandboxConfigExists <- doesFileExist "cabal.sandbox.config"
when cabalSandboxConfigExists $ do
throwIO ConfigAlreadyExists
verifyGhcCompat msnapshot
cabalConfigExists <- doesFileExist "cabal.config"
configAdded <- if (not cabalConfigExists)
then do
runStackagePlugin "init" (mSnapshotToArgs msnapshot)
return True
else
return False
configSnapshot <- parseConfigSnapshot
snapshot <- case msnapshot of
Just s | snapshotEq s configSnapshot -> return configSnapshot
Just s -> throwIO $ SnapshotMismatch s configSnapshot
Nothing -> return configSnapshot
-- TODO: MonadLogger
T.putStrLn $ "Initializing at snapshot: " <> snapshot
dir <- getSnapshotDir snapshot
createDirectoryIfMissing True dir
cabalSandboxInit dir
appendFileToFile "cabal.config" "cabal.sandbox.config"
when configAdded $ removeFile "cabal.config"
sandboxVerify
| 971
|
sandboxInit msnapshot = do
cabalSandboxConfigExists <- doesFileExist "cabal.sandbox.config"
when cabalSandboxConfigExists $ do
throwIO ConfigAlreadyExists
verifyGhcCompat msnapshot
cabalConfigExists <- doesFileExist "cabal.config"
configAdded <- if (not cabalConfigExists)
then do
runStackagePlugin "init" (mSnapshotToArgs msnapshot)
return True
else
return False
configSnapshot <- parseConfigSnapshot
snapshot <- case msnapshot of
Just s | snapshotEq s configSnapshot -> return configSnapshot
Just s -> throwIO $ SnapshotMismatch s configSnapshot
Nothing -> return configSnapshot
-- TODO: MonadLogger
T.putStrLn $ "Initializing at snapshot: " <> snapshot
dir <- getSnapshotDir snapshot
createDirectoryIfMissing True dir
cabalSandboxInit dir
appendFileToFile "cabal.config" "cabal.sandbox.config"
when configAdded $ removeFile "cabal.config"
sandboxVerify
| 932
| false
| true
| 0
| 14
| 177
| 242
| 102
| 140
| null | null |
gcampax/ghc
|
compiler/coreSyn/CoreSyn.hs
|
bsd-3-clause
|
tickishCounts Breakpoint{} = True
| 33
|
tickishCounts Breakpoint{} = True
| 33
|
tickishCounts Breakpoint{} = True
| 33
| false
| false
| 0
| 6
| 3
| 13
| 6
| 7
| null | null |
leshchevds/ganeti
|
src/Ganeti/Runtime.hs
|
bsd-2-clause
|
daemonName GanetiConfd = "ganeti-confd"
| 41
|
daemonName GanetiConfd = "ganeti-confd"
| 41
|
daemonName GanetiConfd = "ganeti-confd"
| 41
| false
| false
| 0
| 5
| 5
| 9
| 4
| 5
| null | null |
nevrenato/HetsAlloy
|
Common/Id.hs
|
gpl-2.0
|
isSimpleId :: Id -> Bool
isSimpleId (Id ts cs _) = null cs && case ts of
[t] -> isSimpleToken t
_ -> False
| 114
|
isSimpleId :: Id -> Bool
isSimpleId (Id ts cs _) = null cs && case ts of
[t] -> isSimpleToken t
_ -> False
| 114
|
isSimpleId (Id ts cs _) = null cs && case ts of
[t] -> isSimpleToken t
_ -> False
| 89
| false
| true
| 3
| 7
| 31
| 57
| 28
| 29
| null | null |
ezyang/ghc
|
testsuite/tests/simplCore/should_run/T13429a.hs
|
bsd-3-clause
|
addDigits4 m1 (Three a b c) d e f g (Two h i) m2 =
appendTree3 m1 (node3 a b c) (node3 d e f) (node3 g h i) m2
| 114
|
addDigits4 m1 (Three a b c) d e f g (Two h i) m2 =
appendTree3 m1 (node3 a b c) (node3 d e f) (node3 g h i) m2
| 114
|
addDigits4 m1 (Three a b c) d e f g (Two h i) m2 =
appendTree3 m1 (node3 a b c) (node3 d e f) (node3 g h i) m2
| 114
| false
| false
| 1
| 7
| 33
| 89
| 40
| 49
| null | null |
cblp/tasknight-dashboard
|
build.hs
|
gpl-3.0
|
logSubprocess :: Command -> IO ()
logSubprocess = putStrLn . ("+ " <>) . showProc
where
showProc (Command prog args) = showCommandForUser prog args
| 153
|
logSubprocess :: Command -> IO ()
logSubprocess = putStrLn . ("+ " <>) . showProc
where
showProc (Command prog args) = showCommandForUser prog args
| 153
|
logSubprocess = putStrLn . ("+ " <>) . showProc
where
showProc (Command prog args) = showCommandForUser prog args
| 119
| false
| true
| 0
| 7
| 29
| 56
| 28
| 28
| null | null |
jtojnar/hulk
|
src/Hulk/Client.hs
|
bsd-3-clause
|
withValidChanName :: Text -> (ChannelName -> Hulk ())
-> Hulk ()
withValidChanName name m
| validChannel name = m $ ChannelName (mk name)
| otherwise = errorReply $ "Invalid channel name: " <> name
| 231
|
withValidChanName :: Text -> (ChannelName -> Hulk ())
-> Hulk ()
withValidChanName name m
| validChannel name = m $ ChannelName (mk name)
| otherwise = errorReply $ "Invalid channel name: " <> name
| 231
|
withValidChanName name m
| validChannel name = m $ ChannelName (mk name)
| otherwise = errorReply $ "Invalid channel name: " <> name
| 148
| false
| true
| 0
| 11
| 67
| 87
| 39
| 48
| null | null |
aurapm/haskell-versions
|
test/Test.hs
|
bsd-3-clause
|
chunksNE :: Gen (NEL.NonEmpty VChunk)
chunksNE = NEL.fromList <$> chunks
| 72
|
chunksNE :: Gen (NEL.NonEmpty VChunk)
chunksNE = NEL.fromList <$> chunks
| 72
|
chunksNE = NEL.fromList <$> chunks
| 34
| false
| true
| 1
| 8
| 9
| 32
| 14
| 18
| null | null |
johanneshilden/liquid-epsilon
|
Util/HTML/Elements.hs
|
bsd-3-clause
|
tr = makePar "tr"
| 25
|
tr = makePar "tr"
| 25
|
tr = makePar "tr"
| 25
| false
| false
| 0
| 5
| 11
| 9
| 4
| 5
| null | null |
mgiles/fit
|
src/Fit/Internal/Numbers.hs
|
bsd-3-clause
|
{-
Conversion helpers for re-interpreting bytes as floating-point numbers.
See this Stack Overflow post for details on word -> float conversion:
https://stackoverflow.com/questions/6976684/converting-ieee-754-floating-point-in-haskell-word32-64-to-and-from-haskell-float/7002812
-}
toFloat :: Word32 -> Float
toFloat word = unsafePerformIO $ F.alloca $ \buf -> do
F.poke (F.castPtr buf) word
F.peek buf
| 414
|
toFloat :: Word32 -> Float
toFloat word = unsafePerformIO $ F.alloca $ \buf -> do
F.poke (F.castPtr buf) word
F.peek buf
| 124
|
toFloat word = unsafePerformIO $ F.alloca $ \buf -> do
F.poke (F.castPtr buf) word
F.peek buf
| 97
| true
| true
| 0
| 13
| 55
| 66
| 30
| 36
| null | null |
yoo-e/yesod-helpers
|
Yesod/Helpers/Form2.hs
|
bsd-3-clause
|
fieldErrorsToJSON :: (SomeMessage master ->Text)
-> FieldErrors master
-> Value
fieldErrorsToJSON render_msg = object . map json_it . mapToList . unFieldErrors
where
json_it ((name, fs), v) = (name, object [ "fs" .= json_fs fs, "errs" .= toJSON (toList v) ])
json_fs (WrappedFieldSettings x) = object
[ "id" .= fsId x
, "label" .= render_msg (fsLabel x)
, "tooltip" .= fmap render_msg (fsTooltip x)
]
| 540
|
fieldErrorsToJSON :: (SomeMessage master ->Text)
-> FieldErrors master
-> Value
fieldErrorsToJSON render_msg = object . map json_it . mapToList . unFieldErrors
where
json_it ((name, fs), v) = (name, object [ "fs" .= json_fs fs, "errs" .= toJSON (toList v) ])
json_fs (WrappedFieldSettings x) = object
[ "id" .= fsId x
, "label" .= render_msg (fsLabel x)
, "tooltip" .= fmap render_msg (fsTooltip x)
]
| 540
|
fieldErrorsToJSON render_msg = object . map json_it . mapToList . unFieldErrors
where
json_it ((name, fs), v) = (name, object [ "fs" .= json_fs fs, "errs" .= toJSON (toList v) ])
json_fs (WrappedFieldSettings x) = object
[ "id" .= fsId x
, "label" .= render_msg (fsLabel x)
, "tooltip" .= fmap render_msg (fsTooltip x)
]
| 420
| false
| true
| 0
| 13
| 203
| 168
| 85
| 83
| null | null |
nick0x01/Win32-services
|
src/System/Win32/SystemServices/Services/SERVICE_CONTROL.hs
|
bsd-3-clause
|
pokeServiceControl :: Ptr DWORD -> SERVICE_CONTROL -> IO ()
pokeServiceControl ptr sc = poke ptr . toDWORD $ sc
| 111
|
pokeServiceControl :: Ptr DWORD -> SERVICE_CONTROL -> IO ()
pokeServiceControl ptr sc = poke ptr . toDWORD $ sc
| 111
|
pokeServiceControl ptr sc = poke ptr . toDWORD $ sc
| 51
| false
| true
| 0
| 8
| 18
| 43
| 20
| 23
| null | null |
lambdageek/insomnia
|
src/Insomnia/Typecheck/Expr.hs
|
bsd-3-clause
|
checkBinding :: Binding -> (Binding -> TC a) -> TC a
checkBinding (ValB (v, U.unembed -> ann) (U.unembed -> e)) kont =
case ann of
Annot Nothing -> do
(t, e') <- inferExpr e
-- XXX : TODO generalize uvars, or else freeze 'em if we're going to
-- behave like recent versions of GHC
extendLocalCtx v t $ do
tannot <- applyCurrentSubstitution t
kont $ ValB (v, U.embed $ Annot $ Just tannot) (U.embed e')
Annot (Just t) -> do
void $ checkType t KType
e' <- checkExpr e t
extendLocalCtx v t $ do
tannot <- applyCurrentSubstitution t
kont $ ValB (v, U.embed $ Annot $ Just tannot) (U.embed e')
| 672
|
checkBinding :: Binding -> (Binding -> TC a) -> TC a
checkBinding (ValB (v, U.unembed -> ann) (U.unembed -> e)) kont =
case ann of
Annot Nothing -> do
(t, e') <- inferExpr e
-- XXX : TODO generalize uvars, or else freeze 'em if we're going to
-- behave like recent versions of GHC
extendLocalCtx v t $ do
tannot <- applyCurrentSubstitution t
kont $ ValB (v, U.embed $ Annot $ Just tannot) (U.embed e')
Annot (Just t) -> do
void $ checkType t KType
e' <- checkExpr e t
extendLocalCtx v t $ do
tannot <- applyCurrentSubstitution t
kont $ ValB (v, U.embed $ Annot $ Just tannot) (U.embed e')
| 672
|
checkBinding (ValB (v, U.unembed -> ann) (U.unembed -> e)) kont =
case ann of
Annot Nothing -> do
(t, e') <- inferExpr e
-- XXX : TODO generalize uvars, or else freeze 'em if we're going to
-- behave like recent versions of GHC
extendLocalCtx v t $ do
tannot <- applyCurrentSubstitution t
kont $ ValB (v, U.embed $ Annot $ Just tannot) (U.embed e')
Annot (Just t) -> do
void $ checkType t KType
e' <- checkExpr e t
extendLocalCtx v t $ do
tannot <- applyCurrentSubstitution t
kont $ ValB (v, U.embed $ Annot $ Just tannot) (U.embed e')
| 619
| false
| true
| 0
| 18
| 195
| 258
| 123
| 135
| null | null |
tomjaguarpaw/postgresql-simple
|
src/Database/PostgreSQL/Simple/TypeInfo/Static.hs
|
bsd-3-clause
|
oidOid :: Oid
oidOid = Oid 26
| 29
|
oidOid :: Oid
oidOid = Oid 26
| 29
|
oidOid = Oid 26
| 15
| false
| true
| 0
| 5
| 6
| 14
| 7
| 7
| null | null |
nevrenato/HetsAlloy
|
CASL/Freeness.hs
|
gpl-2.0
|
free_formula (QuantOp on ot f) = QuantOp on' ot' f'
where on' = mkFreeName on
ot' = free_op_type ot
f' = free_formula f
| 146
|
free_formula (QuantOp on ot f) = QuantOp on' ot' f'
where on' = mkFreeName on
ot' = free_op_type ot
f' = free_formula f
| 146
|
free_formula (QuantOp on ot f) = QuantOp on' ot' f'
where on' = mkFreeName on
ot' = free_op_type ot
f' = free_formula f
| 146
| false
| false
| 2
| 6
| 49
| 59
| 25
| 34
| null | null |
svenssonjoel/ObsidianGFX
|
Examples/ReductionTutorial/Reduce.hs
|
bsd-3-clause
|
---------------------------------------------------------------------------
-- Kernel1 (Thread acceses element tid and tid+1
---------------------------------------------------------------------------
-- red1 :: Storable a
-- => (a -> a -> a)
-- -> SPull a
-- -> BProgram (SPush Block a)
-- red1 f arr
-- | len arr == 1 = return (push arr)
-- | otherwise =
-- do
-- let (a1,a2) = evenOdds arr
-- arr' <- forcePull (zipWith f a1 a2)
-- red1 f arr'
red1 :: Storable a
=> (a -> a -> a)
-> Pull Word32 a
-> Program Block a
red1 f arr
| len arr == 1 = return (arr ! 0)
| otherwise =
do
let (a1,a2) = evenOdds arr
imm <- forcePull (zipWith f a1 a2)
red1 f imm
| 760
|
red1 :: Storable a
=> (a -> a -> a)
-> Pull Word32 a
-> Program Block a
red1 f arr
| len arr == 1 = return (arr ! 0)
| otherwise =
do
let (a1,a2) = evenOdds arr
imm <- forcePull (zipWith f a1 a2)
red1 f imm
| 257
|
red1 f arr
| len arr == 1 = return (arr ! 0)
| otherwise =
do
let (a1,a2) = evenOdds arr
imm <- forcePull (zipWith f a1 a2)
red1 f imm
| 167
| true
| true
| 0
| 12
| 226
| 152
| 76
| 76
| null | null |
fugyk/cabal
|
Cabal/Distribution/Simple/GHC.hs
|
bsd-3-clause
|
-- -----------------------------------------------------------------------------
-- Configuring
configure :: Verbosity -> Maybe FilePath -> Maybe FilePath
-> ProgramConfiguration
-> IO (Compiler, Maybe Platform, ProgramConfiguration)
configure verbosity hcPath hcPkgPath conf0 = do
(ghcProg, ghcVersion, conf1) <-
requireProgramVersion verbosity ghcProgram
(orLaterVersion (Version [6,4] []))
(userMaybeSpecifyPath "ghc" hcPath conf0)
let implInfo = ghcVersionImplInfo ghcVersion
-- This is slightly tricky, we have to configure ghc first, then we use the
-- location of ghc to help find ghc-pkg in the case that the user did not
-- specify the location of ghc-pkg directly:
(ghcPkgProg, ghcPkgVersion, conf2) <-
requireProgramVersion verbosity ghcPkgProgram {
programFindLocation = guessGhcPkgFromGhcPath ghcProg
}
anyVersion (userMaybeSpecifyPath "ghc-pkg" hcPkgPath conf1)
when (ghcVersion /= ghcPkgVersion) $ die $
"Version mismatch between ghc and ghc-pkg: "
++ programPath ghcProg ++ " is version " ++ display ghcVersion ++ " "
++ programPath ghcPkgProg ++ " is version " ++ display ghcPkgVersion
-- Likewise we try to find the matching hsc2hs and haddock programs.
let hsc2hsProgram' = hsc2hsProgram {
programFindLocation = guessHsc2hsFromGhcPath ghcProg
}
haddockProgram' = haddockProgram {
programFindLocation = guessHaddockFromGhcPath ghcProg
}
conf3 = addKnownProgram haddockProgram' $
addKnownProgram hsc2hsProgram' conf2
languages <- Internal.getLanguages verbosity implInfo ghcProg
extensions <- Internal.getExtensions verbosity implInfo ghcProg
ghcInfo <- Internal.getGhcInfo verbosity implInfo ghcProg
let ghcInfoMap = M.fromList ghcInfo
let comp = Compiler {
compilerId = CompilerId GHC ghcVersion,
compilerAbiTag = NoAbiTag,
compilerCompat = [],
compilerLanguages = languages,
compilerExtensions = extensions,
compilerProperties = ghcInfoMap
}
compPlatform = Internal.targetPlatform ghcInfo
-- configure gcc and ld
conf4 = Internal.configureToolchain implInfo ghcProg ghcInfoMap conf3
return (comp, compPlatform, conf4)
-- | Given something like /usr/local/bin/ghc-6.6.1(.exe) we try and find
-- the corresponding tool; e.g. if the tool is ghc-pkg, we try looking
-- for a versioned or unversioned ghc-pkg in the same dir, that is:
--
-- > /usr/local/bin/ghc-pkg-ghc-6.6.1(.exe)
-- > /usr/local/bin/ghc-pkg-6.6.1(.exe)
-- > /usr/local/bin/ghc-pkg(.exe)
--
| 2,697
|
configure :: Verbosity -> Maybe FilePath -> Maybe FilePath
-> ProgramConfiguration
-> IO (Compiler, Maybe Platform, ProgramConfiguration)
configure verbosity hcPath hcPkgPath conf0 = do
(ghcProg, ghcVersion, conf1) <-
requireProgramVersion verbosity ghcProgram
(orLaterVersion (Version [6,4] []))
(userMaybeSpecifyPath "ghc" hcPath conf0)
let implInfo = ghcVersionImplInfo ghcVersion
-- This is slightly tricky, we have to configure ghc first, then we use the
-- location of ghc to help find ghc-pkg in the case that the user did not
-- specify the location of ghc-pkg directly:
(ghcPkgProg, ghcPkgVersion, conf2) <-
requireProgramVersion verbosity ghcPkgProgram {
programFindLocation = guessGhcPkgFromGhcPath ghcProg
}
anyVersion (userMaybeSpecifyPath "ghc-pkg" hcPkgPath conf1)
when (ghcVersion /= ghcPkgVersion) $ die $
"Version mismatch between ghc and ghc-pkg: "
++ programPath ghcProg ++ " is version " ++ display ghcVersion ++ " "
++ programPath ghcPkgProg ++ " is version " ++ display ghcPkgVersion
-- Likewise we try to find the matching hsc2hs and haddock programs.
let hsc2hsProgram' = hsc2hsProgram {
programFindLocation = guessHsc2hsFromGhcPath ghcProg
}
haddockProgram' = haddockProgram {
programFindLocation = guessHaddockFromGhcPath ghcProg
}
conf3 = addKnownProgram haddockProgram' $
addKnownProgram hsc2hsProgram' conf2
languages <- Internal.getLanguages verbosity implInfo ghcProg
extensions <- Internal.getExtensions verbosity implInfo ghcProg
ghcInfo <- Internal.getGhcInfo verbosity implInfo ghcProg
let ghcInfoMap = M.fromList ghcInfo
let comp = Compiler {
compilerId = CompilerId GHC ghcVersion,
compilerAbiTag = NoAbiTag,
compilerCompat = [],
compilerLanguages = languages,
compilerExtensions = extensions,
compilerProperties = ghcInfoMap
}
compPlatform = Internal.targetPlatform ghcInfo
-- configure gcc and ld
conf4 = Internal.configureToolchain implInfo ghcProg ghcInfoMap conf3
return (comp, compPlatform, conf4)
-- | Given something like /usr/local/bin/ghc-6.6.1(.exe) we try and find
-- the corresponding tool; e.g. if the tool is ghc-pkg, we try looking
-- for a versioned or unversioned ghc-pkg in the same dir, that is:
--
-- > /usr/local/bin/ghc-pkg-ghc-6.6.1(.exe)
-- > /usr/local/bin/ghc-pkg-6.6.1(.exe)
-- > /usr/local/bin/ghc-pkg(.exe)
--
| 2,600
|
configure verbosity hcPath hcPkgPath conf0 = do
(ghcProg, ghcVersion, conf1) <-
requireProgramVersion verbosity ghcProgram
(orLaterVersion (Version [6,4] []))
(userMaybeSpecifyPath "ghc" hcPath conf0)
let implInfo = ghcVersionImplInfo ghcVersion
-- This is slightly tricky, we have to configure ghc first, then we use the
-- location of ghc to help find ghc-pkg in the case that the user did not
-- specify the location of ghc-pkg directly:
(ghcPkgProg, ghcPkgVersion, conf2) <-
requireProgramVersion verbosity ghcPkgProgram {
programFindLocation = guessGhcPkgFromGhcPath ghcProg
}
anyVersion (userMaybeSpecifyPath "ghc-pkg" hcPkgPath conf1)
when (ghcVersion /= ghcPkgVersion) $ die $
"Version mismatch between ghc and ghc-pkg: "
++ programPath ghcProg ++ " is version " ++ display ghcVersion ++ " "
++ programPath ghcPkgProg ++ " is version " ++ display ghcPkgVersion
-- Likewise we try to find the matching hsc2hs and haddock programs.
let hsc2hsProgram' = hsc2hsProgram {
programFindLocation = guessHsc2hsFromGhcPath ghcProg
}
haddockProgram' = haddockProgram {
programFindLocation = guessHaddockFromGhcPath ghcProg
}
conf3 = addKnownProgram haddockProgram' $
addKnownProgram hsc2hsProgram' conf2
languages <- Internal.getLanguages verbosity implInfo ghcProg
extensions <- Internal.getExtensions verbosity implInfo ghcProg
ghcInfo <- Internal.getGhcInfo verbosity implInfo ghcProg
let ghcInfoMap = M.fromList ghcInfo
let comp = Compiler {
compilerId = CompilerId GHC ghcVersion,
compilerAbiTag = NoAbiTag,
compilerCompat = [],
compilerLanguages = languages,
compilerExtensions = extensions,
compilerProperties = ghcInfoMap
}
compPlatform = Internal.targetPlatform ghcInfo
-- configure gcc and ld
conf4 = Internal.configureToolchain implInfo ghcProg ghcInfoMap conf3
return (comp, compPlatform, conf4)
-- | Given something like /usr/local/bin/ghc-6.6.1(.exe) we try and find
-- the corresponding tool; e.g. if the tool is ghc-pkg, we try looking
-- for a versioned or unversioned ghc-pkg in the same dir, that is:
--
-- > /usr/local/bin/ghc-pkg-ghc-6.6.1(.exe)
-- > /usr/local/bin/ghc-pkg-6.6.1(.exe)
-- > /usr/local/bin/ghc-pkg(.exe)
--
| 2,442
| true
| true
| 0
| 18
| 621
| 458
| 237
| 221
| null | null |
emhoracek/smooch
|
app/src/ParseCNF.hs
|
gpl-3.0
|
parseCNFComment :: Parser CNFLine
parseCNFComment = do
char ';'
comment <- many (noneOf "\n")
return $ CNFComment comment
| 133
|
parseCNFComment :: Parser CNFLine
parseCNFComment = do
char ';'
comment <- many (noneOf "\n")
return $ CNFComment comment
| 133
|
parseCNFComment = do
char ';'
comment <- many (noneOf "\n")
return $ CNFComment comment
| 99
| false
| true
| 0
| 10
| 29
| 46
| 20
| 26
| null | null |
wellposed/hblas
|
tests/HBLAS/BLAS/Level2Spec.hs
|
bsd-3-clause
|
matvecTest1CHPR2 :: IO ()
matvecTest1CHPR2 = do
a <- Matrix.generateMutableDenseVector 10 (\_ -> 0.0:+0.0)
x <- Matrix.generateMutableDenseVector 4 (\idx -> [1.0:+1.0, 1.0:+1.0, 1.0:+1.0, 1.0:+1.0] !! idx)
y <- Matrix.generateMutableDenseVector 4 (\idx -> [1.0:+2.0, 1.0:+2.0, 1.0:+2.0, 1.0:+2.0] !! idx)
BLAS.chpr2 Matrix.SColumn Matrix.MatUpper 4 2.0 x y a
resList <- Matrix.mutableVectorToList $ _bufferMutDenseVector a
resList `shouldBe` [12.0:+0.0, 12.0:+0.0, 12.0:+0.0, 12.0:+0.0, 12.0:+0.0, 12.0:+0.0, 12.0:+0.0, 12.0:+0.0, 12.0:+0.0, 12.0:+0.0]
| 564
|
matvecTest1CHPR2 :: IO ()
matvecTest1CHPR2 = do
a <- Matrix.generateMutableDenseVector 10 (\_ -> 0.0:+0.0)
x <- Matrix.generateMutableDenseVector 4 (\idx -> [1.0:+1.0, 1.0:+1.0, 1.0:+1.0, 1.0:+1.0] !! idx)
y <- Matrix.generateMutableDenseVector 4 (\idx -> [1.0:+2.0, 1.0:+2.0, 1.0:+2.0, 1.0:+2.0] !! idx)
BLAS.chpr2 Matrix.SColumn Matrix.MatUpper 4 2.0 x y a
resList <- Matrix.mutableVectorToList $ _bufferMutDenseVector a
resList `shouldBe` [12.0:+0.0, 12.0:+0.0, 12.0:+0.0, 12.0:+0.0, 12.0:+0.0, 12.0:+0.0, 12.0:+0.0, 12.0:+0.0, 12.0:+0.0, 12.0:+0.0]
| 564
|
matvecTest1CHPR2 = do
a <- Matrix.generateMutableDenseVector 10 (\_ -> 0.0:+0.0)
x <- Matrix.generateMutableDenseVector 4 (\idx -> [1.0:+1.0, 1.0:+1.0, 1.0:+1.0, 1.0:+1.0] !! idx)
y <- Matrix.generateMutableDenseVector 4 (\idx -> [1.0:+2.0, 1.0:+2.0, 1.0:+2.0, 1.0:+2.0] !! idx)
BLAS.chpr2 Matrix.SColumn Matrix.MatUpper 4 2.0 x y a
resList <- Matrix.mutableVectorToList $ _bufferMutDenseVector a
resList `shouldBe` [12.0:+0.0, 12.0:+0.0, 12.0:+0.0, 12.0:+0.0, 12.0:+0.0, 12.0:+0.0, 12.0:+0.0, 12.0:+0.0, 12.0:+0.0, 12.0:+0.0]
| 538
| false
| true
| 0
| 13
| 75
| 269
| 142
| 127
| null | null |
mcschroeder/ghc
|
compiler/types/Type.hs
|
bsd-3-clause
|
tyConAppTyConPicky_maybe _ = Nothing
| 56
|
tyConAppTyConPicky_maybe _ = Nothing
| 56
|
tyConAppTyConPicky_maybe _ = Nothing
| 56
| false
| false
| 0
| 5
| 23
| 9
| 4
| 5
| null | null |
jstolarek/haddock
|
haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
|
bsd-2-clause
|
ppFunLhType unicode qual ty = ppr_mono_ty pREC_FUN ty unicode qual
| 67
|
ppFunLhType unicode qual ty = ppr_mono_ty pREC_FUN ty unicode qual
| 67
|
ppFunLhType unicode qual ty = ppr_mono_ty pREC_FUN ty unicode qual
| 67
| false
| false
| 0
| 5
| 10
| 24
| 10
| 14
| null | null |
massysett/penny
|
penny/lib/Penny/Copper/PriceParts.hs
|
bsd-3-clause
|
-- | Fails if the from and to commodities are the same.
pricePartsToPrice :: PriceParts a -> Maybe (P.Price a)
pricePartsToPrice (PriceParts pos ti fr to exch)
= fmap f $ P.makeFromTo fr to
where
f frTo = P.Price ti frTo exch pos
| 237
|
pricePartsToPrice :: PriceParts a -> Maybe (P.Price a)
pricePartsToPrice (PriceParts pos ti fr to exch)
= fmap f $ P.makeFromTo fr to
where
f frTo = P.Price ti frTo exch pos
| 181
|
pricePartsToPrice (PriceParts pos ti fr to exch)
= fmap f $ P.makeFromTo fr to
where
f frTo = P.Price ti frTo exch pos
| 126
| true
| true
| 3
| 9
| 50
| 87
| 39
| 48
| null | null |
mapinguari/SC_HS_Proxy
|
src/Proxy/Query/Tech.hs
|
mit
|
mineralsCost Infestation = 0
| 28
|
mineralsCost Infestation = 0
| 28
|
mineralsCost Infestation = 0
| 28
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
ntindall/KVStore
|
src/Lib.hs
|
bsd-3-clause
|
printUsage :: IO ()
printUsage = putStr $ usageInfo "KVStore" options
| 69
|
printUsage :: IO ()
printUsage = putStr $ usageInfo "KVStore" options
| 69
|
printUsage = putStr $ usageInfo "KVStore" options
| 49
| false
| true
| 0
| 6
| 10
| 25
| 12
| 13
| null | null |
ra1u/HaskellPitaya
|
src/System/RedPitaya/Fpga.hs
|
lgpl-3.0
|
- | start writing data into memory (ARM trigger).
triggerNow :: FpgaSetGet a => a ()
triggerNow = fpgaWriteOsc 0 1
| 115
|
triggerNow :: FpgaSetGet a => a ()
triggerNow = fpgaWriteOsc 0 1
| 64
|
triggerNow = fpgaWriteOsc 0 1
| 29
| true
| true
| 2
| 11
| 21
| 55
| 25
| 30
| null | null |
kim/amazonka
|
amazonka-s3/gen/Network/AWS/S3/RestoreObject.hs
|
mpl-2.0
|
roKey :: Lens' RestoreObject Text
roKey = lens _roKey (\s a -> s { _roKey = a })
| 80
|
roKey :: Lens' RestoreObject Text
roKey = lens _roKey (\s a -> s { _roKey = a })
| 80
|
roKey = lens _roKey (\s a -> s { _roKey = a })
| 46
| false
| true
| 1
| 9
| 17
| 44
| 21
| 23
| null | null |
hverr/lxdfile
|
src/System/LXD/LXDFile/ScriptAction.hs
|
gpl-3.0
|
runScriptAction :: (MonadIO m, MonadError String m, MonadReader Container m) => FilePath -> ScriptAction -> m ()
runScriptAction _ (SRun ctx cmd) = do
echo $ "RUN " <> showL cmd
script <- makeScript
lxcExec ["mkdir", "-p", "/var/run/lxdfile"]
lxcFilePush "0700" script "/var/run/lxdfile/setup"
rm (decodeString script)
lxcExec ["/bin/sh", "/var/run/lxdfile/setup"]
lxcExec ["rm", "-rf", "/var/run/lxdfile"]
where
makeScript = do
fp <- tmpfile "lxdfile-setup.sh"
let cmds' = [ "#!/bin/sh"
, "set -e"
] ++ currentDirectorySh ctx
++ environmentSh ctx ++ [
"set -x"
] ++ argumentsSh cmd
output (decodeString fp) $ select cmds'
return fp
| 802
|
runScriptAction :: (MonadIO m, MonadError String m, MonadReader Container m) => FilePath -> ScriptAction -> m ()
runScriptAction _ (SRun ctx cmd) = do
echo $ "RUN " <> showL cmd
script <- makeScript
lxcExec ["mkdir", "-p", "/var/run/lxdfile"]
lxcFilePush "0700" script "/var/run/lxdfile/setup"
rm (decodeString script)
lxcExec ["/bin/sh", "/var/run/lxdfile/setup"]
lxcExec ["rm", "-rf", "/var/run/lxdfile"]
where
makeScript = do
fp <- tmpfile "lxdfile-setup.sh"
let cmds' = [ "#!/bin/sh"
, "set -e"
] ++ currentDirectorySh ctx
++ environmentSh ctx ++ [
"set -x"
] ++ argumentsSh cmd
output (decodeString fp) $ select cmds'
return fp
| 802
|
runScriptAction _ (SRun ctx cmd) = do
echo $ "RUN " <> showL cmd
script <- makeScript
lxcExec ["mkdir", "-p", "/var/run/lxdfile"]
lxcFilePush "0700" script "/var/run/lxdfile/setup"
rm (decodeString script)
lxcExec ["/bin/sh", "/var/run/lxdfile/setup"]
lxcExec ["rm", "-rf", "/var/run/lxdfile"]
where
makeScript = do
fp <- tmpfile "lxdfile-setup.sh"
let cmds' = [ "#!/bin/sh"
, "set -e"
] ++ currentDirectorySh ctx
++ environmentSh ctx ++ [
"set -x"
] ++ argumentsSh cmd
output (decodeString fp) $ select cmds'
return fp
| 689
| false
| true
| 0
| 14
| 260
| 233
| 110
| 123
| null | null |
ivanmurashko/tests
|
hs/elliptic/test/elliptic.hs
|
mit
|
testScalarMul :: Assertion
testScalarMul = map (\n -> n .*. Point 3 6 c) [0..5] @?= res where
c = Curve 2 3 97
res = [PointZero,
Point 3 6 c, Point 80 10 c,
Point 80 87 c, Point 3 91 c,
PointZero]
| 239
|
testScalarMul :: Assertion
testScalarMul = map (\n -> n .*. Point 3 6 c) [0..5] @?= res where
c = Curve 2 3 97
res = [PointZero,
Point 3 6 c, Point 80 10 c,
Point 80 87 c, Point 3 91 c,
PointZero]
| 239
|
testScalarMul = map (\n -> n .*. Point 3 6 c) [0..5] @?= res where
c = Curve 2 3 97
res = [PointZero,
Point 3 6 c, Point 80 10 c,
Point 80 87 c, Point 3 91 c,
PointZero]
| 212
| false
| true
| 0
| 10
| 86
| 116
| 58
| 58
| null | null |
m3mitsuppe/haskell
|
exercises/Programming Haskell Book Exercises.hsproj/Ch_09_enum.hs
|
unlicense
|
eftInt :: Int -> Int -> [Int]
eftInt s e
| s > e = []
| s == e = [e]
| otherwise = s : eftInt (succ s) e
| 122
|
eftInt :: Int -> Int -> [Int]
eftInt s e
| s > e = []
| s == e = [e]
| otherwise = s : eftInt (succ s) e
| 122
|
eftInt s e
| s > e = []
| s == e = [e]
| otherwise = s : eftInt (succ s) e
| 92
| false
| true
| 0
| 9
| 48
| 79
| 38
| 41
| null | null |
chrisjpn/CPIB_ILMCompiler
|
src/Parser.hs
|
bsd-3-clause
|
parseLt = parseString "<" Lt
| 28
|
parseLt = parseString "<" Lt
| 28
|
parseLt = parseString "<" Lt
| 28
| false
| false
| 0
| 5
| 4
| 11
| 5
| 6
| null | null |
matthewSorensen/weft
|
Robotics/Thingomatic/Commands.hs
|
gpl-3.0
|
setMilimeters = emit "G21"
| 29
|
setMilimeters = emit "G21"
| 29
|
setMilimeters = emit "G21"
| 29
| false
| false
| 1
| 5
| 6
| 12
| 4
| 8
| null | null |
Wollw/VideoCore-Haskell
|
src/VideoCore/EGL.hs
|
mit
|
createWindowSurface :: EGLC.Display -> EGLC.Config -> EGLCP.DispmanxWindow -> [EGLC.EGLint] -> IO EGLC.Surface
createWindowSurface d cfg w attrs =
with w $ \windowP -> do
r <- case null attrs of
True -> EGLC.createWindowSurface d cfg windowP nullPtr
False -> withArray attrs $ \attrsP ->
EGLC.createWindowSurface d cfg windowP attrsP
return r
| 402
|
createWindowSurface :: EGLC.Display -> EGLC.Config -> EGLCP.DispmanxWindow -> [EGLC.EGLint] -> IO EGLC.Surface
createWindowSurface d cfg w attrs =
with w $ \windowP -> do
r <- case null attrs of
True -> EGLC.createWindowSurface d cfg windowP nullPtr
False -> withArray attrs $ \attrsP ->
EGLC.createWindowSurface d cfg windowP attrsP
return r
| 402
|
createWindowSurface d cfg w attrs =
with w $ \windowP -> do
r <- case null attrs of
True -> EGLC.createWindowSurface d cfg windowP nullPtr
False -> withArray attrs $ \attrsP ->
EGLC.createWindowSurface d cfg windowP attrsP
return r
| 291
| false
| true
| 2
| 16
| 110
| 136
| 63
| 73
| null | null |
Valiev/contests
|
darkus/201509/Ant.hs
|
mit
|
-- Other
change_price _ _ _ _ = 100
| 35
|
change_price _ _ _ _ = 100
| 26
|
change_price _ _ _ _ = 100
| 26
| true
| false
| 1
| 5
| 8
| 16
| 7
| 9
| null | null |
alistra/data-structure-inferrer
|
Advice.hs
|
mit
|
printAdvice :: (String -> IO ()) -> [OperationName] -> IO ()
printAdvice output = printAdvice' output 1
| 103
|
printAdvice :: (String -> IO ()) -> [OperationName] -> IO ()
printAdvice output = printAdvice' output 1
| 103
|
printAdvice output = printAdvice' output 1
| 42
| false
| true
| 0
| 9
| 16
| 47
| 23
| 24
| null | null |
pcapriotti/dbus-qq
|
tests/Tests.hs
|
bsd-3-clause
|
prop_spaces x y = show (x + y) == [dbus| ii-> s |] f x y
where
f :: [Variant] -> [Variant]
f xs = [toVariant . show . sum $ (map (fromJust . fromVariant) xs :: [Int32])]
| 190
|
prop_spaces x y = show (x + y) == [dbus| ii-> s |] f x y
where
f :: [Variant] -> [Variant]
f xs = [toVariant . show . sum $ (map (fromJust . fromVariant) xs :: [Int32])]
| 190
|
prop_spaces x y = show (x + y) == [dbus| ii-> s |] f x y
where
f :: [Variant] -> [Variant]
f xs = [toVariant . show . sum $ (map (fromJust . fromVariant) xs :: [Int32])]
| 190
| false
| false
| 2
| 11
| 58
| 99
| 53
| 46
| null | null |
zlizta/PiSigma
|
src/Language/PiSigma/Normalise.hs
|
bsd-3-clause
|
qq xs (Lift l t,s) = liftM (Lift l) (qq xs (t,s))
| 49
|
qq xs (Lift l t,s) = liftM (Lift l) (qq xs (t,s))
| 49
|
qq xs (Lift l t,s) = liftM (Lift l) (qq xs (t,s))
| 49
| false
| false
| 0
| 8
| 11
| 48
| 24
| 24
| null | null |
randen/cabal
|
Cabal/Distribution/ParseUtils.hs
|
bsd-3-clause
|
parseHaskellString :: ReadP r String
parseHaskellString = readS_to_P reads
| 74
|
parseHaskellString :: ReadP r String
parseHaskellString = readS_to_P reads
| 74
|
parseHaskellString = readS_to_P reads
| 37
| false
| true
| 0
| 6
| 8
| 24
| 10
| 14
| null | null |
oldmanmike/ghc
|
compiler/typecheck/TcGenDeriv.hs
|
bsd-3-clause
|
geWord_RDR = varQual_RDR gHC_PRIM (fsLit "geWord#")
| 56
|
geWord_RDR = varQual_RDR gHC_PRIM (fsLit "geWord#")
| 56
|
geWord_RDR = varQual_RDR gHC_PRIM (fsLit "geWord#")
| 56
| false
| false
| 0
| 7
| 10
| 17
| 8
| 9
| null | null |
mboes/dedukti
|
Dedukti/Core.hs
|
gpl-3.0
|
annot (V _ a) = a
| 19
|
annot (V _ a) = a
| 19
|
annot (V _ a) = a
| 19
| false
| false
| 0
| 7
| 7
| 17
| 8
| 9
| null | null |
rueshyna/gogol
|
gogol-maps-engine/gen/Network/Google/Resource/MapsEngine/Layers/List.hs
|
mpl-2.0
|
-- | Creates a value of 'LayersList' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'llCreatedAfter'
--
-- * 'llCreatorEmail'
--
-- * 'llRole'
--
-- * 'llBbox'
--
-- * 'llProcessingStatus'
--
-- * 'llModifiedAfter'
--
-- * 'llModifiedBefore'
--
-- * 'llPageToken'
--
-- * 'llProjectId'
--
-- * 'llSearch'
--
-- * 'llMaxResults'
--
-- * 'llTags'
--
-- * 'llCreatedBefore'
layersList
:: LayersList
layersList =
LayersList'
{ _llCreatedAfter = Nothing
, _llCreatorEmail = Nothing
, _llRole = Nothing
, _llBbox = Nothing
, _llProcessingStatus = Nothing
, _llModifiedAfter = Nothing
, _llModifiedBefore = Nothing
, _llPageToken = Nothing
, _llProjectId = Nothing
, _llSearch = Nothing
, _llMaxResults = Nothing
, _llTags = Nothing
, _llCreatedBefore = Nothing
}
| 906
|
layersList
:: LayersList
layersList =
LayersList'
{ _llCreatedAfter = Nothing
, _llCreatorEmail = Nothing
, _llRole = Nothing
, _llBbox = Nothing
, _llProcessingStatus = Nothing
, _llModifiedAfter = Nothing
, _llModifiedBefore = Nothing
, _llPageToken = Nothing
, _llProjectId = Nothing
, _llSearch = Nothing
, _llMaxResults = Nothing
, _llTags = Nothing
, _llCreatedBefore = Nothing
}
| 449
|
layersList =
LayersList'
{ _llCreatedAfter = Nothing
, _llCreatorEmail = Nothing
, _llRole = Nothing
, _llBbox = Nothing
, _llProcessingStatus = Nothing
, _llModifiedAfter = Nothing
, _llModifiedBefore = Nothing
, _llPageToken = Nothing
, _llProjectId = Nothing
, _llSearch = Nothing
, _llMaxResults = Nothing
, _llTags = Nothing
, _llCreatedBefore = Nothing
}
| 420
| true
| true
| 1
| 7
| 204
| 127
| 89
| 38
| null | null |
UBMLtonGroup/timberc
|
src/Core.hs
|
bsd-3-clause
|
rhoToType (R t) = return t
| 50
|
rhoToType (R t) = return t
| 50
|
rhoToType (R t) = return t
| 50
| false
| false
| 0
| 6
| 29
| 19
| 8
| 11
| null | null |
ekmett/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
|
lgpl-2.1
|
wxLIST_STATE_DROPHILITED :: Int
wxLIST_STATE_DROPHILITED = 1
| 60
|
wxLIST_STATE_DROPHILITED :: Int
wxLIST_STATE_DROPHILITED = 1
| 60
|
wxLIST_STATE_DROPHILITED = 1
| 28
| false
| true
| 0
| 6
| 5
| 18
| 7
| 11
| null | null |
noraesae/euler
|
src/Problem18.hs
|
bsd-3-clause
|
getVal :: Int -> Int -> Maybe Int
getVal rowNum colNum =
case maybeRow of
(Just row) ->
let cols = splitOn " " row
in
if (colNum >= (length cols))
then Nothing
else (Just $ (read $ cols !! colNum :: Int))
(Nothing) -> Nothing
where maybeRow = getRow rowNum
| 308
|
getVal :: Int -> Int -> Maybe Int
getVal rowNum colNum =
case maybeRow of
(Just row) ->
let cols = splitOn " " row
in
if (colNum >= (length cols))
then Nothing
else (Just $ (read $ cols !! colNum :: Int))
(Nothing) -> Nothing
where maybeRow = getRow rowNum
| 308
|
getVal rowNum colNum =
case maybeRow of
(Just row) ->
let cols = splitOn " " row
in
if (colNum >= (length cols))
then Nothing
else (Just $ (read $ cols !! colNum :: Int))
(Nothing) -> Nothing
where maybeRow = getRow rowNum
| 274
| false
| true
| 0
| 15
| 102
| 121
| 62
| 59
| null | null |
rueshyna/gogol
|
gogol-maps-engine/gen/Network/Google/Resource/MapsEngine/Layers/UnPublish.hs
|
mpl-2.0
|
-- | Creates a value of 'LayersUnPublish' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'lupId'
layersUnPublish
:: Text -- ^ 'lupId'
-> LayersUnPublish
layersUnPublish pLupId_ =
LayersUnPublish'
{ _lupId = pLupId_
}
| 322
|
layersUnPublish
:: Text -- ^ 'lupId'
-> LayersUnPublish
layersUnPublish pLupId_ =
LayersUnPublish'
{ _lupId = pLupId_
}
| 139
|
layersUnPublish pLupId_ =
LayersUnPublish'
{ _lupId = pLupId_
}
| 75
| true
| true
| 0
| 7
| 70
| 41
| 22
| 19
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.