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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
alanz/Blobs
|
src/Graphics/Blobs/State.hs
|
lgpl-2.1
|
setDisplayOptions :: DisplayOptions.DisplayOptions -> State g n e -> IO ()
setDisplayOptions dp stateRef =
varUpdate_ stateRef (\state -> state { stDisplayOptions = dp })
| 174
|
setDisplayOptions :: DisplayOptions.DisplayOptions -> State g n e -> IO ()
setDisplayOptions dp stateRef =
varUpdate_ stateRef (\state -> state { stDisplayOptions = dp })
| 174
|
setDisplayOptions dp stateRef =
varUpdate_ stateRef (\state -> state { stDisplayOptions = dp })
| 99
| false
| true
| 0
| 9
| 28
| 59
| 30
| 29
| null | null |
nevrenato/Hets_Fork
|
CSL/GeneralExtendedParameter.hs
|
gpl-2.0
|
compareEP _ _ = error "GeneralExtendedParameter: TODO"
| 54
|
compareEP _ _ = error "GeneralExtendedParameter: TODO"
| 54
|
compareEP _ _ = error "GeneralExtendedParameter: TODO"
| 54
| false
| false
| 1
| 5
| 6
| 15
| 6
| 9
| null | null |
rvion/lamdu
|
test/InferAssert.hs
|
gpl-3.0
|
canonizedExprTest :: ExprComplete -> ExprTest
canonizedExprTest =
canonize etpExpectedType . canonize etpInferredType . fmap exprTestPayload
where
canonize t expr =
expr
& Lens.traversed . t %%~ canonizeType
& runCanonizer
| 274
|
canonizedExprTest :: ExprComplete -> ExprTest
canonizedExprTest =
canonize etpExpectedType . canonize etpInferredType . fmap exprTestPayload
where
canonize t expr =
expr
& Lens.traversed . t %%~ canonizeType
& runCanonizer
| 274
|
canonizedExprTest =
canonize etpExpectedType . canonize etpInferredType . fmap exprTestPayload
where
canonize t expr =
expr
& Lens.traversed . t %%~ canonizeType
& runCanonizer
| 228
| false
| true
| 0
| 9
| 80
| 62
| 30
| 32
| null | null |
guoguo12/haskell-ptable
|
ptable.hs
|
apache-2.0
|
name "Fr" = "Francium"
| 22
|
name "Fr" = "Francium"
| 22
|
name "Fr" = "Francium"
| 22
| false
| false
| 0
| 4
| 3
| 10
| 4
| 6
| null | null |
MichielDerhaeg/stack
|
src/Stack/Docker.hs
|
bsd-3-clause
|
execWithOptionalContainer
:: HasConfig env
=> Maybe (Path Abs Dir)
-> GetCmdArgs env
-> Maybe (RIO env ())
-> IO ()
-> Maybe (RIO env ())
-> Maybe (RIO env ())
-> RIO env ()
execWithOptionalContainer mprojectRoot getCmdArgs mbefore inner mafter mrelease =
do config <- view configL
inContainer <- getInContainer
isReExec <- view reExecL
if | inContainer && not isReExec && (isJust mbefore || isJust mafter) ->
throwIO OnlyOnHostException
| inContainer ->
liftIO (do inner
exitSuccess)
| not (dockerEnable (configDocker config)) ->
do fromMaybeAction mbefore
liftIO inner
fromMaybeAction mafter
liftIO exitSuccess
| otherwise ->
do fromMaybeAction mrelease
runContainerAndExit
getCmdArgs
mprojectRoot
(fromMaybeAction mbefore)
(fromMaybeAction mafter)
where
fromMaybeAction Nothing = return ()
fromMaybeAction (Just hook) = hook
-- | Error if running in a container.
| 1,148
|
execWithOptionalContainer
:: HasConfig env
=> Maybe (Path Abs Dir)
-> GetCmdArgs env
-> Maybe (RIO env ())
-> IO ()
-> Maybe (RIO env ())
-> Maybe (RIO env ())
-> RIO env ()
execWithOptionalContainer mprojectRoot getCmdArgs mbefore inner mafter mrelease =
do config <- view configL
inContainer <- getInContainer
isReExec <- view reExecL
if | inContainer && not isReExec && (isJust mbefore || isJust mafter) ->
throwIO OnlyOnHostException
| inContainer ->
liftIO (do inner
exitSuccess)
| not (dockerEnable (configDocker config)) ->
do fromMaybeAction mbefore
liftIO inner
fromMaybeAction mafter
liftIO exitSuccess
| otherwise ->
do fromMaybeAction mrelease
runContainerAndExit
getCmdArgs
mprojectRoot
(fromMaybeAction mbefore)
(fromMaybeAction mafter)
where
fromMaybeAction Nothing = return ()
fromMaybeAction (Just hook) = hook
-- | Error if running in a container.
| 1,148
|
execWithOptionalContainer mprojectRoot getCmdArgs mbefore inner mafter mrelease =
do config <- view configL
inContainer <- getInContainer
isReExec <- view reExecL
if | inContainer && not isReExec && (isJust mbefore || isJust mafter) ->
throwIO OnlyOnHostException
| inContainer ->
liftIO (do inner
exitSuccess)
| not (dockerEnable (configDocker config)) ->
do fromMaybeAction mbefore
liftIO inner
fromMaybeAction mafter
liftIO exitSuccess
| otherwise ->
do fromMaybeAction mrelease
runContainerAndExit
getCmdArgs
mprojectRoot
(fromMaybeAction mbefore)
(fromMaybeAction mafter)
where
fromMaybeAction Nothing = return ()
fromMaybeAction (Just hook) = hook
-- | Error if running in a container.
| 942
| false
| true
| 0
| 16
| 405
| 332
| 145
| 187
| null | null |
Gabriel439/Haskell-Errors-Library
|
Control/Error/Util.hs
|
bsd-3-clause
|
-- | Convert a 'Maybe' value into the 'ExceptT' monad
(??) :: Applicative m => Maybe a -> e -> ExceptT e m a
(??) a e = ExceptT (pure $ note e a)
| 145
|
(??) :: Applicative m => Maybe a -> e -> ExceptT e m a
(??) a e = ExceptT (pure $ note e a)
| 91
|
(??) a e = ExceptT (pure $ note e a)
| 36
| true
| true
| 0
| 8
| 33
| 61
| 31
| 30
| null | null |
glguy/advent2015
|
Day6.hs
|
isc
|
forRange :: Applicative m => Point -> Point -> (Point -> m a) -> m ()
forRange (xlo,ylo) (xhi,yhi) k =
for_ [xlo..xhi] $ \x ->
for_ [ylo..yhi] $ \y ->
k (x,y)
| 164
|
forRange :: Applicative m => Point -> Point -> (Point -> m a) -> m ()
forRange (xlo,ylo) (xhi,yhi) k =
for_ [xlo..xhi] $ \x ->
for_ [ylo..yhi] $ \y ->
k (x,y)
| 164
|
forRange (xlo,ylo) (xhi,yhi) k =
for_ [xlo..xhi] $ \x ->
for_ [ylo..yhi] $ \y ->
k (x,y)
| 94
| false
| true
| 0
| 11
| 38
| 107
| 56
| 51
| null | null |
rueshyna/gogol
|
gogol-android-publisher/gen/Network/Google/AndroidPublisher/Types/Product.hs
|
mpl-2.0
|
-- | Full description of the app; this may be up to 4000 characters in
-- length.
lFullDescription :: Lens' Listing (Maybe Text)
lFullDescription
= lens _lFullDescription
(\ s a -> s{_lFullDescription = a})
| 214
|
lFullDescription :: Lens' Listing (Maybe Text)
lFullDescription
= lens _lFullDescription
(\ s a -> s{_lFullDescription = a})
| 132
|
lFullDescription
= lens _lFullDescription
(\ s a -> s{_lFullDescription = a})
| 85
| true
| true
| 0
| 9
| 41
| 49
| 26
| 23
| null | null |
maximilianhuber/mySortMaildir
|
src/MySortMaildir/Helpers.hs
|
bsd-3-clause
|
-- apply rules only to current mails
onlyCur :: Rule -> Rule
onlyCur r = r { rule = \ m -> not (isNew m) && rule r m}
| 117
|
onlyCur :: Rule -> Rule
onlyCur r = r { rule = \ m -> not (isNew m) && rule r m}
| 80
|
onlyCur r = r { rule = \ m -> not (isNew m) && rule r m}
| 56
| true
| true
| 0
| 12
| 28
| 56
| 27
| 29
| null | null |
bergey/gooey
|
TodoMVC/src/Main.hs
|
bsd-3-clause
|
animate :: VMount -> Chan Action -> MVar State -> IO ()
animate m q sVar = do
s <- readMVar sVar
p <- diff m (render (writeChan q) s)
void $ inAnimationFrame ContinueAsync $ patch m p >> animate m q sVar
| 209
|
animate :: VMount -> Chan Action -> MVar State -> IO ()
animate m q sVar = do
s <- readMVar sVar
p <- diff m (render (writeChan q) s)
void $ inAnimationFrame ContinueAsync $ patch m p >> animate m q sVar
| 209
|
animate m q sVar = do
s <- readMVar sVar
p <- diff m (render (writeChan q) s)
void $ inAnimationFrame ContinueAsync $ patch m p >> animate m q sVar
| 153
| false
| true
| 0
| 13
| 48
| 112
| 49
| 63
| null | null |
elordin/haskell-tetris
|
font.hs
|
mit
|
letterPath 'y' = [ (0 , 1 , 0) , (0.33, 1 , 0) , (0.33, 0.5 , 0)
, (0.5 , 0.75, 0) , (0.67, 0.5 , 0) , (0.67, 1 , 0)
, (1 , 1 , 0) , (0 , 0 , 0) , (0.33, 0 , 0) ]
| 214
|
letterPath 'y' = [ (0 , 1 , 0) , (0.33, 1 , 0) , (0.33, 0.5 , 0)
, (0.5 , 0.75, 0) , (0.67, 0.5 , 0) , (0.67, 1 , 0)
, (1 , 1 , 0) , (0 , 0 , 0) , (0.33, 0 , 0) ]
| 214
|
letterPath 'y' = [ (0 , 1 , 0) , (0.33, 1 , 0) , (0.33, 0.5 , 0)
, (0.5 , 0.75, 0) , (0.67, 0.5 , 0) , (0.67, 1 , 0)
, (1 , 1 , 0) , (0 , 0 , 0) , (0.33, 0 , 0) ]
| 214
| false
| false
| 1
| 6
| 103
| 120
| 76
| 44
| null | null |
dalaing/type-systems
|
src/Fragment/Ast2.hs
|
bsd-3-clause
|
astToPattern :: (Bitransversable ty, Bitransversable pt, Bitransversable (tm ty pt)) => Ast ty pt tm a -> Maybe (Pattern pt a)
astToPattern (Ast (APattern pt)) = fmap Pattern . bitransverse (\f p -> (>>= astToPattern) $ traverse f p) pure $ pt
| 243
|
astToPattern :: (Bitransversable ty, Bitransversable pt, Bitransversable (tm ty pt)) => Ast ty pt tm a -> Maybe (Pattern pt a)
astToPattern (Ast (APattern pt)) = fmap Pattern . bitransverse (\f p -> (>>= astToPattern) $ traverse f p) pure $ pt
| 243
|
astToPattern (Ast (APattern pt)) = fmap Pattern . bitransverse (\f p -> (>>= astToPattern) $ traverse f p) pure $ pt
| 116
| false
| true
| 0
| 11
| 41
| 122
| 60
| 62
| null | null |
jcristovao/units-attoparsec
|
Data/Units/SI/Prefixes/Attoparsec/Text.hs
|
bsd-3-clause
|
microP :: Parser Micro
microP = (char 'μ' <|> char 'u') >> return Micro
| 71
|
microP :: Parser Micro
microP = (char 'μ' <|> char 'u') >> return Micro
| 71
|
microP = (char 'μ' <|> char 'u') >> return Micro
| 48
| false
| true
| 0
| 8
| 13
| 39
| 17
| 22
| null | null |
rsasse/tamarin-prover
|
lib/theory/src/Theory/Constraint/Solver/Reduction.hs
|
gpl-3.0
|
insertChain :: NodeConc -> NodePrem -> Reduction ()
insertChain c p = insertGoal (ChainG c p) False
| 99
|
insertChain :: NodeConc -> NodePrem -> Reduction ()
insertChain c p = insertGoal (ChainG c p) False
| 99
|
insertChain c p = insertGoal (ChainG c p) False
| 47
| false
| true
| 0
| 8
| 16
| 42
| 20
| 22
| null | null |
bitemyapp/blpapi-hs
|
src/Finance/Blpapi/Session.hs
|
mit
|
getHandlerForCid :: CorrelationId -> Blpapi (Maybe MessageHandler)
getHandlerForCid cid = do
st <- bget
hm <- liftIO $ readTVarIO (_blpapiCorrelationHandlerMap st)
return $ Map.lookup cid (_cidMap hm)
| 206
|
getHandlerForCid :: CorrelationId -> Blpapi (Maybe MessageHandler)
getHandlerForCid cid = do
st <- bget
hm <- liftIO $ readTVarIO (_blpapiCorrelationHandlerMap st)
return $ Map.lookup cid (_cidMap hm)
| 206
|
getHandlerForCid cid = do
st <- bget
hm <- liftIO $ readTVarIO (_blpapiCorrelationHandlerMap st)
return $ Map.lookup cid (_cidMap hm)
| 139
| false
| true
| 0
| 11
| 32
| 74
| 34
| 40
| null | null |
vTurbine/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
sourceNoUnpackDataConKey = mkPreludeDataConUnique 60
| 67
|
sourceNoUnpackDataConKey = mkPreludeDataConUnique 60
| 67
|
sourceNoUnpackDataConKey = mkPreludeDataConUnique 60
| 67
| false
| false
| 0
| 5
| 18
| 9
| 4
| 5
| null | null |
fmapfmapfmap/amazonka
|
core/test/Test/AWS/Data/Time.hs
|
mpl-2.0
|
tests :: TestTree
tests = testGroup "time"
[ testGroup "text"
[ testGroup "deserialise"
[ testFromText "rfc822"
"Fri, 07 Nov 2014 04:42:13 GMT" (time :: RFC822)
, testFromText "iso8601"
"2014-11-07T04:42:13.000Z" (time :: ISO8601)
, testFromText "aws"
"20141107T044213Z" (time :: AWSTime)
, testGroup "posix"
[ testFromText "integer"
"1415335333" (time :: POSIX)
, testFromText "double"
"1415335333.000" (time :: POSIX)
, testFromText "scientific"
"1.415335333E9" (time :: POSIX)
]
]
, testGroup "serialise"
[ testToText "rfc822"
"Fri, 07 Nov 2014 04:42:13 GMT" (time :: RFC822)
, testToText "iso8601"
"2014-11-07T04:42:13UTC" (time :: ISO8601)
, testToText "aws"
"20141107T044213Z" (time :: AWSTime)
, testToText "posix"
"1415335333" (time :: POSIX)
]
]
, testGroup "query"
[ testGroup "serialise"
[ testToQuery "rfc822"
"x=Fri%2C%2007%20Nov%202014%2004%3A42%3A13%20GMT" (time :: RFC822)
, testToQuery "iso8601"
"x=2014-11-07T04%3A42%3A13UTC" (time :: ISO8601)
, testToQuery "aws"
"x=20141107T044213Z" (time :: AWSTime)
]
]
, testGroup "xml"
[ testGroup "deserialise"
[ testFromXML "rfc822"
"Fri, 07 Nov 2014 04:42:13 GMT" (time :: RFC822)
, testFromXML "iso8601"
"2014-11-07T04:42:13.000Z" (time :: ISO8601)
, testFromXML "aws"
"20141107T044213Z" (time :: AWSTime)
, testGroup "posix"
[ testFromXML "integer"
"1415335333" (time :: POSIX)
, testFromXML "double"
"1415335333.000" (time :: POSIX)
, testFromXML "scientific"
"1.415335333E9" (time :: POSIX)
]
]
, testGroup "serialise"
[ testToXML "rfc822"
"Fri, 07 Nov 2014 04:42:13 GMT" (time :: RFC822)
, testToXML "iso8601"
"2014-11-07T04:42:13UTC" (time :: ISO8601)
, testToXML "aws"
"20141107T044213Z" (time :: AWSTime)
, testToXML "posix"
"1415335333" (time :: POSIX)
]
]
, testGroup "json"
[ testGroup "deserialise"
[ testFromJSON "rfc822"
(str "Fri, 07 Nov 2014 04:42:13 GMT") (time :: RFC822)
, testFromJSON "iso8601"
(str "2014-11-07T04:42:13.000Z") (time :: ISO8601)
, testFromJSON "aws"
(str "20141107T044213Z") (time :: AWSTime)
, testGroup "posix"
[ testFromJSON "integer"
"1415335333" (time :: POSIX)
, testFromJSON "double"
"1415335333.000" (time :: POSIX)
, testFromJSON "scientific"
"1.415335333E9" (time :: POSIX)
]
]
, testGroup "serialise"
[ testToJSON "rfc822"
(str "Fri, 07 Nov 2014 04:42:13 GMT") (time :: RFC822)
, testToJSON "iso8601"
(str "2014-11-07T04:42:13UTC") (time :: ISO8601)
, testToJSON "aws"
(str "20141107T044213Z") (time :: AWSTime)
, testToJSON "posix"
"1415335333" (time :: POSIX)
]
]
]
| 3,779
|
tests :: TestTree
tests = testGroup "time"
[ testGroup "text"
[ testGroup "deserialise"
[ testFromText "rfc822"
"Fri, 07 Nov 2014 04:42:13 GMT" (time :: RFC822)
, testFromText "iso8601"
"2014-11-07T04:42:13.000Z" (time :: ISO8601)
, testFromText "aws"
"20141107T044213Z" (time :: AWSTime)
, testGroup "posix"
[ testFromText "integer"
"1415335333" (time :: POSIX)
, testFromText "double"
"1415335333.000" (time :: POSIX)
, testFromText "scientific"
"1.415335333E9" (time :: POSIX)
]
]
, testGroup "serialise"
[ testToText "rfc822"
"Fri, 07 Nov 2014 04:42:13 GMT" (time :: RFC822)
, testToText "iso8601"
"2014-11-07T04:42:13UTC" (time :: ISO8601)
, testToText "aws"
"20141107T044213Z" (time :: AWSTime)
, testToText "posix"
"1415335333" (time :: POSIX)
]
]
, testGroup "query"
[ testGroup "serialise"
[ testToQuery "rfc822"
"x=Fri%2C%2007%20Nov%202014%2004%3A42%3A13%20GMT" (time :: RFC822)
, testToQuery "iso8601"
"x=2014-11-07T04%3A42%3A13UTC" (time :: ISO8601)
, testToQuery "aws"
"x=20141107T044213Z" (time :: AWSTime)
]
]
, testGroup "xml"
[ testGroup "deserialise"
[ testFromXML "rfc822"
"Fri, 07 Nov 2014 04:42:13 GMT" (time :: RFC822)
, testFromXML "iso8601"
"2014-11-07T04:42:13.000Z" (time :: ISO8601)
, testFromXML "aws"
"20141107T044213Z" (time :: AWSTime)
, testGroup "posix"
[ testFromXML "integer"
"1415335333" (time :: POSIX)
, testFromXML "double"
"1415335333.000" (time :: POSIX)
, testFromXML "scientific"
"1.415335333E9" (time :: POSIX)
]
]
, testGroup "serialise"
[ testToXML "rfc822"
"Fri, 07 Nov 2014 04:42:13 GMT" (time :: RFC822)
, testToXML "iso8601"
"2014-11-07T04:42:13UTC" (time :: ISO8601)
, testToXML "aws"
"20141107T044213Z" (time :: AWSTime)
, testToXML "posix"
"1415335333" (time :: POSIX)
]
]
, testGroup "json"
[ testGroup "deserialise"
[ testFromJSON "rfc822"
(str "Fri, 07 Nov 2014 04:42:13 GMT") (time :: RFC822)
, testFromJSON "iso8601"
(str "2014-11-07T04:42:13.000Z") (time :: ISO8601)
, testFromJSON "aws"
(str "20141107T044213Z") (time :: AWSTime)
, testGroup "posix"
[ testFromJSON "integer"
"1415335333" (time :: POSIX)
, testFromJSON "double"
"1415335333.000" (time :: POSIX)
, testFromJSON "scientific"
"1.415335333E9" (time :: POSIX)
]
]
, testGroup "serialise"
[ testToJSON "rfc822"
(str "Fri, 07 Nov 2014 04:42:13 GMT") (time :: RFC822)
, testToJSON "iso8601"
(str "2014-11-07T04:42:13UTC") (time :: ISO8601)
, testToJSON "aws"
(str "20141107T044213Z") (time :: AWSTime)
, testToJSON "posix"
"1415335333" (time :: POSIX)
]
]
]
| 3,779
|
tests = testGroup "time"
[ testGroup "text"
[ testGroup "deserialise"
[ testFromText "rfc822"
"Fri, 07 Nov 2014 04:42:13 GMT" (time :: RFC822)
, testFromText "iso8601"
"2014-11-07T04:42:13.000Z" (time :: ISO8601)
, testFromText "aws"
"20141107T044213Z" (time :: AWSTime)
, testGroup "posix"
[ testFromText "integer"
"1415335333" (time :: POSIX)
, testFromText "double"
"1415335333.000" (time :: POSIX)
, testFromText "scientific"
"1.415335333E9" (time :: POSIX)
]
]
, testGroup "serialise"
[ testToText "rfc822"
"Fri, 07 Nov 2014 04:42:13 GMT" (time :: RFC822)
, testToText "iso8601"
"2014-11-07T04:42:13UTC" (time :: ISO8601)
, testToText "aws"
"20141107T044213Z" (time :: AWSTime)
, testToText "posix"
"1415335333" (time :: POSIX)
]
]
, testGroup "query"
[ testGroup "serialise"
[ testToQuery "rfc822"
"x=Fri%2C%2007%20Nov%202014%2004%3A42%3A13%20GMT" (time :: RFC822)
, testToQuery "iso8601"
"x=2014-11-07T04%3A42%3A13UTC" (time :: ISO8601)
, testToQuery "aws"
"x=20141107T044213Z" (time :: AWSTime)
]
]
, testGroup "xml"
[ testGroup "deserialise"
[ testFromXML "rfc822"
"Fri, 07 Nov 2014 04:42:13 GMT" (time :: RFC822)
, testFromXML "iso8601"
"2014-11-07T04:42:13.000Z" (time :: ISO8601)
, testFromXML "aws"
"20141107T044213Z" (time :: AWSTime)
, testGroup "posix"
[ testFromXML "integer"
"1415335333" (time :: POSIX)
, testFromXML "double"
"1415335333.000" (time :: POSIX)
, testFromXML "scientific"
"1.415335333E9" (time :: POSIX)
]
]
, testGroup "serialise"
[ testToXML "rfc822"
"Fri, 07 Nov 2014 04:42:13 GMT" (time :: RFC822)
, testToXML "iso8601"
"2014-11-07T04:42:13UTC" (time :: ISO8601)
, testToXML "aws"
"20141107T044213Z" (time :: AWSTime)
, testToXML "posix"
"1415335333" (time :: POSIX)
]
]
, testGroup "json"
[ testGroup "deserialise"
[ testFromJSON "rfc822"
(str "Fri, 07 Nov 2014 04:42:13 GMT") (time :: RFC822)
, testFromJSON "iso8601"
(str "2014-11-07T04:42:13.000Z") (time :: ISO8601)
, testFromJSON "aws"
(str "20141107T044213Z") (time :: AWSTime)
, testGroup "posix"
[ testFromJSON "integer"
"1415335333" (time :: POSIX)
, testFromJSON "double"
"1415335333.000" (time :: POSIX)
, testFromJSON "scientific"
"1.415335333E9" (time :: POSIX)
]
]
, testGroup "serialise"
[ testToJSON "rfc822"
(str "Fri, 07 Nov 2014 04:42:13 GMT") (time :: RFC822)
, testToJSON "iso8601"
(str "2014-11-07T04:42:13UTC") (time :: ISO8601)
, testToJSON "aws"
(str "20141107T044213Z") (time :: AWSTime)
, testToJSON "posix"
"1415335333" (time :: POSIX)
]
]
]
| 3,761
| false
| true
| 0
| 14
| 1,634
| 692
| 379
| 313
| null | null |
jozefg/hi
|
src/Validate.hs
|
mit
|
declV :: Decl -> Validate (S.Decl SrcLoc)
declV = \case
TypeDecl _ n vars t ->
S.DType <$> nameV n
<*> mapM (fmap (, Nothing) . tvarV) vars
<*> tyV t
DataDecl _ _ [] n vars cons [] ->
S.DData <$> nameV n
<*> mapM (fmap (, Nothing) . tvarV) vars
<*> mapM conV cons
ClassDecl _ cxt n [a] [] cls ->
S.DClass <$> cxtV cxt <*> nameV n <*> tvarV a <*> mapM classV cls
InstDecl _ Nothing [] cxt (UnQual n) [t] inst ->
S.DInst <$> cxtV cxt <*> nameV n <*> tyV t <*> mapM instV inst
InfixDecl _ _ _ [VarOp n] -> S.DAssoc <$> nameV n
InfixDecl _ _ _ [ConOp n] -> S.DAssoc <$> nameV n
TypeSig _ ns t -> S.DSig <$> sigV ns t
FunBind ms -> S.DFun <$> funV ms
PatBind _ pat (UnGuardedRhs e) (BDecls decs) -> S.DTop <$> patbV pat e decs
_ -> notSup "Fancy declaration"
| 837
|
declV :: Decl -> Validate (S.Decl SrcLoc)
declV = \case
TypeDecl _ n vars t ->
S.DType <$> nameV n
<*> mapM (fmap (, Nothing) . tvarV) vars
<*> tyV t
DataDecl _ _ [] n vars cons [] ->
S.DData <$> nameV n
<*> mapM (fmap (, Nothing) . tvarV) vars
<*> mapM conV cons
ClassDecl _ cxt n [a] [] cls ->
S.DClass <$> cxtV cxt <*> nameV n <*> tvarV a <*> mapM classV cls
InstDecl _ Nothing [] cxt (UnQual n) [t] inst ->
S.DInst <$> cxtV cxt <*> nameV n <*> tyV t <*> mapM instV inst
InfixDecl _ _ _ [VarOp n] -> S.DAssoc <$> nameV n
InfixDecl _ _ _ [ConOp n] -> S.DAssoc <$> nameV n
TypeSig _ ns t -> S.DSig <$> sigV ns t
FunBind ms -> S.DFun <$> funV ms
PatBind _ pat (UnGuardedRhs e) (BDecls decs) -> S.DTop <$> patbV pat e decs
_ -> notSup "Fancy declaration"
| 837
|
declV = \case
TypeDecl _ n vars t ->
S.DType <$> nameV n
<*> mapM (fmap (, Nothing) . tvarV) vars
<*> tyV t
DataDecl _ _ [] n vars cons [] ->
S.DData <$> nameV n
<*> mapM (fmap (, Nothing) . tvarV) vars
<*> mapM conV cons
ClassDecl _ cxt n [a] [] cls ->
S.DClass <$> cxtV cxt <*> nameV n <*> tvarV a <*> mapM classV cls
InstDecl _ Nothing [] cxt (UnQual n) [t] inst ->
S.DInst <$> cxtV cxt <*> nameV n <*> tyV t <*> mapM instV inst
InfixDecl _ _ _ [VarOp n] -> S.DAssoc <$> nameV n
InfixDecl _ _ _ [ConOp n] -> S.DAssoc <$> nameV n
TypeSig _ ns t -> S.DSig <$> sigV ns t
FunBind ms -> S.DFun <$> funV ms
PatBind _ pat (UnGuardedRhs e) (BDecls decs) -> S.DTop <$> patbV pat e decs
_ -> notSup "Fancy declaration"
| 795
| false
| true
| 0
| 15
| 243
| 425
| 199
| 226
| null | null |
Lifelovinglight/randomTools
|
arpSniffer.hs
|
gpl-3.0
|
main :: IO ()
main = catch (void (getArgs >>= help program)) exceptionHandler
where help :: (String -> IO ()) -> [String] -> IO ()
help _ [] = putStrLn "Usage: arpSniffer <device>"
help fn (arg:_) = fn arg
-- | Main exception handler.
| 253
|
main :: IO ()
main = catch (void (getArgs >>= help program)) exceptionHandler
where help :: (String -> IO ()) -> [String] -> IO ()
help _ [] = putStrLn "Usage: arpSniffer <device>"
help fn (arg:_) = fn arg
-- | Main exception handler.
| 253
|
main = catch (void (getArgs >>= help program)) exceptionHandler
where help :: (String -> IO ()) -> [String] -> IO ()
help _ [] = putStrLn "Usage: arpSniffer <device>"
help fn (arg:_) = fn arg
-- | Main exception handler.
| 239
| false
| true
| 4
| 10
| 62
| 107
| 54
| 53
| null | null |
ublubu/streamstats
|
src/Streaming.hs
|
mit
|
columnFolder :: ColumnType -> ColumnAccum -> Maybe StringOrDouble -> Maybe ColumnAccum
columnFolder colType accum (Just val) = columnFolder colType accum val
| 157
|
columnFolder :: ColumnType -> ColumnAccum -> Maybe StringOrDouble -> Maybe ColumnAccum
columnFolder colType accum (Just val) = columnFolder colType accum val
| 157
|
columnFolder colType accum (Just val) = columnFolder colType accum val
| 70
| false
| true
| 0
| 8
| 20
| 49
| 23
| 26
| null | null |
spechub/Hets
|
GUI/HTkUtils.hs
|
gpl-2.0
|
enableWids :: [EnableWid] -> IO ()
enableWids = mapM_ $ \ ew -> case ew of
EnW w -> enable w >> return ()
| 109
|
enableWids :: [EnableWid] -> IO ()
enableWids = mapM_ $ \ ew -> case ew of
EnW w -> enable w >> return ()
| 109
|
enableWids = mapM_ $ \ ew -> case ew of
EnW w -> enable w >> return ()
| 74
| false
| true
| 0
| 12
| 27
| 57
| 28
| 29
| null | null |
smurphy8/tach
|
core-types/tach-migration-routes/src/Tach/Migration/Routes.hs
|
mit
|
postQueryTimeSeriesR :: Handler Value
postQueryTimeSeriesR = do
eQuery <- resultToEither <$> parseJsonBody :: Handler (Either String TimeSeriesQuery) -- Get the post body
master <- getYesod
case eQuery of
Left err -> sendResponseStatus status501 $ toJSON err
Right (TimeSeriesQuery key start end period delta) -> do
master <- getYesod
let acidCell = (migrationRoutesAcidCell master)
eDKey = DK.decodeKey (C.pack key) :: (Either String (DK.DirectedKeyRaw KeyPid KeySource KeyDestination KeyTime))
eState <- T.sequence $ (\key -> liftIO $ attemptLookupInsert acidCell key (stateMap master)) <$> eDKey
let ePidkey = unKeyPid . DK.getSimpleKey <$> eDKey
eRes <- T.sequence $ (\state pidKey key ->
query' state (GetTVSimpleImpulseMany (ImpulseKey key) (ImpulseStart start) (ImpulseEnd end))) <$>
eState <*> ePidkey <*> eDKey
case eRes of
Left s -> sendResponseStatus status501 $ toJSON . show $ s
Right (Left e) -> sendResponseStatus status501 $ toJSON . show $ e
Right (Right res) -> do
let listRes = S.toList res
if (not . Prelude.null $ listRes)
then
sendResponseStatus status201 $ toJSON $ listRes
else
sendResponseStatus status201 $ toJSON $ Prelude.foldl (foldPeriod period delta) ([Prelude.head listRes], (Prelude.head listRes) ) (Prelude.tail listRes)
where foldPeriod period delta (list, lastItem) currItem =
if ((timeDiff >= (period - delta)) && (timeDiff <= (period + delta)))
then (list++[currItem],currItem)
else (list,lastItem)
where timeDiff = (tvNkSimpleTime currItem - tvNkSimpleTime lastItem)
| 1,831
|
postQueryTimeSeriesR :: Handler Value
postQueryTimeSeriesR = do
eQuery <- resultToEither <$> parseJsonBody :: Handler (Either String TimeSeriesQuery) -- Get the post body
master <- getYesod
case eQuery of
Left err -> sendResponseStatus status501 $ toJSON err
Right (TimeSeriesQuery key start end period delta) -> do
master <- getYesod
let acidCell = (migrationRoutesAcidCell master)
eDKey = DK.decodeKey (C.pack key) :: (Either String (DK.DirectedKeyRaw KeyPid KeySource KeyDestination KeyTime))
eState <- T.sequence $ (\key -> liftIO $ attemptLookupInsert acidCell key (stateMap master)) <$> eDKey
let ePidkey = unKeyPid . DK.getSimpleKey <$> eDKey
eRes <- T.sequence $ (\state pidKey key ->
query' state (GetTVSimpleImpulseMany (ImpulseKey key) (ImpulseStart start) (ImpulseEnd end))) <$>
eState <*> ePidkey <*> eDKey
case eRes of
Left s -> sendResponseStatus status501 $ toJSON . show $ s
Right (Left e) -> sendResponseStatus status501 $ toJSON . show $ e
Right (Right res) -> do
let listRes = S.toList res
if (not . Prelude.null $ listRes)
then
sendResponseStatus status201 $ toJSON $ listRes
else
sendResponseStatus status201 $ toJSON $ Prelude.foldl (foldPeriod period delta) ([Prelude.head listRes], (Prelude.head listRes) ) (Prelude.tail listRes)
where foldPeriod period delta (list, lastItem) currItem =
if ((timeDiff >= (period - delta)) && (timeDiff <= (period + delta)))
then (list++[currItem],currItem)
else (list,lastItem)
where timeDiff = (tvNkSimpleTime currItem - tvNkSimpleTime lastItem)
| 1,831
|
postQueryTimeSeriesR = do
eQuery <- resultToEither <$> parseJsonBody :: Handler (Either String TimeSeriesQuery) -- Get the post body
master <- getYesod
case eQuery of
Left err -> sendResponseStatus status501 $ toJSON err
Right (TimeSeriesQuery key start end period delta) -> do
master <- getYesod
let acidCell = (migrationRoutesAcidCell master)
eDKey = DK.decodeKey (C.pack key) :: (Either String (DK.DirectedKeyRaw KeyPid KeySource KeyDestination KeyTime))
eState <- T.sequence $ (\key -> liftIO $ attemptLookupInsert acidCell key (stateMap master)) <$> eDKey
let ePidkey = unKeyPid . DK.getSimpleKey <$> eDKey
eRes <- T.sequence $ (\state pidKey key ->
query' state (GetTVSimpleImpulseMany (ImpulseKey key) (ImpulseStart start) (ImpulseEnd end))) <$>
eState <*> ePidkey <*> eDKey
case eRes of
Left s -> sendResponseStatus status501 $ toJSON . show $ s
Right (Left e) -> sendResponseStatus status501 $ toJSON . show $ e
Right (Right res) -> do
let listRes = S.toList res
if (not . Prelude.null $ listRes)
then
sendResponseStatus status201 $ toJSON $ listRes
else
sendResponseStatus status201 $ toJSON $ Prelude.foldl (foldPeriod period delta) ([Prelude.head listRes], (Prelude.head listRes) ) (Prelude.tail listRes)
where foldPeriod period delta (list, lastItem) currItem =
if ((timeDiff >= (period - delta)) && (timeDiff <= (period + delta)))
then (list++[currItem],currItem)
else (list,lastItem)
where timeDiff = (tvNkSimpleTime currItem - tvNkSimpleTime lastItem)
| 1,793
| false
| true
| 0
| 25
| 535
| 587
| 290
| 297
| null | null |
anttisalonen/freekick2
|
src/SWOSShell.hs
|
gpl-3.0
|
swosColorToColor Swos.White = white
| 35
|
swosColorToColor Swos.White = white
| 35
|
swosColorToColor Swos.White = white
| 35
| false
| false
| 0
| 6
| 3
| 11
| 5
| 6
| null | null |
deech/stack
|
src/Stack/Build/Source.hs
|
bsd-3-clause
|
getLocalFlags
:: BuildConfig
-> BuildOptsCLI
-> PackageName
-> Map FlagName Bool
getLocalFlags bconfig boptsCli name = Map.unions
[ Map.findWithDefault Map.empty (Just name) cliFlags
, Map.findWithDefault Map.empty Nothing cliFlags
, Map.findWithDefault Map.empty name (unPackageFlags (bcFlags (bcLocal bconfig)))
]
where
cliFlags = boptsCLIFlags boptsCli
| 393
|
getLocalFlags
:: BuildConfig
-> BuildOptsCLI
-> PackageName
-> Map FlagName Bool
getLocalFlags bconfig boptsCli name = Map.unions
[ Map.findWithDefault Map.empty (Just name) cliFlags
, Map.findWithDefault Map.empty Nothing cliFlags
, Map.findWithDefault Map.empty name (unPackageFlags (bcFlags (bcLocal bconfig)))
]
where
cliFlags = boptsCLIFlags boptsCli
| 393
|
getLocalFlags bconfig boptsCli name = Map.unions
[ Map.findWithDefault Map.empty (Just name) cliFlags
, Map.findWithDefault Map.empty Nothing cliFlags
, Map.findWithDefault Map.empty name (unPackageFlags (bcFlags (bcLocal bconfig)))
]
where
cliFlags = boptsCLIFlags boptsCli
| 296
| false
| true
| 0
| 12
| 79
| 121
| 58
| 63
| null | null |
edwtjo/irc-colors
|
src/main/Data/Text/IRC/Color.hs
|
bsd-3-clause
|
-- |Colors known to work on common IRC clients, constructs a Color
white, black, navy, green, red, brown, purple, olive, yellow, lime, teal, cyan, blue, pink, grey, silver :: Color
white = MkColor "0"
| 200
|
white, black, navy, green, red, brown, purple, olive, yellow, lime, teal, cyan, blue, pink, grey, silver :: Color
white = MkColor "0"
| 133
|
white = MkColor "0"
| 19
| true
| true
| 0
| 5
| 33
| 45
| 38
| 7
| null | null |
bartavelle/manglingrules
|
Mangling.hs
|
gpl-3.0
|
showRule' JTR (ExtractInsert a b c) = do
pa <- showPos JTR a
pb <- showPos JTR b
pc <- showPos JTR c
return ('X':pa:pb:[pc])
| 150
|
showRule' JTR (ExtractInsert a b c) = do
pa <- showPos JTR a
pb <- showPos JTR b
pc <- showPos JTR c
return ('X':pa:pb:[pc])
| 150
|
showRule' JTR (ExtractInsert a b c) = do
pa <- showPos JTR a
pb <- showPos JTR b
pc <- showPos JTR c
return ('X':pa:pb:[pc])
| 150
| false
| false
| 0
| 11
| 50
| 83
| 37
| 46
| null | null |
tolysz/prepare-ghcjs
|
spec-lts8/aeson/tests/DataFamilies/Encoders.hs
|
bsd-3-clause
|
thGADTToEncodingDefault :: GADT String -> Encoding
thGADTToEncodingDefault = $(mkToEncoding defaultOptions 'GADT)
| 113
|
thGADTToEncodingDefault :: GADT String -> Encoding
thGADTToEncodingDefault = $(mkToEncoding defaultOptions 'GADT)
| 113
|
thGADTToEncodingDefault = $(mkToEncoding defaultOptions 'GADT)
| 62
| false
| true
| 0
| 7
| 10
| 28
| 14
| 14
| null | null |
gbaz/cabal
|
cabal-install/Distribution/Client/IndexUtils.hs
|
bsd-3-clause
|
showIndexCacheEntry :: IndexCacheEntry -> String
showIndexCacheEntry entry = unwords $ case entry of
CachePackageId pkgid b -> [ installedUnitId
, display (packageName pkgid)
, display (packageVersion pkgid)
, blocknoKey
, show b
]
CacheBuildTreeRef t b -> [ buildTreeRefKey
, [typeCodeFromRefType t]
, show b
]
CachePreference dep -> [ preferredVersionKey
, display dep
]
-- | Cabal caches various information about the Hackage index
| 738
|
showIndexCacheEntry :: IndexCacheEntry -> String
showIndexCacheEntry entry = unwords $ case entry of
CachePackageId pkgid b -> [ installedUnitId
, display (packageName pkgid)
, display (packageVersion pkgid)
, blocknoKey
, show b
]
CacheBuildTreeRef t b -> [ buildTreeRefKey
, [typeCodeFromRefType t]
, show b
]
CachePreference dep -> [ preferredVersionKey
, display dep
]
-- | Cabal caches various information about the Hackage index
| 738
|
showIndexCacheEntry entry = unwords $ case entry of
CachePackageId pkgid b -> [ installedUnitId
, display (packageName pkgid)
, display (packageVersion pkgid)
, blocknoKey
, show b
]
CacheBuildTreeRef t b -> [ buildTreeRefKey
, [typeCodeFromRefType t]
, show b
]
CachePreference dep -> [ preferredVersionKey
, display dep
]
-- | Cabal caches various information about the Hackage index
| 689
| false
| true
| 0
| 12
| 368
| 121
| 62
| 59
| null | null |
robdockins/edison
|
edison-core/src/Data/Edison/Assoc/StandardMap.hs
|
mit
|
singleton = DM.singleton
| 33
|
singleton = DM.singleton
| 33
|
singleton = DM.singleton
| 33
| false
| false
| 0
| 5
| 11
| 8
| 4
| 4
| null | null |
Teaspot-Studio/model-gridizer
|
src/Plane.hs
|
bsd-3-clause
|
lineFromPoints :: V3 Float -> V3 Float -> Line
lineFromPoints lbegin lend = Line lbegin (normalize $ lend - lbegin)
| 115
|
lineFromPoints :: V3 Float -> V3 Float -> Line
lineFromPoints lbegin lend = Line lbegin (normalize $ lend - lbegin)
| 115
|
lineFromPoints lbegin lend = Line lbegin (normalize $ lend - lbegin)
| 68
| false
| true
| 0
| 8
| 19
| 46
| 22
| 24
| null | null |
cartazio/arithmoi
|
Math/NumberTheory/Moduli/Singleton.hs
|
mit
|
isOddPrimePower
:: (Integral a, UniqueFactorisation a)
=> a
-> Maybe (Prime a, Word)
isOddPrimePower n
| even n = Nothing
| otherwise = (, k) <$> isPrime p
where
(p, k) = highestPower n
-- | Convert a cyclic group to a proof that @m@ is known. Usage example:
--
-- > toModulo :: CyclicGroup Integer m -> Natural
-- > toModulo t = case proofFromCyclicGroup t of Sub Dict -> natVal t
| 401
|
isOddPrimePower
:: (Integral a, UniqueFactorisation a)
=> a
-> Maybe (Prime a, Word)
isOddPrimePower n
| even n = Nothing
| otherwise = (, k) <$> isPrime p
where
(p, k) = highestPower n
-- | Convert a cyclic group to a proof that @m@ is known. Usage example:
--
-- > toModulo :: CyclicGroup Integer m -> Natural
-- > toModulo t = case proofFromCyclicGroup t of Sub Dict -> natVal t
| 401
|
isOddPrimePower n
| even n = Nothing
| otherwise = (, k) <$> isPrime p
where
(p, k) = highestPower n
-- | Convert a cyclic group to a proof that @m@ is known. Usage example:
--
-- > toModulo :: CyclicGroup Integer m -> Natural
-- > toModulo t = case proofFromCyclicGroup t of Sub Dict -> natVal t
| 310
| false
| true
| 1
| 10
| 92
| 97
| 50
| 47
| null | null |
alexvong1995/pandoc
|
src/Text/Pandoc/Writers/Docbook.hs
|
gpl-2.0
|
inlineToDocbook opts (Span _ ils) =
inlinesToDocbook opts ils
| 63
|
inlineToDocbook opts (Span _ ils) =
inlinesToDocbook opts ils
| 63
|
inlineToDocbook opts (Span _ ils) =
inlinesToDocbook opts ils
| 63
| false
| false
| 0
| 6
| 10
| 27
| 11
| 16
| null | null |
juodaspaulius/clafer-old-customBNFC
|
src/Language/Clafer/Intermediate/Desugarer.hs
|
mit
|
desugarOp :: (a -> PExp) -> String -> [a] -> IExp
desugarOp f op' exps' =
if (op' == iIfThenElse)
then IFunExp op' $ (desugarPath $ head mappedList) : (map reducePExp $ tail mappedList)
else IFunExp op' $ map (trans.f) exps'
where
mappedList = map f exps'
trans = if op' `elem` ([iNot, iIfThenElse] ++ logBinOps)
then desugarPath else id
| 379
|
desugarOp :: (a -> PExp) -> String -> [a] -> IExp
desugarOp f op' exps' =
if (op' == iIfThenElse)
then IFunExp op' $ (desugarPath $ head mappedList) : (map reducePExp $ tail mappedList)
else IFunExp op' $ map (trans.f) exps'
where
mappedList = map f exps'
trans = if op' `elem` ([iNot, iIfThenElse] ++ logBinOps)
then desugarPath else id
| 379
|
desugarOp f op' exps' =
if (op' == iIfThenElse)
then IFunExp op' $ (desugarPath $ head mappedList) : (map reducePExp $ tail mappedList)
else IFunExp op' $ map (trans.f) exps'
where
mappedList = map f exps'
trans = if op' `elem` ([iNot, iIfThenElse] ++ logBinOps)
then desugarPath else id
| 329
| false
| true
| 0
| 11
| 101
| 150
| 80
| 70
| null | null |
monsanto/hie
|
Hie/Language/Haskell/Exts/Pretty.hs
|
gpl-3.0
|
maybePP pp (Just a) = pp a
| 26
|
maybePP pp (Just a) = pp a
| 26
|
maybePP pp (Just a) = pp a
| 26
| false
| false
| 0
| 7
| 6
| 20
| 9
| 11
| null | null |
amremam2004/vxmlizer
|
Text/XML/Light/Cursor.hs
|
bsd-3-clause
|
firstChild :: Cursor -> Maybe Cursor
firstChild loc =
do (t : ts, ps) <- downParents loc
return Cur { current = t, lefts = [], rights = ts , parents = ps }
-- | The last child of the given location.
| 206
|
firstChild :: Cursor -> Maybe Cursor
firstChild loc =
do (t : ts, ps) <- downParents loc
return Cur { current = t, lefts = [], rights = ts , parents = ps }
-- | The last child of the given location.
| 206
|
firstChild loc =
do (t : ts, ps) <- downParents loc
return Cur { current = t, lefts = [], rights = ts , parents = ps }
-- | The last child of the given location.
| 169
| false
| true
| 0
| 11
| 50
| 80
| 42
| 38
| null | null |
dagit/zenc
|
Text/Encoding/Z.hs
|
bsd-3-clause
|
-- ^ Encoded form
-- | The basic encoding scheme is this:
--
-- * Tuples (,,,) are coded as Z3T
--
-- * Alphabetic characters (upper and lower) and digits
-- all translate to themselves;
-- except 'Z', which translates to 'ZZ'
-- and 'z', which translates to 'zz'
-- We need both so that we can preserve the variable/tycon distinction
--
-- * Most other printable characters translate to 'zx' or 'Zx' for some
-- alphabetic character x
--
-- * The others translate as 'znnnU' where 'nnn' is the decimal number
-- of the character
--
-- @
-- Before After
-- --------------------------
-- Trak Trak
-- foo_wib foozuwib
-- \> zg
-- \>1 zg1
-- foo\# foozh
-- foo\#\# foozhzh
-- foo\#\#1 foozhzh1
-- fooZ fooZZ
-- :+ ZCzp
-- () Z0T 0-tuple
-- (,,,,) Z5T 5-tuple
-- (\# \#) Z1H unboxed 1-tuple (note the space)
-- (\#,,,,\#) Z5H unboxed 5-tuple
-- (NB: There is no Z1T nor Z0H.)
-- @
zEncodeString :: UserString -> EncodedString
zEncodeString cs = case maybe_tuple cs of
Just n -> n -- Tuples go to Z2T etc
Nothing -> go cs
where
go [] = []
go (c:cs) = encode_digit_ch c ++ go' cs
go' [] = []
go' (c:cs) = encode_ch c ++ go' cs
| 1,601
|
zEncodeString :: UserString -> EncodedString
zEncodeString cs = case maybe_tuple cs of
Just n -> n -- Tuples go to Z2T etc
Nothing -> go cs
where
go [] = []
go (c:cs) = encode_digit_ch c ++ go' cs
go' [] = []
go' (c:cs) = encode_ch c ++ go' cs
| 369
|
zEncodeString cs = case maybe_tuple cs of
Just n -> n -- Tuples go to Z2T etc
Nothing -> go cs
where
go [] = []
go (c:cs) = encode_digit_ch c ++ go' cs
go' [] = []
go' (c:cs) = encode_ch c ++ go' cs
| 324
| true
| true
| 0
| 9
| 695
| 155
| 93
| 62
| null | null |
geophf/1HaskellADay
|
exercises/HAD/Y2017/M09/D08/Solution.hs
|
mit
|
{--
>>> bfiles exerciseDir
["Y2017/M09/D08/articles//b//AP900327-0002.txt",
"Y2017/M09/D08/articles//b//AP900327-0094.txt",
"Y2017/M09/D08/articles//b//AP900327-0242.txt",
"Y2017/M09/D08/articles//b//AP900328-0089.txt",
"Y2017/M09/D08/articles//b//AP900328-0151.txt",
"Y2017/M09/D08/articles//b//AP900329-0129.txt",
"Y2017/M09/D08/articles//b//AP900330-0013.txt",
"Y2017/M09/D08/articles//b//AP900330-0150.txt",
"Y2017/M09/D08/articles//b//AP900401-0056.txt",
"Y2017/M09/D08/articles//b//AP900402-0100.txt"]
YYYUUUUSSSS!!!
--}
-- Now that we've got the file names, load the files, compress them, then save
-- them locally using the same directory structure from where they were fetched
loadCompressStore :: URL -> Directory -> Directory -> FileName -> IO ()
loadCompressStore url archiveDir bOrN filename =
let subArch = composeDir archiveDir bOrN
archDir = composeDir archiveDir (composeDir "zipped/" bOrN) in
createDirectoryIfMissing True archDir >>
simpleHttp (composePath (composeDir url subArch) filename) >>=
BL.writeFile (composePath archDir (filename ++ ".gz")) . GZ.compress
| 1,156
|
loadCompressStore :: URL -> Directory -> Directory -> FileName -> IO ()
loadCompressStore url archiveDir bOrN filename =
let subArch = composeDir archiveDir bOrN
archDir = composeDir archiveDir (composeDir "zipped/" bOrN) in
createDirectoryIfMissing True archDir >>
simpleHttp (composePath (composeDir url subArch) filename) >>=
BL.writeFile (composePath archDir (filename ++ ".gz")) . GZ.compress
| 457
|
loadCompressStore url archiveDir bOrN filename =
let subArch = composeDir archiveDir bOrN
archDir = composeDir archiveDir (composeDir "zipped/" bOrN) in
createDirectoryIfMissing True archDir >>
simpleHttp (composePath (composeDir url subArch) filename) >>=
BL.writeFile (composePath archDir (filename ++ ".gz")) . GZ.compress
| 385
| true
| true
| 0
| 11
| 167
| 142
| 68
| 74
| null | null |
jystic/ntpmon
|
app/Main.hs
|
bsd-3-clause
|
-- | Returns the server addresses from the first list combined with
-- the server data from the second list.
mergeServers :: [Server] -> [Server] -> [Server]
mergeServers xs ys = nubBy nameEq (map (findByName ys) xs)
| 216
|
mergeServers :: [Server] -> [Server] -> [Server]
mergeServers xs ys = nubBy nameEq (map (findByName ys) xs)
| 107
|
mergeServers xs ys = nubBy nameEq (map (findByName ys) xs)
| 58
| true
| true
| 0
| 9
| 36
| 54
| 29
| 25
| null | null |
ulricha/dsh
|
src/Database/DSH/VSL/Opt/Properties/ReqColumns.hs
|
bsd-3-clause
|
(∪) :: VectorProp ReqCols -> VectorProp ReqCols -> Either String (VectorProp ReqCols)
(∪) (VProp (Just cols1)) (VProp (Just cols2)) = return $ VProp $ Just $ cols1 `L.union` cols2
| 179
|
(∪) :: VectorProp ReqCols -> VectorProp ReqCols -> Either String (VectorProp ReqCols)
(∪) (VProp (Just cols1)) (VProp (Just cols2)) = return $ VProp $ Just $ cols1 `L.union` cols2
| 179
|
(∪) (VProp (Just cols1)) (VProp (Just cols2)) = return $ VProp $ Just $ cols1 `L.union` cols2
| 93
| false
| true
| 0
| 12
| 28
| 94
| 47
| 47
| null | null |
benjumanji/hs-snuffle
|
src/Main.hs
|
gpl-3.0
|
opts path = info (helper <*> (snuffle path)) desc
where
desc = fullDesc <> pDesc <> pHeader
pDesc = progDesc $ "Fetch sources and generate tags for cabal sandboxed"
++ " dependencies. Run in the same directory as any"
++ " sandboxed cabal project to generate tags for "
++ "your project source as well as that of any "
++ "dependent packages"
pHeader = header "Snuffle - autogen vim tags for cabal projects!"
-- | unpack snuffle
| 539
|
opts path = info (helper <*> (snuffle path)) desc
where
desc = fullDesc <> pDesc <> pHeader
pDesc = progDesc $ "Fetch sources and generate tags for cabal sandboxed"
++ " dependencies. Run in the same directory as any"
++ " sandboxed cabal project to generate tags for "
++ "your project source as well as that of any "
++ "dependent packages"
pHeader = header "Snuffle - autogen vim tags for cabal projects!"
-- | unpack snuffle
| 539
|
opts path = info (helper <*> (snuffle path)) desc
where
desc = fullDesc <> pDesc <> pHeader
pDesc = progDesc $ "Fetch sources and generate tags for cabal sandboxed"
++ " dependencies. Run in the same directory as any"
++ " sandboxed cabal project to generate tags for "
++ "your project source as well as that of any "
++ "dependent packages"
pHeader = header "Snuffle - autogen vim tags for cabal projects!"
-- | unpack snuffle
| 539
| false
| false
| 2
| 11
| 188
| 80
| 39
| 41
| null | null |
gridaphobe/ghc
|
compiler/deSugar/DsArrows.hs
|
bsd-3-clause
|
dsCmd :: DsCmdEnv -- arrow combinators
-> IdSet -- set of local vars available to this command
-> Type -- type of the stack (right-nested tuple)
-> Type -- return type of the command
-> HsCmd Id -- command to desugar
-> [Id] -- list of vars in the input to this command
-- This is typically fed back,
-- so don't pull on it too early
-> DsM (CoreExpr, -- desugared expression
IdSet) -- subset of local vars that occur free
-- D |- fun :: a t1 t2
-- D, xs |- arg :: t1
-- -----------------------------
-- D; xs |-a fun -< arg : stk --> t2
--
-- ---> premap (\ ((xs), _stk) -> arg) fun
dsCmd ids local_vars stack_ty res_ty
(HsCmdArrApp arrow arg arrow_ty HsFirstOrderApp _)
env_ids = do
let
(a_arg_ty, _res_ty') = tcSplitAppTy arrow_ty
(_a_ty, arg_ty) = tcSplitAppTy a_arg_ty
core_arrow <- dsLExpr arrow
core_arg <- dsLExpr arg
stack_id <- newSysLocalDs stack_ty
core_make_arg <- matchEnvStack env_ids stack_id core_arg
return (do_premap ids
(envStackType env_ids stack_ty)
arg_ty
res_ty
core_make_arg
core_arrow,
exprFreeIds core_arg `intersectVarSet` local_vars)
-- D, xs |- fun :: a t1 t2
-- D, xs |- arg :: t1
-- ------------------------------
-- D; xs |-a fun -<< arg : stk --> t2
--
-- ---> premap (\ ((xs), _stk) -> (fun, arg)) app
| 1,639
|
dsCmd :: DsCmdEnv -- arrow combinators
-> IdSet -- set of local vars available to this command
-> Type -- type of the stack (right-nested tuple)
-> Type -- return type of the command
-> HsCmd Id -- command to desugar
-> [Id] -- list of vars in the input to this command
-- This is typically fed back,
-- so don't pull on it too early
-> DsM (CoreExpr, -- desugared expression
IdSet)
dsCmd ids local_vars stack_ty res_ty
(HsCmdArrApp arrow arg arrow_ty HsFirstOrderApp _)
env_ids = do
let
(a_arg_ty, _res_ty') = tcSplitAppTy arrow_ty
(_a_ty, arg_ty) = tcSplitAppTy a_arg_ty
core_arrow <- dsLExpr arrow
core_arg <- dsLExpr arg
stack_id <- newSysLocalDs stack_ty
core_make_arg <- matchEnvStack env_ids stack_id core_arg
return (do_premap ids
(envStackType env_ids stack_ty)
arg_ty
res_ty
core_make_arg
core_arrow,
exprFreeIds core_arg `intersectVarSet` local_vars)
-- D, xs |- fun :: a t1 t2
-- D, xs |- arg :: t1
-- ------------------------------
-- D; xs |-a fun -<< arg : stk --> t2
--
-- ---> premap (\ ((xs), _stk) -> (fun, arg)) app
| 1,414
|
dsCmd ids local_vars stack_ty res_ty
(HsCmdArrApp arrow arg arrow_ty HsFirstOrderApp _)
env_ids = do
let
(a_arg_ty, _res_ty') = tcSplitAppTy arrow_ty
(_a_ty, arg_ty) = tcSplitAppTy a_arg_ty
core_arrow <- dsLExpr arrow
core_arg <- dsLExpr arg
stack_id <- newSysLocalDs stack_ty
core_make_arg <- matchEnvStack env_ids stack_id core_arg
return (do_premap ids
(envStackType env_ids stack_ty)
arg_ty
res_ty
core_make_arg
core_arrow,
exprFreeIds core_arg `intersectVarSet` local_vars)
-- D, xs |- fun :: a t1 t2
-- D, xs |- arg :: t1
-- ------------------------------
-- D; xs |-a fun -<< arg : stk --> t2
--
-- ---> premap (\ ((xs), _stk) -> (fun, arg)) app
| 808
| true
| true
| 0
| 14
| 619
| 224
| 118
| 106
| null | null |
sdiehl/ghc
|
testsuite/tests/indexed-types/should_run/T11465a.hs
|
bsd-3-clause
|
main :: IO ()
main = print $ boxed 'c'#
| 39
|
main :: IO ()
main = print $ boxed 'c'#
| 39
|
main = print $ boxed 'c'#
| 25
| false
| true
| 0
| 6
| 9
| 23
| 11
| 12
| null | null |
Jonplussed/genotype-parser
|
src/Genotype/Comparison.hs
|
bsd-3-clause
|
getBasePair :: Datum -> Maybe BasePair
getBasePair = \case
Certain bp -> Just bp
Estimated bp -> Just bp
_ -> Nothing
| 124
|
getBasePair :: Datum -> Maybe BasePair
getBasePair = \case
Certain bp -> Just bp
Estimated bp -> Just bp
_ -> Nothing
| 124
|
getBasePair = \case
Certain bp -> Just bp
Estimated bp -> Just bp
_ -> Nothing
| 85
| false
| true
| 0
| 8
| 28
| 50
| 23
| 27
| null | null |
PeterCxy/peterbot-haskell
|
src/Calc.hs
|
mit
|
calcRPN' ((isUnaryOperator -> Just o):_) [] = Left $ "Operator " ++ o ++ " needs one operand but none is provided."
| 115
|
calcRPN' ((isUnaryOperator -> Just o):_) [] = Left $ "Operator " ++ o ++ " needs one operand but none is provided."
| 115
|
calcRPN' ((isUnaryOperator -> Just o):_) [] = Left $ "Operator " ++ o ++ " needs one operand but none is provided."
| 115
| false
| false
| 0
| 10
| 21
| 42
| 21
| 21
| null | null |
osa1/rho-torrent
|
src/Rho/Utils.hs
|
bsd-3-clause
|
atomicModifyIORef_ :: IORef a -> (a -> a) -> IO ()
atomicModifyIORef_ ref f = atomicModifyIORef' ref $ \v -> (f v, ())
| 118
|
atomicModifyIORef_ :: IORef a -> (a -> a) -> IO ()
atomicModifyIORef_ ref f = atomicModifyIORef' ref $ \v -> (f v, ())
| 118
|
atomicModifyIORef_ ref f = atomicModifyIORef' ref $ \v -> (f v, ())
| 67
| false
| true
| 0
| 8
| 22
| 62
| 31
| 31
| null | null |
jeroennoels/exact-real
|
src/Ternary/Core/Normalize.hs
|
mit
|
initNormalizeRev (a:as) =
let kern = iterateKernel normalize (length as)
(c,bs) = kern a (initNormalizeRev as)
in bs ++ [coerceT1 c]
| 142
|
initNormalizeRev (a:as) =
let kern = iterateKernel normalize (length as)
(c,bs) = kern a (initNormalizeRev as)
in bs ++ [coerceT1 c]
| 142
|
initNormalizeRev (a:as) =
let kern = iterateKernel normalize (length as)
(c,bs) = kern a (initNormalizeRev as)
in bs ++ [coerceT1 c]
| 142
| false
| false
| 0
| 11
| 30
| 71
| 35
| 36
| null | null |
mindriot101/pandoc
|
src/Text/Pandoc/Readers/TWiki.hs
|
gpl-2.0
|
between :: (Show b, Monoid c) => TWParser a -> TWParser b -> (TWParser b -> TWParser c) -> TWParser c
between start end p =
mconcat <$> try (start >> notFollowedBy whitespace >> many1Till (p end) end)
| 202
|
between :: (Show b, Monoid c) => TWParser a -> TWParser b -> (TWParser b -> TWParser c) -> TWParser c
between start end p =
mconcat <$> try (start >> notFollowedBy whitespace >> many1Till (p end) end)
| 202
|
between start end p =
mconcat <$> try (start >> notFollowedBy whitespace >> many1Till (p end) end)
| 100
| false
| true
| 0
| 11
| 39
| 99
| 47
| 52
| null | null |
forste/haReFork
|
tools/interp/AST.hs
|
bsd-3-clause
|
showPs [] = ""
| 14
|
showPs [] = ""
| 14
|
showPs [] = ""
| 14
| false
| false
| 0
| 5
| 3
| 12
| 5
| 7
| null | null |
gafiatulin/codewars
|
src/2 kyu/AlgebraicIsomorphism.hs
|
mit
|
isoBoolNot :: ISO Bool Bool
isoBoolNot = (not, not)
| 51
|
isoBoolNot :: ISO Bool Bool
isoBoolNot = (not, not)
| 51
|
isoBoolNot = (not, not)
| 23
| false
| true
| 1
| 6
| 8
| 27
| 12
| 15
| null | null |
Numberartificial/workflow
|
haskell-first-principles/haskell-programming-from-first-principles-master/src/Chapter10.hs
|
mit
|
isDbDate _ = False
| 27
|
isDbDate _ = False
| 27
|
isDbDate _ = False
| 27
| false
| false
| 0
| 5
| 12
| 9
| 4
| 5
| null | null |
michaelficarra/purescript
|
src/Language/PureScript/Parser/Lexer.hs
|
mit
|
dot :: TokenParser ()
dot = match Dot
| 37
|
dot :: TokenParser ()
dot = match Dot
| 37
|
dot = match Dot
| 15
| false
| true
| 1
| 6
| 7
| 22
| 9
| 13
| null | null |
spechub/Hets
|
DFOL/Analysis_DFOL.hs
|
gpl-2.0
|
isValidFormula :: FORMULA -> Sign -> CONTEXT -> DIAGN Bool
isValidFormula T _ _ = Diagn [] True
| 95
|
isValidFormula :: FORMULA -> Sign -> CONTEXT -> DIAGN Bool
isValidFormula T _ _ = Diagn [] True
| 95
|
isValidFormula T _ _ = Diagn [] True
| 36
| false
| true
| 0
| 9
| 17
| 46
| 20
| 26
| null | null |
infotroph/pandoc
|
src/Text/Pandoc/Writers/OpenDocument.hs
|
gpl-2.0
|
isTightList :: [[Block]] -> Bool
isTightList [] = False
| 64
|
isTightList :: [[Block]] -> Bool
isTightList [] = False
| 64
|
isTightList [] = False
| 31
| false
| true
| 0
| 8
| 17
| 32
| 15
| 17
| null | null |
da-x/lamdu
|
test/InferCombinators.hs
|
gpl-3.0
|
compositeOfList base ((tag, typ):rest) = T.CExtend tag typ $ compositeOfList base rest
| 86
|
compositeOfList base ((tag, typ):rest) = T.CExtend tag typ $ compositeOfList base rest
| 86
|
compositeOfList base ((tag, typ):rest) = T.CExtend tag typ $ compositeOfList base rest
| 86
| false
| false
| 0
| 8
| 11
| 40
| 20
| 20
| null | null |
phischu/fragnix
|
tests/packages/scotty/Data.Time.Format.hs
|
bsd-3-clause
|
formatChar :: (FormatTime t) => Char -> TimeLocale -> Maybe NumericPadOption -> t -> String
formatChar '%' _ _ _ = "%"
| 118
|
formatChar :: (FormatTime t) => Char -> TimeLocale -> Maybe NumericPadOption -> t -> String
formatChar '%' _ _ _ = "%"
| 118
|
formatChar '%' _ _ _ = "%"
| 26
| false
| true
| 0
| 9
| 21
| 48
| 24
| 24
| null | null |
sgord512/Algebra
|
Algebra.hs
|
mit
|
(.+.) :: Sum -> Sum -> Sum
(.+.) (Sum m) (Sum m') = Sum $ Map.unionWith (+) m m'
| 80
|
(.+.) :: Sum -> Sum -> Sum
(.+.) (Sum m) (Sum m') = Sum $ Map.unionWith (+) m m'
| 80
|
(.+.) (Sum m) (Sum m') = Sum $ Map.unionWith (+) m m'
| 53
| false
| true
| 0
| 10
| 18
| 60
| 31
| 29
| null | null |
wangbj/leet
|
224.hs
|
bsd-2-clause
|
eval (Parens x) = eval x
| 24
|
eval (Parens x) = eval x
| 24
|
eval (Parens x) = eval x
| 24
| false
| false
| 0
| 6
| 5
| 19
| 8
| 11
| null | null |
mitchellwrosen/language-lua2
|
src/Language/Lua/Parser/Internal.hs
|
bsd-3-clause
|
mkLabel :: L Token -> Ident NodeInfo -> L Token -> Statement NodeInfo
mkLabel a b c = Label (nodeInfo a <> nodeInfo b <> nodeInfo c) b
| 134
|
mkLabel :: L Token -> Ident NodeInfo -> L Token -> Statement NodeInfo
mkLabel a b c = Label (nodeInfo a <> nodeInfo b <> nodeInfo c) b
| 134
|
mkLabel a b c = Label (nodeInfo a <> nodeInfo b <> nodeInfo c) b
| 64
| false
| true
| 0
| 9
| 27
| 71
| 31
| 40
| null | null |
andreasabel/helf
|
src/NamedExplSubst.hs
|
mit
|
var_ :: A.Name -> Val
var_ x = var x DontCare
| 45
|
var_ :: A.Name -> Val
var_ x = var x DontCare
| 45
|
var_ x = var x DontCare
| 23
| false
| true
| 0
| 6
| 10
| 25
| 12
| 13
| null | null |
SKA-ScienceDataProcessor/RC
|
MS6/dna/core/DNA/Logging.hs
|
apache-2.0
|
cudaMetricNames :: LoggerOpt -> [(String, String)]
cudaMetricNames opt = case logOptMeasure opt of
"fp-inst" -> [ ("cuda:gpu-double-instrs", "inst_fp_32")
, ("cuda:gpu-float-instrs", "inst_fp_64")
]
"float-ops" -> [ ("cuda:gpu-float-ops", "flop_count_sp")
, ("cuda:gpu-float-ops-add", "flop_count_sp_add")
, ("cuda:gpu-float-ops-mul", "flop_count_sp_mul")
, ("cuda:gpu-float-ops-fma", "flop_count_sp_fma")
]
"double-ops" -> [ ("cuda:gpu-double-ops", "flop_count_dp")
, ("cuda:gpu-double-ops-add", "flop_count_dp_add")
, ("cuda:gpu-double-ops-mul", "flop_count_dp_mul")
, ("cuda:gpu-double-ops-fma", "flop_count_dp_fma")
]
_other -> [ ]
| 813
|
cudaMetricNames :: LoggerOpt -> [(String, String)]
cudaMetricNames opt = case logOptMeasure opt of
"fp-inst" -> [ ("cuda:gpu-double-instrs", "inst_fp_32")
, ("cuda:gpu-float-instrs", "inst_fp_64")
]
"float-ops" -> [ ("cuda:gpu-float-ops", "flop_count_sp")
, ("cuda:gpu-float-ops-add", "flop_count_sp_add")
, ("cuda:gpu-float-ops-mul", "flop_count_sp_mul")
, ("cuda:gpu-float-ops-fma", "flop_count_sp_fma")
]
"double-ops" -> [ ("cuda:gpu-double-ops", "flop_count_dp")
, ("cuda:gpu-double-ops-add", "flop_count_dp_add")
, ("cuda:gpu-double-ops-mul", "flop_count_dp_mul")
, ("cuda:gpu-double-ops-fma", "flop_count_dp_fma")
]
_other -> [ ]
| 813
|
cudaMetricNames opt = case logOptMeasure opt of
"fp-inst" -> [ ("cuda:gpu-double-instrs", "inst_fp_32")
, ("cuda:gpu-float-instrs", "inst_fp_64")
]
"float-ops" -> [ ("cuda:gpu-float-ops", "flop_count_sp")
, ("cuda:gpu-float-ops-add", "flop_count_sp_add")
, ("cuda:gpu-float-ops-mul", "flop_count_sp_mul")
, ("cuda:gpu-float-ops-fma", "flop_count_sp_fma")
]
"double-ops" -> [ ("cuda:gpu-double-ops", "flop_count_dp")
, ("cuda:gpu-double-ops-add", "flop_count_dp_add")
, ("cuda:gpu-double-ops-mul", "flop_count_dp_mul")
, ("cuda:gpu-double-ops-fma", "flop_count_dp_fma")
]
_other -> [ ]
| 762
| false
| true
| 0
| 9
| 233
| 154
| 92
| 62
| null | null |
mgrabmueller/harpy
|
Harpy/X86CodeGen.hs
|
bsd-3-clause
|
x86_repz_prefix = 0xf3
| 22
|
x86_repz_prefix = 0xf3
| 22
|
x86_repz_prefix = 0xf3
| 22
| false
| false
| 0
| 4
| 2
| 6
| 3
| 3
| null | null |
lukemaurer/sequent-core
|
src/Language/SequentCore/LiftLambdas.hs
|
bsd-3-clause
|
doLiftsC :: Command DecVar -> LiftM SeqCoreCommand
doLiftsC (Let bind body)
= doLiftsB bind $ \bind'_maybe -> do
body' <- doLiftsC body
case bind'_maybe of
Just bind' -> return $ Let bind' body'
Nothing -> return body'
| 251
|
doLiftsC :: Command DecVar -> LiftM SeqCoreCommand
doLiftsC (Let bind body)
= doLiftsB bind $ \bind'_maybe -> do
body' <- doLiftsC body
case bind'_maybe of
Just bind' -> return $ Let bind' body'
Nothing -> return body'
| 251
|
doLiftsC (Let bind body)
= doLiftsB bind $ \bind'_maybe -> do
body' <- doLiftsC body
case bind'_maybe of
Just bind' -> return $ Let bind' body'
Nothing -> return body'
| 200
| false
| true
| 0
| 13
| 69
| 88
| 40
| 48
| null | null |
vito/atomo
|
src/Atomo/Method.hs
|
bsd-3-clause
|
insertMethod :: Method -> [Method] -> [Method]
insertMethod x [] = [x]
| 70
|
insertMethod :: Method -> [Method] -> [Method]
insertMethod x [] = [x]
| 70
|
insertMethod x [] = [x]
| 23
| false
| true
| 0
| 7
| 11
| 35
| 19
| 16
| null | null |
SAdams601/ParRegexSearch
|
test/HaRe/src/Language/Haskell/Refact/Utils/Utils.hs
|
mit
|
-- ---------------------------------------------------------------------
-- | Parse a single source file into a GHC session
parseSourceFileGhc :: FilePath -> RefactGhc ()
parseSourceFileGhc targetFile = do
logm $ "parseSourceFileGhc:targetFile=" ++ show targetFile
setTargetSession targetFile
logm $ "parseSourceFileGhc:after setTargetSession"
graph <- GHC.getModuleGraph
cgraph <- canonicalizeGraph graph
cfileName <- liftIO $ canonicalizePath targetFile
let mm = filter (\(mfn,_ms) -> mfn == Just cfileName) cgraph
case mm of
[(_,modSum)] -> loadFromModSummary modSum
_ -> error $ "HaRe:unexpected error parsing " ++ targetFile
-- ---------------------------------------------------------------------
| 729
|
parseSourceFileGhc :: FilePath -> RefactGhc ()
parseSourceFileGhc targetFile = do
logm $ "parseSourceFileGhc:targetFile=" ++ show targetFile
setTargetSession targetFile
logm $ "parseSourceFileGhc:after setTargetSession"
graph <- GHC.getModuleGraph
cgraph <- canonicalizeGraph graph
cfileName <- liftIO $ canonicalizePath targetFile
let mm = filter (\(mfn,_ms) -> mfn == Just cfileName) cgraph
case mm of
[(_,modSum)] -> loadFromModSummary modSum
_ -> error $ "HaRe:unexpected error parsing " ++ targetFile
-- ---------------------------------------------------------------------
| 604
|
parseSourceFileGhc targetFile = do
logm $ "parseSourceFileGhc:targetFile=" ++ show targetFile
setTargetSession targetFile
logm $ "parseSourceFileGhc:after setTargetSession"
graph <- GHC.getModuleGraph
cgraph <- canonicalizeGraph graph
cfileName <- liftIO $ canonicalizePath targetFile
let mm = filter (\(mfn,_ms) -> mfn == Just cfileName) cgraph
case mm of
[(_,modSum)] -> loadFromModSummary modSum
_ -> error $ "HaRe:unexpected error parsing " ++ targetFile
-- ---------------------------------------------------------------------
| 557
| true
| true
| 0
| 15
| 104
| 166
| 78
| 88
| null | null |
tpsinnem/Idris-dev
|
src/Idris/IBC.hs
|
bsd-3-clause
|
ibc i (IBCAutoHint n h) f = return f { ibc_autohints = (n, h) : ibc_autohints f }
| 81
|
ibc i (IBCAutoHint n h) f = return f { ibc_autohints = (n, h) : ibc_autohints f }
| 81
|
ibc i (IBCAutoHint n h) f = return f { ibc_autohints = (n, h) : ibc_autohints f }
| 81
| false
| false
| 1
| 9
| 17
| 48
| 23
| 25
| null | null |
phischu/fragnix
|
app/Update.hs
|
bsd-3-clause
|
loadEnvironmentSliceIDs :: Environment -> IO [SliceID]
loadEnvironmentSliceIDs environment = do
let sliceIDs = do
symbols <- Map.elems environment
symbol <- symbols
let ModuleName () moduleName = symbolModule symbol
OtherSlice sliceId <- [moduleNameReference moduleName]
return sliceId
loadSliceIDsTransitive slicesPath sliceIDs
-- | Build up a map from slice ID to corresponding slice for better lookup.
| 450
|
loadEnvironmentSliceIDs :: Environment -> IO [SliceID]
loadEnvironmentSliceIDs environment = do
let sliceIDs = do
symbols <- Map.elems environment
symbol <- symbols
let ModuleName () moduleName = symbolModule symbol
OtherSlice sliceId <- [moduleNameReference moduleName]
return sliceId
loadSliceIDsTransitive slicesPath sliceIDs
-- | Build up a map from slice ID to corresponding slice for better lookup.
| 450
|
loadEnvironmentSliceIDs environment = do
let sliceIDs = do
symbols <- Map.elems environment
symbol <- symbols
let ModuleName () moduleName = symbolModule symbol
OtherSlice sliceId <- [moduleNameReference moduleName]
return sliceId
loadSliceIDsTransitive slicesPath sliceIDs
-- | Build up a map from slice ID to corresponding slice for better lookup.
| 395
| false
| true
| 0
| 16
| 98
| 103
| 45
| 58
| null | null |
beni55/text
|
Data/Text/Array.hs
|
bsd-2-clause
|
-- | Unchecked write of a mutable array. May return garbage or crash
-- on an out-of-bounds access.
unsafeWrite :: MArray s -> Int -> Word16 -> ST s ()
unsafeWrite MArray{..} i@(I# i#) (W16# e#) = ST $ \s1# ->
CHECK_BOUNDS("unsafeWrite",maLen,i)
case writeWord16Array# maBA i# e# s1# of
s2# -> (# s2#, () #)
| 317
|
unsafeWrite :: MArray s -> Int -> Word16 -> ST s ()
unsafeWrite MArray{..} i@(I# i#) (W16# e#) = ST $ \s1# ->
CHECK_BOUNDS("unsafeWrite",maLen,i)
case writeWord16Array# maBA i# e# s1# of
s2# -> (# s2#, () #)
| 216
|
unsafeWrite MArray{..} i@(I# i#) (W16# e#) = ST $ \s1# ->
CHECK_BOUNDS("unsafeWrite",maLen,i)
case writeWord16Array# maBA i# e# s1# of
s2# -> (# s2#, () #)
| 164
| true
| true
| 1
| 9
| 64
| 114
| 58
| 56
| null | null |
printedheart/Dao
|
src/Dao/Object.hs
|
agpl-3.0
|
simpleNumInfixOp :: (forall a . Num a => a -> a -> a) -> Simple -> Simple -> Simple
simpleNumInfixOp num a b = case a of
ONull -> case b of
ONull -> ONull
OInt b -> OInt $ num 0 b
OLong b -> OLong $ num 0 b
OFloat b -> OFloat $ num 0 b
_ -> OVoid
OInt a -> case b of
ONull -> OInt $ num a 0
OInt b -> OInt $ num a b
OLong b -> OLong $ num (toInteger a) b
OFloat b -> OFloat $ num (fromRational $ toRational a) b
_ -> OVoid
OLong a -> case b of
ONull -> OLong $ num a 0
OInt b -> OLong $ num a $ toInteger b
OLong b -> OLong $ num a b
OFloat b -> OFloat $ fromRational (toRational a) + b
_ -> OVoid
OFloat a -> case b of
ONull -> OFloat $ num a 0
OInt b -> OFloat $ num a $ fromRational (toRational b)
OLong b -> OFloat $ num a $ fromRational (toRational b)
OFloat b -> OFloat $ num a b
_ -> OVoid
_ -> OVoid
-- | Perform a set infix operation on two 'Simple' data types.
| 1,051
|
simpleNumInfixOp :: (forall a . Num a => a -> a -> a) -> Simple -> Simple -> Simple
simpleNumInfixOp num a b = case a of
ONull -> case b of
ONull -> ONull
OInt b -> OInt $ num 0 b
OLong b -> OLong $ num 0 b
OFloat b -> OFloat $ num 0 b
_ -> OVoid
OInt a -> case b of
ONull -> OInt $ num a 0
OInt b -> OInt $ num a b
OLong b -> OLong $ num (toInteger a) b
OFloat b -> OFloat $ num (fromRational $ toRational a) b
_ -> OVoid
OLong a -> case b of
ONull -> OLong $ num a 0
OInt b -> OLong $ num a $ toInteger b
OLong b -> OLong $ num a b
OFloat b -> OFloat $ fromRational (toRational a) + b
_ -> OVoid
OFloat a -> case b of
ONull -> OFloat $ num a 0
OInt b -> OFloat $ num a $ fromRational (toRational b)
OLong b -> OFloat $ num a $ fromRational (toRational b)
OFloat b -> OFloat $ num a b
_ -> OVoid
_ -> OVoid
-- | Perform a set infix operation on two 'Simple' data types.
| 1,051
|
simpleNumInfixOp num a b = case a of
ONull -> case b of
ONull -> ONull
OInt b -> OInt $ num 0 b
OLong b -> OLong $ num 0 b
OFloat b -> OFloat $ num 0 b
_ -> OVoid
OInt a -> case b of
ONull -> OInt $ num a 0
OInt b -> OInt $ num a b
OLong b -> OLong $ num (toInteger a) b
OFloat b -> OFloat $ num (fromRational $ toRational a) b
_ -> OVoid
OLong a -> case b of
ONull -> OLong $ num a 0
OInt b -> OLong $ num a $ toInteger b
OLong b -> OLong $ num a b
OFloat b -> OFloat $ fromRational (toRational a) + b
_ -> OVoid
OFloat a -> case b of
ONull -> OFloat $ num a 0
OInt b -> OFloat $ num a $ fromRational (toRational b)
OLong b -> OFloat $ num a $ fromRational (toRational b)
OFloat b -> OFloat $ num a b
_ -> OVoid
_ -> OVoid
-- | Perform a set infix operation on two 'Simple' data types.
| 967
| false
| true
| 0
| 15
| 391
| 461
| 213
| 248
| null | null |
sapek/pandoc
|
src/Text/Pandoc/Readers/Org.hs
|
gpl-2.0
|
withParsed :: (F Blocks -> F Blocks) -> BlockProperties -> OrgParser (F Blocks)
withParsed f blockProp = (ignHeaders *> (f <$> parsedBlockContent blockProp))
| 157
|
withParsed :: (F Blocks -> F Blocks) -> BlockProperties -> OrgParser (F Blocks)
withParsed f blockProp = (ignHeaders *> (f <$> parsedBlockContent blockProp))
| 157
|
withParsed f blockProp = (ignHeaders *> (f <$> parsedBlockContent blockProp))
| 77
| false
| true
| 0
| 9
| 22
| 63
| 31
| 32
| null | null |
ambiata/delorean
|
test/Test/Delorean/Local/QQ.hs
|
bsd-3-clause
|
prop_qtime :: Bool
prop_qtime =
all (const True) $ [
[qtime|23:10:01|]
, [qtime|00:00:00|]
, [qtime|23:59:59|]
-- , [qtime|23:59:xx|]
]
| 156
|
prop_qtime :: Bool
prop_qtime =
all (const True) $ [
[qtime|23:10:01|]
, [qtime|00:00:00|]
, [qtime|23:59:59|]
-- , [qtime|23:59:xx|]
]
| 156
|
prop_qtime =
all (const True) $ [
[qtime|23:10:01|]
, [qtime|00:00:00|]
, [qtime|23:59:59|]
-- , [qtime|23:59:xx|]
]
| 137
| false
| true
| 0
| 8
| 39
| 46
| 31
| 15
| null | null |
vincenthz/cryptonite
|
Crypto/ECC/Simple/Prim.hs
|
bsd-3-clause
|
isPointAtInfinity _ = False
| 32
|
isPointAtInfinity _ = False
| 32
|
isPointAtInfinity _ = False
| 32
| false
| false
| 0
| 4
| 8
| 10
| 4
| 6
| null | null |
urbanslug/ghc
|
compiler/coreSyn/TrieMap.hs
|
bsd-3-clause
|
xtE (D env (Lam v e)) f m = m { cm_lam = cm_lam m
|> xtG (D (extendCME env v) e)
|>> xtBndr env v f }
| 210
|
xtE (D env (Lam v e)) f m = m { cm_lam = cm_lam m
|> xtG (D (extendCME env v) e)
|>> xtBndr env v f }
| 210
|
xtE (D env (Lam v e)) f m = m { cm_lam = cm_lam m
|> xtG (D (extendCME env v) e)
|>> xtBndr env v f }
| 210
| false
| false
| 1
| 14
| 136
| 77
| 36
| 41
| null | null |
wereHamster/nauva
|
pkg/hs/nauvad/src/Nauvad.hs
|
mit
|
connectToBackend :: TVar State -> Int -> IO ()
connectToBackend stateVar portNumber = void $ forkIO $ go `catches`
[ Handler $ \(_ :: IOException) -> do -- SCT-4
-- Immediately retry to establish the connection to the backend.
currentBackendPort <- _backendPort <$> atomically (readTVar stateVar)
if currentBackendPort == Just portNumber
then connectToBackend stateVar portNumber
else pure ()
, Handler $ warnSomeException "connectToBackend"
]
where
go = WS.runClient "127.0.0.1" portNumber "/_nauva" $ \conn -> do
shutdownBackendConnection stateVar
threadId <- myThreadId
registerBackendConnection stateVar (conn, threadId)
forever $ do
datum <- WS.receiveData conn
case A.eitherDecode datum of
Right ("spine" :: Text, v :: A.Value, headElements :: A.Value) -> do
sendToClient stateVar $ NVDMSpineRaw v headElements
Right ("location", v, _) -> do
sendToClient stateVar $ NVDMLocationRaw v
_ -> do
putStrLn "Failed to decode message"
print datum
-- SCT-1
| 1,212
|
connectToBackend :: TVar State -> Int -> IO ()
connectToBackend stateVar portNumber = void $ forkIO $ go `catches`
[ Handler $ \(_ :: IOException) -> do -- SCT-4
-- Immediately retry to establish the connection to the backend.
currentBackendPort <- _backendPort <$> atomically (readTVar stateVar)
if currentBackendPort == Just portNumber
then connectToBackend stateVar portNumber
else pure ()
, Handler $ warnSomeException "connectToBackend"
]
where
go = WS.runClient "127.0.0.1" portNumber "/_nauva" $ \conn -> do
shutdownBackendConnection stateVar
threadId <- myThreadId
registerBackendConnection stateVar (conn, threadId)
forever $ do
datum <- WS.receiveData conn
case A.eitherDecode datum of
Right ("spine" :: Text, v :: A.Value, headElements :: A.Value) -> do
sendToClient stateVar $ NVDMSpineRaw v headElements
Right ("location", v, _) -> do
sendToClient stateVar $ NVDMLocationRaw v
_ -> do
putStrLn "Failed to decode message"
print datum
-- SCT-1
| 1,212
|
connectToBackend stateVar portNumber = void $ forkIO $ go `catches`
[ Handler $ \(_ :: IOException) -> do -- SCT-4
-- Immediately retry to establish the connection to the backend.
currentBackendPort <- _backendPort <$> atomically (readTVar stateVar)
if currentBackendPort == Just portNumber
then connectToBackend stateVar portNumber
else pure ()
, Handler $ warnSomeException "connectToBackend"
]
where
go = WS.runClient "127.0.0.1" portNumber "/_nauva" $ \conn -> do
shutdownBackendConnection stateVar
threadId <- myThreadId
registerBackendConnection stateVar (conn, threadId)
forever $ do
datum <- WS.receiveData conn
case A.eitherDecode datum of
Right ("spine" :: Text, v :: A.Value, headElements :: A.Value) -> do
sendToClient stateVar $ NVDMSpineRaw v headElements
Right ("location", v, _) -> do
sendToClient stateVar $ NVDMLocationRaw v
_ -> do
putStrLn "Failed to decode message"
print datum
-- SCT-1
| 1,165
| false
| true
| 0
| 18
| 393
| 308
| 148
| 160
| null | null |
rudymatela/llcheck
|
src/Test/LeanCheck/Function/ShowFunction.hs
|
bsd-3-clause
|
-- general auxiliary functions
discard :: (a -> Bool) -> [a] -> [a]
discard p = filter (not . p)
| 97
|
discard :: (a -> Bool) -> [a] -> [a]
discard p = filter (not . p)
| 65
|
discard p = filter (not . p)
| 28
| true
| true
| 0
| 9
| 20
| 52
| 26
| 26
| null | null |
kwrooijen/sdl-game
|
End/Sprite/Fate.hs
|
gpl-3.0
|
pSprite :: IO Sprite
pSprite = do
s <- loadImage "images/Fate0.png" $ Just (0xee,0xff,0xde)
return $ Sprite (pAnimation s)
| 130
|
pSprite :: IO Sprite
pSprite = do
s <- loadImage "images/Fate0.png" $ Just (0xee,0xff,0xde)
return $ Sprite (pAnimation s)
| 130
|
pSprite = do
s <- loadImage "images/Fate0.png" $ Just (0xee,0xff,0xde)
return $ Sprite (pAnimation s)
| 109
| false
| true
| 0
| 10
| 26
| 56
| 27
| 29
| null | null |
sopvop/snap-core
|
test/Snap/Util/FileUploads/Tests.hs
|
bsd-3-clause
|
testPerPartPolicyViolation2 :: Test
testPerPartPolicyViolation2 = testCase "fileUploads/perPartPolicyViolation2" $
harness tmpdir hndl mixedTestBody
where
tmpdir = "tempdir_pol2"
hndl = handleFileUploads tmpdir defaultUploadPolicy
(const $ allowWithMaximumSize 4)
hndl'
hndl' partInfo e = (if partFileName partInfo == Just "file1.txt"
then ePass
else eFail) e
eFail = either (\i -> show i `deepseq` return ())
(const $ error "expected policy violation")
ePass = either (throw)
(\i -> show i `deepseq` return ())
------------------------------------------------------------------------------
| 797
|
testPerPartPolicyViolation2 :: Test
testPerPartPolicyViolation2 = testCase "fileUploads/perPartPolicyViolation2" $
harness tmpdir hndl mixedTestBody
where
tmpdir = "tempdir_pol2"
hndl = handleFileUploads tmpdir defaultUploadPolicy
(const $ allowWithMaximumSize 4)
hndl'
hndl' partInfo e = (if partFileName partInfo == Just "file1.txt"
then ePass
else eFail) e
eFail = either (\i -> show i `deepseq` return ())
(const $ error "expected policy violation")
ePass = either (throw)
(\i -> show i `deepseq` return ())
------------------------------------------------------------------------------
| 797
|
testPerPartPolicyViolation2 = testCase "fileUploads/perPartPolicyViolation2" $
harness tmpdir hndl mixedTestBody
where
tmpdir = "tempdir_pol2"
hndl = handleFileUploads tmpdir defaultUploadPolicy
(const $ allowWithMaximumSize 4)
hndl'
hndl' partInfo e = (if partFileName partInfo == Just "file1.txt"
then ePass
else eFail) e
eFail = either (\i -> show i `deepseq` return ())
(const $ error "expected policy violation")
ePass = either (throw)
(\i -> show i `deepseq` return ())
------------------------------------------------------------------------------
| 761
| false
| true
| 5
| 10
| 275
| 188
| 87
| 101
| null | null |
ahmadnazir/scheme
|
2_Parsing/Language/Parser/Number.hs
|
mit
|
float :: P.Parser LispVal
float = do x <- P.many1 P.digit
P.char '.'
y <- P.many1 P.digit
return $ Float (fst . head $ Numeric.readFloat ( x ++ "." ++ y ) )
| 189
|
float :: P.Parser LispVal
float = do x <- P.many1 P.digit
P.char '.'
y <- P.many1 P.digit
return $ Float (fst . head $ Numeric.readFloat ( x ++ "." ++ y ) )
| 189
|
float = do x <- P.many1 P.digit
P.char '.'
y <- P.many1 P.digit
return $ Float (fst . head $ Numeric.readFloat ( x ++ "." ++ y ) )
| 163
| false
| true
| 0
| 14
| 65
| 89
| 41
| 48
| null | null |
johan--/twitter-conduit
|
Web/Twitter/Conduit/Status.hs
|
bsd-2-clause
|
-- | Returns query data asks the most recent mentions for the authenticating user.
--
-- You can perform a query using 'call':
--
-- @
-- res <- 'call' 'mentionsTimeline'
-- @
--
-- >>> mentionsTimeline
-- APIRequestGet "https://api.twitter.com/1.1/statuses/mentions_timeline.json" []
mentionsTimeline :: APIRequest StatusesMentionsTimeline [Status]
mentionsTimeline = APIRequestGet (endpoint ++ "statuses/mentions_timeline.json") def
| 434
|
mentionsTimeline :: APIRequest StatusesMentionsTimeline [Status]
mentionsTimeline = APIRequestGet (endpoint ++ "statuses/mentions_timeline.json") def
| 149
|
mentionsTimeline = APIRequestGet (endpoint ++ "statuses/mentions_timeline.json") def
| 84
| true
| true
| 0
| 7
| 52
| 41
| 26
| 15
| null | null |
ghc-android/ghc
|
testsuite/tests/ghci/should_run/ghcirun004.hs
|
bsd-3-clause
|
1975 = 1974
| 11
|
1975 = 1974
| 11
|
1975 = 1974
| 11
| false
| false
| 1
| 5
| 2
| 10
| 3
| 7
| null | null |
shimazing/haskell-study-fall2016
|
HW05/HW05.hs
|
bsd-3-clause
|
parseFile :: FromJSON a => FilePath -> IO (Maybe a)
parseFile file = do
str <- BS.readFile file
return $ decode str
-- Exercise 4 -----------------------------------------
| 180
|
parseFile :: FromJSON a => FilePath -> IO (Maybe a)
parseFile file = do
str <- BS.readFile file
return $ decode str
-- Exercise 4 -----------------------------------------
| 180
|
parseFile file = do
str <- BS.readFile file
return $ decode str
-- Exercise 4 -----------------------------------------
| 128
| false
| true
| 0
| 9
| 34
| 57
| 26
| 31
| null | null |
haasn/colour
|
Data/Colour/Names.hs
|
mit
|
readColourName "goldenrod" = return goldenrod
| 45
|
readColourName "goldenrod" = return goldenrod
| 45
|
readColourName "goldenrod" = return goldenrod
| 45
| false
| false
| 1
| 5
| 4
| 15
| 5
| 10
| null | null |
rueshyna/gogol
|
gogol-admin-directory/gen/Network/Google/Resource/Directory/Roles/Delete.hs
|
mpl-2.0
|
-- | Immutable ID of the Google Apps account.
rdCustomer :: Lens' RolesDelete Text
rdCustomer
= lens _rdCustomer (\ s a -> s{_rdCustomer = a})
| 144
|
rdCustomer :: Lens' RolesDelete Text
rdCustomer
= lens _rdCustomer (\ s a -> s{_rdCustomer = a})
| 98
|
rdCustomer
= lens _rdCustomer (\ s a -> s{_rdCustomer = a})
| 61
| true
| true
| 1
| 9
| 26
| 44
| 22
| 22
| null | null |
brendanhay/gogol
|
gogol-plus-domains/gen/Network/Google/PlusDomains/Types/Product.hs
|
mpl-2.0
|
-- | Exif information of the media item.
mExif :: Lens' Media (Maybe MediaExif)
mExif = lens _mExif (\ s a -> s{_mExif = a})
| 124
|
mExif :: Lens' Media (Maybe MediaExif)
mExif = lens _mExif (\ s a -> s{_mExif = a})
| 83
|
mExif = lens _mExif (\ s a -> s{_mExif = a})
| 44
| true
| true
| 0
| 9
| 24
| 46
| 25
| 21
| null | null |
cmoresid/lightning-haskell
|
src/Web/Lightning/Plots/Scatter3.hs
|
bsd-3-clause
|
scatter3Plot :: Monad m => Scatter3Plot
-- ^ Scatter plot to create
-> LightningT m Visualization
-- ^ Transformer stack with created visualization.
scatter3Plot scatter3Plt = do
url <- ask
viz <- sendPlot "scatter-3" scatter3Plt R.plot
return $ viz { vizBaseUrl = Just url }
| 359
|
scatter3Plot :: Monad m => Scatter3Plot
-- ^ Scatter plot to create
-> LightningT m Visualization
scatter3Plot scatter3Plt = do
url <- ask
viz <- sendPlot "scatter-3" scatter3Plt R.plot
return $ viz { vizBaseUrl = Just url }
| 281
|
scatter3Plot scatter3Plt = do
url <- ask
viz <- sendPlot "scatter-3" scatter3Plt R.plot
return $ viz { vizBaseUrl = Just url }
| 132
| true
| true
| 0
| 10
| 128
| 73
| 35
| 38
| null | null |
brendanhay/ligature
|
src/Ligature/URL.hs
|
mpl-2.0
|
applyAuth :: URI -> Request a -> Request a
applyAuth uri req = maybe req (\(u, p) -> applyBasicAuth u p req) (uriUser uri)
| 122
|
applyAuth :: URI -> Request a -> Request a
applyAuth uri req = maybe req (\(u, p) -> applyBasicAuth u p req) (uriUser uri)
| 122
|
applyAuth uri req = maybe req (\(u, p) -> applyBasicAuth u p req) (uriUser uri)
| 79
| false
| true
| 0
| 8
| 23
| 64
| 32
| 32
| null | null |
jean-edouard/manager
|
apptool/Import/Files.hs
|
gpl-2.0
|
onHost :: FileSource -> Bool
onHost (FileSourceHost _) = True
| 61
|
onHost :: FileSource -> Bool
onHost (FileSourceHost _) = True
| 61
|
onHost (FileSourceHost _) = True
| 32
| false
| true
| 0
| 7
| 9
| 24
| 12
| 12
| null | null |
josuf107/Adverb
|
Adverb/Common.hs
|
gpl-3.0
|
judgementally = id
| 18
|
judgementally = id
| 18
|
judgementally = id
| 18
| false
| false
| 0
| 4
| 2
| 6
| 3
| 3
| null | null |
comonoidial/ALFIN
|
Backend/Assemble.hs
|
mit
|
asmFunCAF :: FName -> AsmGen (Instruction, (FName, (PtrTag, HeapRef)))
asmFunCAF f = do -- TODO all static fun node should be double size unless the result is known to be small
t <- liftM (NodeTag Static 0 emptyKinds . \fa -> Fun fa Nothing WithUpd) $ getFun f
hi <- getSCount
incrSCount SingleNode
return (Store t (listToBody []) (DropRQ, popNone), (f, (node2PtrTag t, (GlobalRef, SingleNode, hi))))
| 410
|
asmFunCAF :: FName -> AsmGen (Instruction, (FName, (PtrTag, HeapRef)))
asmFunCAF f = do -- TODO all static fun node should be double size unless the result is known to be small
t <- liftM (NodeTag Static 0 emptyKinds . \fa -> Fun fa Nothing WithUpd) $ getFun f
hi <- getSCount
incrSCount SingleNode
return (Store t (listToBody []) (DropRQ, popNone), (f, (node2PtrTag t, (GlobalRef, SingleNode, hi))))
| 410
|
asmFunCAF f = do -- TODO all static fun node should be double size unless the result is known to be small
t <- liftM (NodeTag Static 0 emptyKinds . \fa -> Fun fa Nothing WithUpd) $ getFun f
hi <- getSCount
incrSCount SingleNode
return (Store t (listToBody []) (DropRQ, popNone), (f, (node2PtrTag t, (GlobalRef, SingleNode, hi))))
| 339
| false
| true
| 0
| 14
| 75
| 158
| 81
| 77
| null | null |
cdornan/keystore
|
src/Data/KeyStore/KS/KS.hs
|
bsd-3-clause
|
lookupKey :: Name -> KS Key
lookupKey nm =
do mp <- getKeymap
maybe oops return $ Map.lookup nm mp
where
oops = errorKS $ _name nm ++ ": no such keystore key"
| 169
|
lookupKey :: Name -> KS Key
lookupKey nm =
do mp <- getKeymap
maybe oops return $ Map.lookup nm mp
where
oops = errorKS $ _name nm ++ ": no such keystore key"
| 169
|
lookupKey nm =
do mp <- getKeymap
maybe oops return $ Map.lookup nm mp
where
oops = errorKS $ _name nm ++ ": no such keystore key"
| 141
| false
| true
| 3
| 9
| 43
| 74
| 31
| 43
| null | null |
ghcjs/ghcjs
|
test/Server.hs
|
mit
|
readMaybeT :: Read a => Text -> Maybe a
readMaybeT = readMaybe . T.unpack
| 73
|
readMaybeT :: Read a => Text -> Maybe a
readMaybeT = readMaybe . T.unpack
| 73
|
readMaybeT = readMaybe . T.unpack
| 33
| false
| true
| 0
| 7
| 13
| 31
| 15
| 16
| null | null |
bobismijnnaam/hywar
|
Parse.hs
|
mit
|
fsa Space = \s x -> case s of
A | x ∈ spaces -> A
| otherwise -> S
-- =============================================
| 191
|
fsa Space = \s x -> case s of
A | x ∈ spaces -> A
| otherwise -> S
-- =============================================
| 191
|
fsa Space = \s x -> case s of
A | x ∈ spaces -> A
| otherwise -> S
-- =============================================
| 191
| false
| false
| 0
| 12
| 97
| 46
| 22
| 24
| null | null |
dgvncsz0f/nws
|
src/Jerimum/PostgreSQL/Types/DateRange.hs
|
bsd-3-clause
|
formatDateRange :: Range Day -> T.Text
formatDateRange = toStrict . toLazyText . buildRange buildDate
| 101
|
formatDateRange :: Range Day -> T.Text
formatDateRange = toStrict . toLazyText . buildRange buildDate
| 101
|
formatDateRange = toStrict . toLazyText . buildRange buildDate
| 62
| false
| true
| 0
| 6
| 13
| 31
| 15
| 16
| null | null |
jkozlowski/kdb-haskell
|
src/Database/Kdb/Internal/IPC.hs
|
mit
|
int16 :: End.Endianness -> A.Parser Int16
int16 End.LittleEndian = anyWordN $ pack . B.reverse
| 94
|
int16 :: End.Endianness -> A.Parser Int16
int16 End.LittleEndian = anyWordN $ pack . B.reverse
| 94
|
int16 End.LittleEndian = anyWordN $ pack . B.reverse
| 52
| false
| true
| 0
| 7
| 13
| 41
| 19
| 22
| null | null |
ddssff/pretty-listlike
|
src/Text/PrettyPrint/Annotated/HughesPJ.hs
|
bsd-3-clause
|
-- Specification:
--
-- fill g docs = fillIndent 0 docs
--
-- fillIndent k [] = []
-- fillIndent k [p] = p
-- fillIndent k (p1:p2:ps) =
-- oneLiner p1 <g> fillIndent (k + length p1 + g ? 1 : 0)
-- (remove_nests (oneLiner p2) : ps)
-- `Union`
-- (p1 $*$ nest (-k) (fillIndent 0 ps))
--
-- $*$ is defined for layouts (not Docs) as
-- layout1 $*$ layout2 | hasMoreThanOneLine layout1 = layout1 $$ layout2
-- | otherwise = layout1 $+$ layout2
fill :: Bool -> [Doc a] -> RDoc a
fill _ [] = empty
| 572
|
fill :: Bool -> [Doc a] -> RDoc a
fill _ [] = empty
| 55
|
fill _ [] = empty
| 21
| true
| true
| 0
| 9
| 183
| 55
| 33
| 22
| null | null |
ComputationWithBoundedResources/ara-inference
|
doc/tpdb_trs/Haskell/basic_haskell/minimum_5.hs
|
mit
|
primCmpNat :: Nat -> Nat -> Ordering;
primCmpNat Zero Zero = EQ
| 67
|
primCmpNat :: Nat -> Nat -> Ordering
primCmpNat Zero Zero = EQ
| 66
|
primCmpNat Zero Zero = EQ
| 25
| false
| true
| 0
| 6
| 15
| 25
| 13
| 12
| null | null |
frerich/pandoc
|
src/Text/Pandoc/Writers/LaTeX.hs
|
gpl-2.0
|
isListBlock (DefinitionList _) = True
| 37
|
isListBlock (DefinitionList _) = True
| 37
|
isListBlock (DefinitionList _) = True
| 37
| false
| false
| 0
| 7
| 4
| 15
| 7
| 8
| null | null |
anchor/vaultaire-collector-ceilometer
|
lib/Vaultaire/Collector/Ceilometer/Process/Volume.hs
|
mit
|
parseVolumeStatus "attaching" = Just VolumeAttaching
| 52
|
parseVolumeStatus "attaching" = Just VolumeAttaching
| 52
|
parseVolumeStatus "attaching" = Just VolumeAttaching
| 52
| false
| false
| 0
| 5
| 4
| 12
| 5
| 7
| null | null |
vikraman/ghc
|
compiler/coreSyn/CoreSyn.hs
|
bsd-3-clause
|
deTagAlt :: TaggedAlt t -> CoreAlt
deTagAlt (con, bndrs, rhs) = (con, [b | TB b _ <- bndrs], deTagExpr rhs)
| 107
|
deTagAlt :: TaggedAlt t -> CoreAlt
deTagAlt (con, bndrs, rhs) = (con, [b | TB b _ <- bndrs], deTagExpr rhs)
| 107
|
deTagAlt (con, bndrs, rhs) = (con, [b | TB b _ <- bndrs], deTagExpr rhs)
| 72
| false
| true
| 0
| 10
| 20
| 64
| 32
| 32
| null | null |
spechub/Hets
|
THF/Translate.hs
|
gpl-2.0
|
stringToVariable :: String -> String
stringToVariable s = case s of
c : r -> if isUpper c then s else let d = toUpper c in d : 'x' : d : r
"" -> ""
| 153
|
stringToVariable :: String -> String
stringToVariable s = case s of
c : r -> if isUpper c then s else let d = toUpper c in d : 'x' : d : r
"" -> ""
| 153
|
stringToVariable s = case s of
c : r -> if isUpper c then s else let d = toUpper c in d : 'x' : d : r
"" -> ""
| 116
| false
| true
| 0
| 13
| 42
| 81
| 38
| 43
| null | null |
kowey/antfarm
|
NLP/Antfarm/History.hs
|
bsd-3-clause
|
-- | A discourse unit that would refer to just an element
mkSingletonDu :: RefKey -> DiscourseUnit
mkSingletonDu (c,i) = Node (RefGroup c (Set.singleton i) emptyBounds) []
| 171
|
mkSingletonDu :: RefKey -> DiscourseUnit
mkSingletonDu (c,i) = Node (RefGroup c (Set.singleton i) emptyBounds) []
| 113
|
mkSingletonDu (c,i) = Node (RefGroup c (Set.singleton i) emptyBounds) []
| 72
| true
| true
| 0
| 10
| 26
| 50
| 26
| 24
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.