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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
kimsnj/writeAscheme
|
src/Parser.hs
|
mit
|
escapedChar :: Parser String
escapedChar = do backslash <- char '\\'
escaped <- oneOf "nrt\"\\"
return [backslash, escaped]
----------------
-- Token parsers
----------------
| 209
|
escapedChar :: Parser String
escapedChar = do backslash <- char '\\'
escaped <- oneOf "nrt\"\\"
return [backslash, escaped]
----------------
-- Token parsers
----------------
| 209
|
escapedChar = do backslash <- char '\\'
escaped <- oneOf "nrt\"\\"
return [backslash, escaped]
----------------
-- Token parsers
----------------
| 180
| false
| true
| 0
| 8
| 57
| 49
| 24
| 25
| null | null |
zaxtax/hakaru
|
haskell/Language/Hakaru/Types/HClasses.hs
|
bsd-3-clause
|
hRadical_Sing :: Sing a -> Maybe (HRadical a)
hRadical_Sing SProb = Just HRadical_Prob
| 86
|
hRadical_Sing :: Sing a -> Maybe (HRadical a)
hRadical_Sing SProb = Just HRadical_Prob
| 86
|
hRadical_Sing SProb = Just HRadical_Prob
| 40
| false
| true
| 0
| 8
| 12
| 33
| 15
| 18
| null | null |
sydow/ireal
|
Data/Number/IReal/UnsafeMemo.hs
|
bsd-3-clause
|
memoIO :: Scalable a => (Int -> a) -> IO (Int -> IO a)
memoIO f = do
v <- newMVar Nothing
return (\p ->
if p<0
then error ("Excessive precision required: " ++ show (fromIntegral p + 2^32))
else do
m <- readMVar v
case m of
Just (q,y)
|p <= q -> return (scale y (p - q))
_ -> do let z = f p
modifyMVar_ v (const (return (Just (p,z))))
return z)
| 452
|
memoIO :: Scalable a => (Int -> a) -> IO (Int -> IO a)
memoIO f = do
v <- newMVar Nothing
return (\p ->
if p<0
then error ("Excessive precision required: " ++ show (fromIntegral p + 2^32))
else do
m <- readMVar v
case m of
Just (q,y)
|p <= q -> return (scale y (p - q))
_ -> do let z = f p
modifyMVar_ v (const (return (Just (p,z))))
return z)
| 452
|
memoIO f = do
v <- newMVar Nothing
return (\p ->
if p<0
then error ("Excessive precision required: " ++ show (fromIntegral p + 2^32))
else do
m <- readMVar v
case m of
Just (q,y)
|p <= q -> return (scale y (p - q))
_ -> do let z = f p
modifyMVar_ v (const (return (Just (p,z))))
return z)
| 397
| false
| true
| 0
| 26
| 184
| 229
| 108
| 121
| null | null |
janrain/riak-haskell-client
|
src/Network/Riak/Connection/Internal.hs
|
apache-2.0
|
recvCorrectTag :: String -> Connection -> T.MessageTag -> Int64 -> a -> IO a
recvCorrectTag func conn expected len v = do
tag <- recvGet conn getTag
case undefined of
_| tag == expected -> recvExactly conn (len-1) >> return v
| tag == T.ErrorResponse -> throwError `fmap` recvGetN conn len messageGetM
| otherwise -> moduleError func $
"received unexpected response: expected " ++
show expected ++ ", received " ++ show tag
| 476
|
recvCorrectTag :: String -> Connection -> T.MessageTag -> Int64 -> a -> IO a
recvCorrectTag func conn expected len v = do
tag <- recvGet conn getTag
case undefined of
_| tag == expected -> recvExactly conn (len-1) >> return v
| tag == T.ErrorResponse -> throwError `fmap` recvGetN conn len messageGetM
| otherwise -> moduleError func $
"received unexpected response: expected " ++
show expected ++ ", received " ++ show tag
| 476
|
recvCorrectTag func conn expected len v = do
tag <- recvGet conn getTag
case undefined of
_| tag == expected -> recvExactly conn (len-1) >> return v
| tag == T.ErrorResponse -> throwError `fmap` recvGetN conn len messageGetM
| otherwise -> moduleError func $
"received unexpected response: expected " ++
show expected ++ ", received " ++ show tag
| 399
| false
| true
| 0
| 15
| 125
| 163
| 76
| 87
| null | null |
ganeti/ganeti
|
src/Ganeti/HTools/Backend/Text.hs
|
bsd-2-clause
|
-- | Generates the entire ipolicy section from the cluster and group
-- objects.
serializeAllIPolicies :: IPolicy -> Group.List -> String
serializeAllIPolicies cpol gl =
let groups = Container.elems gl
allpolicies = ("", cpol) :
map (\g -> (Group.name g, Group.iPolicy g)) groups
strings = map (uncurry serializeIPolicy) allpolicies
in unlines strings
| 387
|
serializeAllIPolicies :: IPolicy -> Group.List -> String
serializeAllIPolicies cpol gl =
let groups = Container.elems gl
allpolicies = ("", cpol) :
map (\g -> (Group.name g, Group.iPolicy g)) groups
strings = map (uncurry serializeIPolicy) allpolicies
in unlines strings
| 306
|
serializeAllIPolicies cpol gl =
let groups = Container.elems gl
allpolicies = ("", cpol) :
map (\g -> (Group.name g, Group.iPolicy g)) groups
strings = map (uncurry serializeIPolicy) allpolicies
in unlines strings
| 249
| true
| true
| 0
| 15
| 87
| 107
| 55
| 52
| null | null |
brendanhay/gogol
|
gogol-bigtableadmin/gen/Network/Google/BigtableAdmin/Types/Product.hs
|
mpl-2.0
|
-- | Creates a value of 'OperationProgress' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'opStartTime'
--
-- * 'opProgressPercent'
--
-- * 'opEndTime'
operationProgress
:: OperationProgress
operationProgress =
OperationProgress'
{_opStartTime = Nothing, _opProgressPercent = Nothing, _opEndTime = Nothing}
| 403
|
operationProgress
:: OperationProgress
operationProgress =
OperationProgress'
{_opStartTime = Nothing, _opProgressPercent = Nothing, _opEndTime = Nothing}
| 164
|
operationProgress =
OperationProgress'
{_opStartTime = Nothing, _opProgressPercent = Nothing, _opEndTime = Nothing}
| 121
| true
| true
| 0
| 6
| 66
| 40
| 28
| 12
| null | null |
ku-fpg/kansas-amber
|
System/Hardware/Haskino/Protocol.hs
|
bsd-3-clause
|
packageCommand (SerialEndE p) =
addCommand SER_CMD_END (packageExpr p)
| 74
|
packageCommand (SerialEndE p) =
addCommand SER_CMD_END (packageExpr p)
| 74
|
packageCommand (SerialEndE p) =
addCommand SER_CMD_END (packageExpr p)
| 74
| false
| false
| 0
| 7
| 11
| 26
| 12
| 14
| null | null |
jprider63/aeson-ios-0.8.0.2
|
Data/Aeson/Generic.hs
|
bsd-3-clause
|
-- | Efficiently deserialize a JSON value from a lazy 'L.ByteString'.
-- If this fails due to incomplete or invalid input, 'Nothing' is
-- returned.
--
-- This function parses immediately, but defers conversion. See
-- 'json' for details.
decode :: (Data a) => L.ByteString -> Maybe a
decode = decodeWith json fromJSON
| 319
|
decode :: (Data a) => L.ByteString -> Maybe a
decode = decodeWith json fromJSON
| 79
|
decode = decodeWith json fromJSON
| 33
| true
| true
| 0
| 8
| 53
| 47
| 24
| 23
| null | null |
aaronc/Idris-dev
|
src/Idris/Core/TT.hs
|
bsd-3-clause
|
pprintRaw bound (RApp f x) =
enclose lparen rparen . group . align . hang 2 . vsep $
[text "RApp", pprintRaw bound f, pprintRaw bound x]
| 140
|
pprintRaw bound (RApp f x) =
enclose lparen rparen . group . align . hang 2 . vsep $
[text "RApp", pprintRaw bound f, pprintRaw bound x]
| 140
|
pprintRaw bound (RApp f x) =
enclose lparen rparen . group . align . hang 2 . vsep $
[text "RApp", pprintRaw bound f, pprintRaw bound x]
| 140
| false
| false
| 3
| 8
| 30
| 76
| 33
| 43
| null | null |
j-mueller/hldb
|
webapp/VirtualHom/Svg/Path.hs
|
bsd-3-clause
|
-- | moveto (relative)
mR :: RealFloat a => a -> a -> Text
mR dx dy = T.concat ["m ", toText dx, ",", toText dy, " "]
| 118
|
mR :: RealFloat a => a -> a -> Text
mR dx dy = T.concat ["m ", toText dx, ",", toText dy, " "]
| 95
|
mR dx dy = T.concat ["m ", toText dx, ",", toText dy, " "]
| 58
| true
| true
| 0
| 9
| 28
| 64
| 31
| 33
| null | null |
ribag/ganeti-experiments
|
src/Ganeti/DataCollectors/InstStatus.hs
|
gpl-2.0
|
-- | The report of this data collector.
dcReport :: IO DCReport
dcReport = buildInstStatusReport Nothing Nothing
| 112
|
dcReport :: IO DCReport
dcReport = buildInstStatusReport Nothing Nothing
| 72
|
dcReport = buildInstStatusReport Nothing Nothing
| 48
| true
| true
| 0
| 5
| 16
| 20
| 10
| 10
| null | null |
hirokai/PaperServer
|
Parser/Publisher/Elsevier.hs
|
bsd-2-clause
|
_refs _ _ = []
| 14
|
_refs _ _ = []
| 14
|
_refs _ _ = []
| 14
| false
| false
| 0
| 5
| 4
| 13
| 6
| 7
| null | null |
noughtmare/yi
|
yi-core/src/Yi/Buffer/Misc.hs
|
gpl-2.0
|
moveToColB :: Int -> BufferM ()
moveToColB targetCol = do
solPnt <- solPointB =<< pointB
chrs <- R.toString <$> nelemsB targetCol solPnt
is <- indentSettingsB
let cols = scanl (colMove is) 0 chrs -- columns corresponding to the char
toSkip = takeWhile (\(char,col) -> char /= '\n' && col < targetCol) (zip chrs cols)
moveTo $ solPnt +~ fromIntegral (length toSkip)
| 383
|
moveToColB :: Int -> BufferM ()
moveToColB targetCol = do
solPnt <- solPointB =<< pointB
chrs <- R.toString <$> nelemsB targetCol solPnt
is <- indentSettingsB
let cols = scanl (colMove is) 0 chrs -- columns corresponding to the char
toSkip = takeWhile (\(char,col) -> char /= '\n' && col < targetCol) (zip chrs cols)
moveTo $ solPnt +~ fromIntegral (length toSkip)
| 383
|
moveToColB targetCol = do
solPnt <- solPointB =<< pointB
chrs <- R.toString <$> nelemsB targetCol solPnt
is <- indentSettingsB
let cols = scanl (colMove is) 0 chrs -- columns corresponding to the char
toSkip = takeWhile (\(char,col) -> char /= '\n' && col < targetCol) (zip chrs cols)
moveTo $ solPnt +~ fromIntegral (length toSkip)
| 351
| false
| true
| 0
| 15
| 79
| 146
| 71
| 75
| null | null |
GaloisInc/saw-script
|
heapster-saw/src/Verifier/SAW/Heapster/LLVMGlobalConst.hs
|
bsd-3-clause
|
translateLLVMValue _ _ v =
traceAndZeroM ("translateLLVMValue does not yet handle:\n" ++ ppLLVMValue v)
| 105
|
translateLLVMValue _ _ v =
traceAndZeroM ("translateLLVMValue does not yet handle:\n" ++ ppLLVMValue v)
| 105
|
translateLLVMValue _ _ v =
traceAndZeroM ("translateLLVMValue does not yet handle:\n" ++ ppLLVMValue v)
| 105
| false
| false
| 0
| 8
| 15
| 26
| 12
| 14
| null | null |
artems/FlashBit
|
src/Process/Peer/Sender.hs
|
bsd-3-clause
|
receive (Right message) = sendMessage message
| 45
|
receive (Right message) = sendMessage message
| 45
|
receive (Right message) = sendMessage message
| 45
| false
| false
| 0
| 7
| 5
| 18
| 8
| 10
| null | null |
keithodulaigh/Hets
|
THF/ParseTHF.hs
|
gpl-2.0
|
include :: CharParser st TPTP_THF
include = do
key $ tryString "include"
oParentheses
fn <- fileName
fs <- formulaSelection
cParentheses
char '.'
return $ TPTP_Include (I_Include fn fs)
| 213
|
include :: CharParser st TPTP_THF
include = do
key $ tryString "include"
oParentheses
fn <- fileName
fs <- formulaSelection
cParentheses
char '.'
return $ TPTP_Include (I_Include fn fs)
| 213
|
include = do
key $ tryString "include"
oParentheses
fn <- fileName
fs <- formulaSelection
cParentheses
char '.'
return $ TPTP_Include (I_Include fn fs)
| 179
| false
| true
| 0
| 11
| 55
| 76
| 31
| 45
| null | null |
egaburov/funstuff
|
Haskell/fun-with-types/memo.hs
|
apache-2.0
|
f2 :: (Bool,Bool) -> Integer
f2 (True,True) = factorial 30000
| 61
|
f2 :: (Bool,Bool) -> Integer
f2 (True,True) = factorial 30000
| 61
|
f2 (True,True) = factorial 30000
| 32
| false
| true
| 0
| 6
| 9
| 37
| 19
| 18
| null | null |
wxwxwwxxx/ghc
|
testsuite/tests/programs/andy_cherry/Main.hs
|
bsd-3-clause
|
replayQ (_:rest) std_in = replayQ rest std_in
| 45
|
replayQ (_:rest) std_in = replayQ rest std_in
| 45
|
replayQ (_:rest) std_in = replayQ rest std_in
| 45
| false
| false
| 0
| 7
| 6
| 23
| 11
| 12
| null | null |
rodrigogribeiro/mptc
|
test/Data/TestCase1TcExp.hs
|
bsd-3-clause
|
intrconstr t = ClassA (UnQual (Ident "Integral")) [t]
| 53
|
intrconstr t = ClassA (UnQual (Ident "Integral")) [t]
| 53
|
intrconstr t = ClassA (UnQual (Ident "Integral")) [t]
| 53
| false
| false
| 0
| 9
| 7
| 29
| 14
| 15
| null | null |
blippy/sifi
|
test/TestLexer.hs
|
gpl-3.0
|
lex01 = alexScanTokens "foo, bar baz \"fish stew for you\" \"today"
| 67
|
lex01 = alexScanTokens "foo, bar baz \"fish stew for you\" \"today"
| 67
|
lex01 = alexScanTokens "foo, bar baz \"fish stew for you\" \"today"
| 67
| false
| false
| 0
| 5
| 10
| 9
| 4
| 5
| null | null |
yesodweb/persistent
|
persistent/Database/Persist/TH.hs
|
mit
|
derivePersistFieldJSON :: String -> Q [Dec]
derivePersistFieldJSON s = do
ss <- [|SqlString|]
tpv <- [|PersistText . toJsonText|]
fpv <- [|\dt v -> do
text <- fromPersistValue v
let bs' = TE.encodeUtf8 text
case eitherDecodeStrict' bs' of
Left e -> Left $ pack "JSON decoding error for " ++ pack dt ++ pack ": " ++ pack e ++ pack ". On Input: " ++ decodeUtf8 bs'
Right x -> Right x|]
return
[ persistFieldInstanceD False (ConT $ mkName s)
[ FunD 'toPersistValue
[ normalClause [] tpv
]
, FunD 'fromPersistValue
[ normalClause [] (fpv `AppE` LitE (StringL s))
]
]
, persistFieldSqlInstanceD False (ConT $ mkName s)
[ sqlTypeFunD ss
]
]
-- | The basic function for migrating models, no Template Haskell required.
--
-- It's probably best to use this in concert with 'mkEntityDefList', and then
-- call 'migrateModels' with the result from that function.
--
-- @
-- share [mkPersist sqlSettings, mkEntityDefList "entities"] [persistLowerCase| ... |]
--
-- migrateAll = 'migrateModels' entities
-- @
--
-- The function 'mkMigrate' currently implements exactly this behavior now. If
-- you're splitting up the entity definitions into separate files, then it is
-- better to use the entity definition list and the concatenate all the models
-- together into a big list to call with 'migrateModels'.
--
-- @
-- module Foo where
--
-- share [mkPersist s, mkEntityDefList "fooModels"] ...
--
--
-- module Bar where
--
-- share [mkPersist s, mkEntityDefList "barModels"] ...
--
-- module Migration where
--
-- import Foo
-- import Bar
--
-- migrateAll = migrateModels (fooModels <> barModels)
-- @
--
-- @since 2.13.0.0
| 1,882
|
derivePersistFieldJSON :: String -> Q [Dec]
derivePersistFieldJSON s = do
ss <- [|SqlString|]
tpv <- [|PersistText . toJsonText|]
fpv <- [|\dt v -> do
text <- fromPersistValue v
let bs' = TE.encodeUtf8 text
case eitherDecodeStrict' bs' of
Left e -> Left $ pack "JSON decoding error for " ++ pack dt ++ pack ": " ++ pack e ++ pack ". On Input: " ++ decodeUtf8 bs'
Right x -> Right x|]
return
[ persistFieldInstanceD False (ConT $ mkName s)
[ FunD 'toPersistValue
[ normalClause [] tpv
]
, FunD 'fromPersistValue
[ normalClause [] (fpv `AppE` LitE (StringL s))
]
]
, persistFieldSqlInstanceD False (ConT $ mkName s)
[ sqlTypeFunD ss
]
]
-- | The basic function for migrating models, no Template Haskell required.
--
-- It's probably best to use this in concert with 'mkEntityDefList', and then
-- call 'migrateModels' with the result from that function.
--
-- @
-- share [mkPersist sqlSettings, mkEntityDefList "entities"] [persistLowerCase| ... |]
--
-- migrateAll = 'migrateModels' entities
-- @
--
-- The function 'mkMigrate' currently implements exactly this behavior now. If
-- you're splitting up the entity definitions into separate files, then it is
-- better to use the entity definition list and the concatenate all the models
-- together into a big list to call with 'migrateModels'.
--
-- @
-- module Foo where
--
-- share [mkPersist s, mkEntityDefList "fooModels"] ...
--
--
-- module Bar where
--
-- share [mkPersist s, mkEntityDefList "barModels"] ...
--
-- module Migration where
--
-- import Foo
-- import Bar
--
-- migrateAll = migrateModels (fooModels <> barModels)
-- @
--
-- @since 2.13.0.0
| 1,882
|
derivePersistFieldJSON s = do
ss <- [|SqlString|]
tpv <- [|PersistText . toJsonText|]
fpv <- [|\dt v -> do
text <- fromPersistValue v
let bs' = TE.encodeUtf8 text
case eitherDecodeStrict' bs' of
Left e -> Left $ pack "JSON decoding error for " ++ pack dt ++ pack ": " ++ pack e ++ pack ". On Input: " ++ decodeUtf8 bs'
Right x -> Right x|]
return
[ persistFieldInstanceD False (ConT $ mkName s)
[ FunD 'toPersistValue
[ normalClause [] tpv
]
, FunD 'fromPersistValue
[ normalClause [] (fpv `AppE` LitE (StringL s))
]
]
, persistFieldSqlInstanceD False (ConT $ mkName s)
[ sqlTypeFunD ss
]
]
-- | The basic function for migrating models, no Template Haskell required.
--
-- It's probably best to use this in concert with 'mkEntityDefList', and then
-- call 'migrateModels' with the result from that function.
--
-- @
-- share [mkPersist sqlSettings, mkEntityDefList "entities"] [persistLowerCase| ... |]
--
-- migrateAll = 'migrateModels' entities
-- @
--
-- The function 'mkMigrate' currently implements exactly this behavior now. If
-- you're splitting up the entity definitions into separate files, then it is
-- better to use the entity definition list and the concatenate all the models
-- together into a big list to call with 'migrateModels'.
--
-- @
-- module Foo where
--
-- share [mkPersist s, mkEntityDefList "fooModels"] ...
--
--
-- module Bar where
--
-- share [mkPersist s, mkEntityDefList "barModels"] ...
--
-- module Migration where
--
-- import Foo
-- import Bar
--
-- migrateAll = migrateModels (fooModels <> barModels)
-- @
--
-- @since 2.13.0.0
| 1,838
| false
| true
| 0
| 18
| 544
| 197
| 120
| 77
| null | null |
tjhunter/karps
|
haskell/src/Spark/IO/Internal/Json.hs
|
apache-2.0
|
{-| Declares a source of data of the given data type.
The source is not read at this point, it is just declared. It may be found to be
invalid in subsequent computations.
-}
json' :: DataType -> String -> DataFrame
json' dt p = do
rp <- resourcePath . pack $ p
let d = _jsonSourceDescription rp defaultJsonOptions
genericWithSchema' dt d
{-| Declares a source of data of the given data type.
The source is not read at this point, it is just declared.
-}
| 462
|
json' :: DataType -> String -> DataFrame
json' dt p = do
rp <- resourcePath . pack $ p
let d = _jsonSourceDescription rp defaultJsonOptions
genericWithSchema' dt d
{-| Declares a source of data of the given data type.
The source is not read at this point, it is just declared.
-}
| 287
|
json' dt p = do
rp <- resourcePath . pack $ p
let d = _jsonSourceDescription rp defaultJsonOptions
genericWithSchema' dt d
{-| Declares a source of data of the given data type.
The source is not read at this point, it is just declared.
-}
| 246
| true
| true
| 0
| 10
| 94
| 63
| 30
| 33
| null | null |
danr/hipspec
|
testsuite/prod/zeno_version/PropT20.hs
|
gpl-3.0
|
(x:xs) ++ ys = x : (xs ++ ys)
| 29
|
(x:xs) ++ ys = x : (xs ++ ys)
| 29
|
(x:xs) ++ ys = x : (xs ++ ys)
| 29
| false
| false
| 2
| 7
| 8
| 32
| 15
| 17
| null | null |
Fedjmike/ngen
|
dutch.hs
|
gpl-3.0
|
eats = verb "eet" "eten"
| 24
|
eats = verb "eet" "eten"
| 24
|
eats = verb "eet" "eten"
| 24
| false
| false
| 0
| 5
| 4
| 11
| 5
| 6
| null | null |
minad/intro
|
src/Intro.hs
|
mit
|
-- | Convert between two different 'IsList' types.
-- This function can be used instead of the 'toList' function
-- originally provided by the 'IsList' class.
convertList :: (IsList a, IsList b, Item a ~ Item b) => a -> b
convertList = fromList . toList
| 253
|
convertList :: (IsList a, IsList b, Item a ~ Item b) => a -> b
convertList = fromList . toList
| 94
|
convertList = fromList . toList
| 31
| true
| true
| 0
| 8
| 45
| 51
| 27
| 24
| null | null |
shimmercat/second-transfer
|
hs-src/SecondTransfer/Socks5/Serializers.hs
|
bsd-3-clause
|
putServerReply_Packet :: ServerReply_Packet -> U.Put
putServerReply_Packet (ServerReply_Packet _version reply_field _reserved address port) =
do
putProtocolVersion _version
putReplyField reply_field
U.putWord8 0 -- reserved
putAddressType $ iaToAddressType address
putIndicatedAddress address
U.putWord16be port
| 363
|
putServerReply_Packet :: ServerReply_Packet -> U.Put
putServerReply_Packet (ServerReply_Packet _version reply_field _reserved address port) =
do
putProtocolVersion _version
putReplyField reply_field
U.putWord8 0 -- reserved
putAddressType $ iaToAddressType address
putIndicatedAddress address
U.putWord16be port
| 363
|
putServerReply_Packet (ServerReply_Packet _version reply_field _reserved address port) =
do
putProtocolVersion _version
putReplyField reply_field
U.putWord8 0 -- reserved
putAddressType $ iaToAddressType address
putIndicatedAddress address
U.putWord16be port
| 310
| false
| true
| 0
| 8
| 81
| 79
| 34
| 45
| null | null |
tomlokhorst/bool-extras
|
examples/Monoid.hs
|
bsd-3-clause
|
xsB :: Bool -> [Int]
xsB = mwhen [1..5]
| 39
|
xsB :: Bool -> [Int]
xsB = mwhen [1..5]
| 39
|
xsB = mwhen [1..5]
| 18
| false
| true
| 0
| 8
| 8
| 32
| 15
| 17
| null | null |
ozgurakgun/Idris-dev
|
src/Idris/Core/Evaluate.hs
|
bsd-3-clause
|
isFnName :: Name -> Context -> Bool
isFnName n ctxt
= case lookupDefExact n ctxt of
Just (Function _ _) -> True
Just (Operator _ _ _) -> True
Just (CaseOp _ _ _ _ _ _) -> True
_ -> False
| 261
|
isFnName :: Name -> Context -> Bool
isFnName n ctxt
= case lookupDefExact n ctxt of
Just (Function _ _) -> True
Just (Operator _ _ _) -> True
Just (CaseOp _ _ _ _ _ _) -> True
_ -> False
| 261
|
isFnName n ctxt
= case lookupDefExact n ctxt of
Just (Function _ _) -> True
Just (Operator _ _ _) -> True
Just (CaseOp _ _ _ _ _ _) -> True
_ -> False
| 225
| false
| true
| 5
| 6
| 116
| 100
| 49
| 51
| null | null |
brendanhay/gogol
|
gogol-admin-directory/gen/Network/Google/Resource/Directory/Resources/Buildings/Patch.hs
|
mpl-2.0
|
-- | JSONP
rbpCallback :: Lens' ResourcesBuildingsPatch (Maybe Text)
rbpCallback
= lens _rbpCallback (\ s a -> s{_rbpCallback = a})
| 133
|
rbpCallback :: Lens' ResourcesBuildingsPatch (Maybe Text)
rbpCallback
= lens _rbpCallback (\ s a -> s{_rbpCallback = a})
| 122
|
rbpCallback
= lens _rbpCallback (\ s a -> s{_rbpCallback = a})
| 64
| true
| true
| 0
| 9
| 21
| 48
| 25
| 23
| null | null |
rayl/xmonad-config
|
lib/XMonad/Config/Rayl/Keymaps.hs
|
bsd-3-clause
|
openChrome = spawn "google-chrome"
| 40
|
openChrome = spawn "google-chrome"
| 40
|
openChrome = spawn "google-chrome"
| 40
| false
| false
| 0
| 5
| 9
| 9
| 4
| 5
| null | null |
felipeZ/Dynamics
|
src/Main.hs
|
bsd-3-clause
|
processMolcasTinker :: Options -> IO ()
processMolcasTinker opts = molcasTinker opts Nothing
| 92
|
processMolcasTinker :: Options -> IO ()
processMolcasTinker opts = molcasTinker opts Nothing
| 92
|
processMolcasTinker opts = molcasTinker opts Nothing
| 52
| false
| true
| 0
| 7
| 11
| 28
| 13
| 15
| null | null |
ekmett/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
|
lgpl-2.1
|
wxSYS_SCREEN_SMALL :: Int
wxSYS_SCREEN_SMALL = 3
| 48
|
wxSYS_SCREEN_SMALL :: Int
wxSYS_SCREEN_SMALL = 3
| 48
|
wxSYS_SCREEN_SMALL = 3
| 22
| false
| true
| 0
| 6
| 5
| 18
| 7
| 11
| null | null |
TomMD/ghc
|
compiler/typecheck/TcRnTypes.hs
|
bsd-3-clause
|
pprCtO DoOrigin = ptext (sLit "a do statement")
| 60
|
pprCtO DoOrigin = ptext (sLit "a do statement")
| 60
|
pprCtO DoOrigin = ptext (sLit "a do statement")
| 60
| false
| false
| 0
| 7
| 20
| 19
| 8
| 11
| null | null |
Hrothen/Hubert
|
src/Layout.hs
|
mit
|
paddingBox :: Dimensions -> Rect
paddingBox d = (d^.content) `expandedBy` (d^.padding)
| 86
|
paddingBox :: Dimensions -> Rect
paddingBox d = (d^.content) `expandedBy` (d^.padding)
| 86
|
paddingBox d = (d^.content) `expandedBy` (d^.padding)
| 53
| false
| true
| 0
| 8
| 10
| 44
| 22
| 22
| null | null |
printedheart/Dao
|
src/Dao/Object.hs
|
agpl-3.0
|
decodeTree :: Word8 -> Get (T.Tree Simple Simple)
decodeTree w = let f = decodeMap (getWord8 >>= decodeTree) in case w of
9 -> T.Tree . (,) Nothing <$> f
10 -> T.Tree <$> ((,) <$> (Just <$> get) <*> f)
_ -> _tree_err
| 224
|
decodeTree :: Word8 -> Get (T.Tree Simple Simple)
decodeTree w = let f = decodeMap (getWord8 >>= decodeTree) in case w of
9 -> T.Tree . (,) Nothing <$> f
10 -> T.Tree <$> ((,) <$> (Just <$> get) <*> f)
_ -> _tree_err
| 224
|
decodeTree w = let f = decodeMap (getWord8 >>= decodeTree) in case w of
9 -> T.Tree . (,) Nothing <$> f
10 -> T.Tree <$> ((,) <$> (Just <$> get) <*> f)
_ -> _tree_err
| 174
| false
| true
| 0
| 15
| 51
| 122
| 60
| 62
| null | null |
fcostantini/QuickFuzz
|
src/SimpleSvg.hs
|
gpl-3.0
|
genName :: Gen String
genName = listOf1 validChars :: Gen String
where validChars = chr <$> choose (97, 122)
| 110
|
genName :: Gen String
genName = listOf1 validChars :: Gen String
where validChars = chr <$> choose (97, 122)
| 110
|
genName = listOf1 validChars :: Gen String
where validChars = chr <$> choose (97, 122)
| 88
| false
| true
| 0
| 7
| 20
| 44
| 22
| 22
| null | null |
AndreasVoellmy/nettle-openflow
|
src/Network/Data/OpenFlow/MatchBuilder.hs
|
bsd-3-clause
|
(.==.) :: Attribute a -> a -> MatchBuilder
(.==.) VLAN_ID vid = vlan_id_ vid
| 76
|
(.==.) :: Attribute a -> a -> MatchBuilder
(.==.) VLAN_ID vid = vlan_id_ vid
| 76
|
(.==.) VLAN_ID vid = vlan_id_ vid
| 33
| false
| true
| 0
| 6
| 13
| 34
| 18
| 16
| null | null |
xymostech/tex-parser
|
src/TeX/Parser/Conditional.hs
|
mit
|
runConditionalBody expand False = do
ignoreUntil (elseToken <|> fiToken)
((fiToken >> return []) <|>
(elseToken >> expandUntil expand fiToken <* fiToken))
| 161
|
runConditionalBody expand False = do
ignoreUntil (elseToken <|> fiToken)
((fiToken >> return []) <|>
(elseToken >> expandUntil expand fiToken <* fiToken))
| 161
|
runConditionalBody expand False = do
ignoreUntil (elseToken <|> fiToken)
((fiToken >> return []) <|>
(elseToken >> expandUntil expand fiToken <* fiToken))
| 161
| false
| false
| 0
| 12
| 27
| 62
| 30
| 32
| null | null |
beni55/haste-compiler
|
libraries/ghc-7.10/ghc-prim/GHC/Prim.hs
|
bsd-3-clause
|
-- | Write a vector to specified index of mutable array.
writeInt32X16Array# :: MutableByteArray# s -> Int# -> Int32X16# -> State# s -> State# s
writeInt32X16Array# = let x = x in x
| 183
|
writeInt32X16Array# :: MutableByteArray# s -> Int# -> Int32X16# -> State# s -> State# s
writeInt32X16Array# = let x = x in x
| 124
|
writeInt32X16Array# = let x = x in x
| 36
| true
| true
| 0
| 10
| 34
| 54
| 24
| 30
| null | null |
sherwoodwang/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
|
lgpl-2.1
|
wxSTC_MAKE_IDENTIFIER :: Int
wxSTC_MAKE_IDENTIFIER = 3
| 54
|
wxSTC_MAKE_IDENTIFIER :: Int
wxSTC_MAKE_IDENTIFIER = 3
| 54
|
wxSTC_MAKE_IDENTIFIER = 3
| 25
| false
| true
| 0
| 6
| 5
| 18
| 7
| 11
| null | null |
anton-dessiatov/stack
|
src/Stack/Setup/Installed.hs
|
bsd-3-clause
|
getCompilerVersion
:: HasEnvOverride env
=> WhichCompiler
-> RIO env (CompilerVersion 'CVActual)
getCompilerVersion wc =
case wc of
Ghc -> do
logDebug "Asking GHC for its version"
bs <- withProc "ghc" ["--numeric-version"] readProcessStdout_
let (_, ghcVersion) = versionFromEnd $ BL.toStrict bs
x <- GhcVersion <$> parseVersion (T.decodeUtf8 ghcVersion)
logDebug $ "GHC version is: " <> compilerVersionText x
return x
Ghcjs -> do
logDebug "Asking GHCJS for its version"
-- Output looks like
--
-- The Glorious Glasgow Haskell Compilation System for JavaScript, version 0.1.0 (GHC 7.10.2)
bs <- withProc "ghcjs" ["--version"] readProcessStdout_
let (rest, ghcVersion) = T.decodeUtf8 <$> versionFromEnd (BL.toStrict bs)
(_, ghcjsVersion) = T.decodeUtf8 <$> versionFromEnd rest
GhcjsVersion <$> parseVersion ghcjsVersion <*> parseVersion ghcVersion
where
versionFromEnd = S8.spanEnd isValid . fst . S8.breakEnd isValid
isValid c = c == '.' || ('0' <= c && c <= '9')
-- | Binary directories for the given installed package
| 1,228
|
getCompilerVersion
:: HasEnvOverride env
=> WhichCompiler
-> RIO env (CompilerVersion 'CVActual)
getCompilerVersion wc =
case wc of
Ghc -> do
logDebug "Asking GHC for its version"
bs <- withProc "ghc" ["--numeric-version"] readProcessStdout_
let (_, ghcVersion) = versionFromEnd $ BL.toStrict bs
x <- GhcVersion <$> parseVersion (T.decodeUtf8 ghcVersion)
logDebug $ "GHC version is: " <> compilerVersionText x
return x
Ghcjs -> do
logDebug "Asking GHCJS for its version"
-- Output looks like
--
-- The Glorious Glasgow Haskell Compilation System for JavaScript, version 0.1.0 (GHC 7.10.2)
bs <- withProc "ghcjs" ["--version"] readProcessStdout_
let (rest, ghcVersion) = T.decodeUtf8 <$> versionFromEnd (BL.toStrict bs)
(_, ghcjsVersion) = T.decodeUtf8 <$> versionFromEnd rest
GhcjsVersion <$> parseVersion ghcjsVersion <*> parseVersion ghcVersion
where
versionFromEnd = S8.spanEnd isValid . fst . S8.breakEnd isValid
isValid c = c == '.' || ('0' <= c && c <= '9')
-- | Binary directories for the given installed package
| 1,228
|
getCompilerVersion wc =
case wc of
Ghc -> do
logDebug "Asking GHC for its version"
bs <- withProc "ghc" ["--numeric-version"] readProcessStdout_
let (_, ghcVersion) = versionFromEnd $ BL.toStrict bs
x <- GhcVersion <$> parseVersion (T.decodeUtf8 ghcVersion)
logDebug $ "GHC version is: " <> compilerVersionText x
return x
Ghcjs -> do
logDebug "Asking GHCJS for its version"
-- Output looks like
--
-- The Glorious Glasgow Haskell Compilation System for JavaScript, version 0.1.0 (GHC 7.10.2)
bs <- withProc "ghcjs" ["--version"] readProcessStdout_
let (rest, ghcVersion) = T.decodeUtf8 <$> versionFromEnd (BL.toStrict bs)
(_, ghcjsVersion) = T.decodeUtf8 <$> versionFromEnd rest
GhcjsVersion <$> parseVersion ghcjsVersion <*> parseVersion ghcVersion
where
versionFromEnd = S8.spanEnd isValid . fst . S8.breakEnd isValid
isValid c = c == '.' || ('0' <= c && c <= '9')
-- | Binary directories for the given installed package
| 1,125
| false
| true
| 1
| 17
| 355
| 304
| 143
| 161
| null | null |
jtanguy/shogi
|
src/Main.hs
|
bsd-3-clause
|
-- initialSFEN = "7r1/6B1p/6Bsk/9/7P1/9/9/9/9 B 2S"
main :: IO ()
main = case parseString sfen mempty initialSFEN of
Failure xs -> putDoc xs
Success g -> runCurses $ do
setEcho False
w <- defaultWindow
_ <- runRWST mainLoop w (UIState g (0,0))
return ()
| 294
|
main :: IO ()
main = case parseString sfen mempty initialSFEN of
Failure xs -> putDoc xs
Success g -> runCurses $ do
setEcho False
w <- defaultWindow
_ <- runRWST mainLoop w (UIState g (0,0))
return ()
| 241
|
main = case parseString sfen mempty initialSFEN of
Failure xs -> putDoc xs
Success g -> runCurses $ do
setEcho False
w <- defaultWindow
_ <- runRWST mainLoop w (UIState g (0,0))
return ()
| 227
| true
| true
| 0
| 15
| 84
| 102
| 47
| 55
| null | null |
ComputationWithBoundedResources/ara-inference
|
doc/tpdb_trs/Haskell/basic_haskell/showSigned_1.hs
|
mit
|
esEsOrdering EQ EQ = MyTrue
| 27
|
esEsOrdering EQ EQ = MyTrue
| 27
|
esEsOrdering EQ EQ = MyTrue
| 27
| false
| false
| 1
| 5
| 4
| 16
| 5
| 11
| null | null |
sseefried/shady-gen
|
src/Shady/Language/Operator.hs
|
agpl-3.0
|
one1 :: (a -> b) -> a -> Vec1 b
one1 = result vec1
| 50
|
one1 :: (a -> b) -> a -> Vec1 b
one1 = result vec1
| 50
|
one1 = result vec1
| 18
| false
| true
| 0
| 7
| 13
| 32
| 16
| 16
| null | null |
muspellsson/hiccup
|
Core.hs
|
lgpl-2.1
|
subst :: SubstArgs -> BString -> TclM BString
subst sargs str = do
lst <- elift $ parseSubst sargs str
getSubsts lst >>= return . B.concat
where
endIfErr f ef = f `catchError` (\e -> if toEnum (errCode e) == ef then return [] else throwError e)
getSubsts [] = return []
getSubsts (x:xs) = good `endIfErr` EBreak
where good = do fx <- f x
fxs <- getSubsts xs
return (fx:fxs)
elift x = case x of
Left e -> tclErr e
Right (v,_) -> return v
handleCmdErrs f = f `catchError` handler
where handler e = case toEnum (errCode e) of
EReturn -> return (errData e)
EContinue -> return T.empty
_ -> throwError e
f x = case x of
SStr s -> return s
SCmd c -> handleCmdErrs (runCmds (subCmdToCmds c)) >>= return . T.asBStr
SVar v -> do
val <- case parseVarName v of
NSQual ns (VarName n (Just ind)) ->
subst allSubstArgs ind >>= \i2 -> varGetNS (NSQual ns (arrName n i2))
vn -> varGetNS vn
return (T.asBStr val)
| 1,262
|
subst :: SubstArgs -> BString -> TclM BString
subst sargs str = do
lst <- elift $ parseSubst sargs str
getSubsts lst >>= return . B.concat
where
endIfErr f ef = f `catchError` (\e -> if toEnum (errCode e) == ef then return [] else throwError e)
getSubsts [] = return []
getSubsts (x:xs) = good `endIfErr` EBreak
where good = do fx <- f x
fxs <- getSubsts xs
return (fx:fxs)
elift x = case x of
Left e -> tclErr e
Right (v,_) -> return v
handleCmdErrs f = f `catchError` handler
where handler e = case toEnum (errCode e) of
EReturn -> return (errData e)
EContinue -> return T.empty
_ -> throwError e
f x = case x of
SStr s -> return s
SCmd c -> handleCmdErrs (runCmds (subCmdToCmds c)) >>= return . T.asBStr
SVar v -> do
val <- case parseVarName v of
NSQual ns (VarName n (Just ind)) ->
subst allSubstArgs ind >>= \i2 -> varGetNS (NSQual ns (arrName n i2))
vn -> varGetNS vn
return (T.asBStr val)
| 1,262
|
subst sargs str = do
lst <- elift $ parseSubst sargs str
getSubsts lst >>= return . B.concat
where
endIfErr f ef = f `catchError` (\e -> if toEnum (errCode e) == ef then return [] else throwError e)
getSubsts [] = return []
getSubsts (x:xs) = good `endIfErr` EBreak
where good = do fx <- f x
fxs <- getSubsts xs
return (fx:fxs)
elift x = case x of
Left e -> tclErr e
Right (v,_) -> return v
handleCmdErrs f = f `catchError` handler
where handler e = case toEnum (errCode e) of
EReturn -> return (errData e)
EContinue -> return T.empty
_ -> throwError e
f x = case x of
SStr s -> return s
SCmd c -> handleCmdErrs (runCmds (subCmdToCmds c)) >>= return . T.asBStr
SVar v -> do
val <- case parseVarName v of
NSQual ns (VarName n (Just ind)) ->
subst allSubstArgs ind >>= \i2 -> varGetNS (NSQual ns (arrName n i2))
vn -> varGetNS vn
return (T.asBStr val)
| 1,216
| false
| true
| 0
| 20
| 540
| 467
| 223
| 244
| null | null |
andyarvanitis/Idris-dev
|
src/Idris/WhoCalls.hs
|
bsd-3-clause
|
occurs :: Name -> Term -> Bool
occurs n (P Bound _ _) = False
| 61
|
occurs :: Name -> Term -> Bool
occurs n (P Bound _ _) = False
| 61
|
occurs n (P Bound _ _) = False
| 30
| false
| true
| 0
| 7
| 14
| 34
| 17
| 17
| null | null |
jacekszymanski/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
|
lgpl-2.1
|
wxTR_EXTENDED :: Int
wxTR_EXTENDED = 64
| 39
|
wxTR_EXTENDED :: Int
wxTR_EXTENDED = 64
| 39
|
wxTR_EXTENDED = 64
| 18
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
Danten/lejf
|
src/Types/Errors.hs
|
bsd-3-clause
|
ptText (PT_Proj p) = Pretty.pprint p
| 38
|
ptText (PT_Proj p) = Pretty.pprint p
| 38
|
ptText (PT_Proj p) = Pretty.pprint p
| 38
| false
| false
| 0
| 7
| 7
| 20
| 9
| 11
| null | null |
brendanhay/gogol
|
gogol-healthcare/gen/Network/Google/Resource/Healthcare/Projects/Locations/DataSets/DicomStores/Patch.hs
|
mpl-2.0
|
-- | OAuth access token.
pldsdspAccessToken :: Lens' ProjectsLocationsDataSetsDicomStoresPatch (Maybe Text)
pldsdspAccessToken
= lens _pldsdspAccessToken
(\ s a -> s{_pldsdspAccessToken = a})
| 199
|
pldsdspAccessToken :: Lens' ProjectsLocationsDataSetsDicomStoresPatch (Maybe Text)
pldsdspAccessToken
= lens _pldsdspAccessToken
(\ s a -> s{_pldsdspAccessToken = a})
| 174
|
pldsdspAccessToken
= lens _pldsdspAccessToken
(\ s a -> s{_pldsdspAccessToken = a})
| 91
| true
| true
| 0
| 9
| 29
| 48
| 25
| 23
| null | null |
meiersi/scyther-proof
|
src/Extension/Prelude.hs
|
gpl-3.0
|
-- | //O(n*log n).// Sort list and remove duplicates with respect to a
-- projection.
sortednubOn :: Ord b => (a -> b) -> [a] -> [a]
sortednubOn proj = map head . groupOn proj . sortOn proj
| 189
|
sortednubOn :: Ord b => (a -> b) -> [a] -> [a]
sortednubOn proj = map head . groupOn proj . sortOn proj
| 103
|
sortednubOn proj = map head . groupOn proj . sortOn proj
| 56
| true
| true
| 1
| 10
| 37
| 67
| 32
| 35
| null | null |
glguy/hpaste
|
src/Storage.hs
|
bsd-3-clause
|
addAnnotations :: Int -> [Int] -> StoreM ()
addAnnotations pid ls =
forM_ ls $ \l ->
execSM sql (pid, l)
where
sql = "REPLACE INTO annotation (pasteid,line) VALUES (?,?)"
------------------------------------------------------------------------
-- Writing a new paste
| 278
|
addAnnotations :: Int -> [Int] -> StoreM ()
addAnnotations pid ls =
forM_ ls $ \l ->
execSM sql (pid, l)
where
sql = "REPLACE INTO annotation (pasteid,line) VALUES (?,?)"
------------------------------------------------------------------------
-- Writing a new paste
| 278
|
addAnnotations pid ls =
forM_ ls $ \l ->
execSM sql (pid, l)
where
sql = "REPLACE INTO annotation (pasteid,line) VALUES (?,?)"
------------------------------------------------------------------------
-- Writing a new paste
| 234
| false
| true
| 3
| 9
| 47
| 75
| 35
| 40
| null | null |
Brightgalrs/con-lang-gen
|
src/Constants.hs
|
mit
|
phonationDistance VOICELESS STIFF = 4
| 37
|
phonationDistance VOICELESS STIFF = 4
| 37
|
phonationDistance VOICELESS STIFF = 4
| 37
| false
| false
| 0
| 5
| 4
| 11
| 5
| 6
| null | null |
joelchelliah/rock-paper-scissors-hs
|
src/Printer.hs
|
bsd-3-clause
|
weaponsSelection :: GameMode -> IO ()
weaponsSelection gameMode = let numberWeapon wpn num = show num ++ ". " ++ show wpn
weapons = weaponsIn gameMode
numbered = zipWith numberWeapon weapons [1..]
formatted = indent . padRight <$> numbered
in printText $ ("<> " ++ show gameMode ++ " <>")
: divider
: "- Choose your weapon -"
: divider
: formatted
| 638
|
weaponsSelection :: GameMode -> IO ()
weaponsSelection gameMode = let numberWeapon wpn num = show num ++ ". " ++ show wpn
weapons = weaponsIn gameMode
numbered = zipWith numberWeapon weapons [1..]
formatted = indent . padRight <$> numbered
in printText $ ("<> " ++ show gameMode ++ " <>")
: divider
: "- Choose your weapon -"
: divider
: formatted
| 638
|
weaponsSelection gameMode = let numberWeapon wpn num = show num ++ ". " ++ show wpn
weapons = weaponsIn gameMode
numbered = zipWith numberWeapon weapons [1..]
formatted = indent . padRight <$> numbered
in printText $ ("<> " ++ show gameMode ++ " <>")
: divider
: "- Choose your weapon -"
: divider
: formatted
| 600
| false
| true
| 0
| 15
| 352
| 123
| 60
| 63
| null | null |
TomMD/ghc
|
compiler/typecheck/TcRnTypes.hs
|
bsd-3-clause
|
pprSkolInfo (InferSkol ids) = sep [ ptext (sLit "the inferred type of")
, vcat [ ppr name <+> dcolon <+> ppr ty
| (name,ty) <- ids ]]
| 214
|
pprSkolInfo (InferSkol ids) = sep [ ptext (sLit "the inferred type of")
, vcat [ ppr name <+> dcolon <+> ppr ty
| (name,ty) <- ids ]]
| 214
|
pprSkolInfo (InferSkol ids) = sep [ ptext (sLit "the inferred type of")
, vcat [ ppr name <+> dcolon <+> ppr ty
| (name,ty) <- ids ]]
| 214
| false
| false
| 0
| 11
| 107
| 68
| 33
| 35
| null | null |
facebookincubator/duckling
|
Duckling/Time/EN/Corpus.hs
|
bsd-3-clause
|
diffContext :: Context
diffContext = Context
{ locale = makeLocale EN Nothing
, referenceTime = refTime (2013, 2, 15, 4, 30, 0) (-2)
}
| 140
|
diffContext :: Context
diffContext = Context
{ locale = makeLocale EN Nothing
, referenceTime = refTime (2013, 2, 15, 4, 30, 0) (-2)
}
| 140
|
diffContext = Context
{ locale = makeLocale EN Nothing
, referenceTime = refTime (2013, 2, 15, 4, 30, 0) (-2)
}
| 117
| false
| true
| 0
| 10
| 29
| 62
| 35
| 27
| null | null |
pmiddend/vdvanalyze
|
src/Vdv/Filter.hs
|
gpl-3.0
|
parseFilters :: Text -> Either String [Filter]
parseFilters t = AP.parseOnly filterParser t
| 91
|
parseFilters :: Text -> Either String [Filter]
parseFilters t = AP.parseOnly filterParser t
| 91
|
parseFilters t = AP.parseOnly filterParser t
| 44
| false
| true
| 0
| 8
| 12
| 38
| 17
| 21
| null | null |
roberth/uu-helium
|
test/typeClassesParse/CorrectEmptyWhere.hs
|
gpl-3.0
|
g :: Int -> Int
g _ = 0
| 24
|
g :: Int -> Int
g _ = 0
| 23
|
g _ = 0
| 7
| false
| true
| 0
| 5
| 9
| 22
| 10
| 12
| null | null |
kim/amazonka
|
amazonka-ec2/gen/Network/AWS/EC2/Types.hs
|
mpl-2.0
|
-- | The private IP addresses associated with the network interface.
iniPrivateIpAddresses :: Lens' InstanceNetworkInterface [InstancePrivateIpAddress]
iniPrivateIpAddresses =
lens _iniPrivateIpAddresses (\s a -> s { _iniPrivateIpAddresses = a })
. _List
| 266
|
iniPrivateIpAddresses :: Lens' InstanceNetworkInterface [InstancePrivateIpAddress]
iniPrivateIpAddresses =
lens _iniPrivateIpAddresses (\s a -> s { _iniPrivateIpAddresses = a })
. _List
| 197
|
iniPrivateIpAddresses =
lens _iniPrivateIpAddresses (\s a -> s { _iniPrivateIpAddresses = a })
. _List
| 114
| true
| true
| 2
| 8
| 42
| 54
| 26
| 28
| null | null |
atsukotakahashi/wi
|
src/library/Yi/UI/Pango/Layouts.hs
|
gpl-2.0
|
sameLayout :: LayoutImpl -> Layout Widget -> Bool
sameLayout (SingleWindowI w) (SingleWindow w') = w == w'
| 106
|
sameLayout :: LayoutImpl -> Layout Widget -> Bool
sameLayout (SingleWindowI w) (SingleWindow w') = w == w'
| 106
|
sameLayout (SingleWindowI w) (SingleWindow w') = w == w'
| 56
| false
| true
| 0
| 7
| 16
| 43
| 21
| 22
| null | null |
tsiliakis/xmobar
|
src/Plugins/Monitors/Mem.hs
|
bsd-3-clause
|
memConfig :: IO MConfig
memConfig = mkMConfig
"Mem: <usedratio>% (<cache>M)" -- template
["usedbar", "freebar", "usedratio", "freeratio", "total",
"free", "buffer", "cache", "rest", "used"]
| 211
|
memConfig :: IO MConfig
memConfig = mkMConfig
"Mem: <usedratio>% (<cache>M)" -- template
["usedbar", "freebar", "usedratio", "freeratio", "total",
"free", "buffer", "cache", "rest", "used"]
| 211
|
memConfig = mkMConfig
"Mem: <usedratio>% (<cache>M)" -- template
["usedbar", "freebar", "usedratio", "freeratio", "total",
"free", "buffer", "cache", "rest", "used"]
| 187
| false
| true
| 0
| 6
| 43
| 50
| 30
| 20
| null | null |
spetz911/progames
|
vinyl-gl-master/examples/src/Keyboard2D.hs
|
mit
|
-- | Evaluate a boolean formula in conjunctive normal form (CNF) by
-- applying the predicate to each atom according to the logic of its
-- nesting in the formula.
cnf :: (Foldable s, Foldable t) => s (t Bool) -> Bool
cnf = getAll . foldMap (All . getAny . foldMap Any)
| 269
|
cnf :: (Foldable s, Foldable t) => s (t Bool) -> Bool
cnf = getAll . foldMap (All . getAny . foldMap Any)
| 105
|
cnf = getAll . foldMap (All . getAny . foldMap Any)
| 51
| true
| true
| 1
| 10
| 52
| 70
| 34
| 36
| null | null |
GaloisInc/halvm-ghc
|
compiler/utils/Util.hs
|
bsd-3-clause
|
firstM :: Monad m => (a -> m c) -> (a, b) -> m (c, b)
firstM f (x, y) = liftM (\x' -> (x', y)) (f x)
| 100
|
firstM :: Monad m => (a -> m c) -> (a, b) -> m (c, b)
firstM f (x, y) = liftM (\x' -> (x', y)) (f x)
| 100
|
firstM f (x, y) = liftM (\x' -> (x', y)) (f x)
| 46
| false
| true
| 0
| 9
| 27
| 87
| 47
| 40
| null | null |
szatkus/haste-compiler
|
libraries/haste-lib/src/Haste/Parsing.hs
|
bsd-3-clause
|
-- | Parse a non-negative floating point number.
positiveDouble :: Parse Double
positiveDouble = do
first <- atLeast 1 $ charP isDigit
msecond <- possibly $ char '.' *> atLeast 1 (charP isDigit)
case msecond of
Just second -> return $ read $ first ++ "." ++ second
_ -> return $ read first
-- | Fail on unwanted input.
| 343
|
positiveDouble :: Parse Double
positiveDouble = do
first <- atLeast 1 $ charP isDigit
msecond <- possibly $ char '.' *> atLeast 1 (charP isDigit)
case msecond of
Just second -> return $ read $ first ++ "." ++ second
_ -> return $ read first
-- | Fail on unwanted input.
| 294
|
positiveDouble = do
first <- atLeast 1 $ charP isDigit
msecond <- possibly $ char '.' *> atLeast 1 (charP isDigit)
case msecond of
Just second -> return $ read $ first ++ "." ++ second
_ -> return $ read first
-- | Fail on unwanted input.
| 263
| true
| true
| 0
| 14
| 84
| 113
| 51
| 62
| null | null |
alexander-at-github/eta
|
compiler/ETA/SimplCore/SetLevels.hs
|
bsd-3-clause
|
-- Going all the way to top level
----------------------------------------------------
-- Three help functions for the type-abstraction case
lvlFloatRhs :: [OutVar] -> Level -> LevelEnv -> CoreExprWithFVs
-> UniqSM (Expr LevelledBndr)
lvlFloatRhs abs_vars dest_lvl env rhs
= do { rhs' <- lvlExpr rhs_env rhs
; return (mkLams abs_vars_w_lvls rhs') }
where
(rhs_env, abs_vars_w_lvls) = lvlLamBndrs env dest_lvl abs_vars
{-
************************************************************************
* *
\subsection{Deciding floatability}
* *
************************************************************************
-}
| 780
|
lvlFloatRhs :: [OutVar] -> Level -> LevelEnv -> CoreExprWithFVs
-> UniqSM (Expr LevelledBndr)
lvlFloatRhs abs_vars dest_lvl env rhs
= do { rhs' <- lvlExpr rhs_env rhs
; return (mkLams abs_vars_w_lvls rhs') }
where
(rhs_env, abs_vars_w_lvls) = lvlLamBndrs env dest_lvl abs_vars
{-
************************************************************************
* *
\subsection{Deciding floatability}
* *
************************************************************************
-}
| 637
|
lvlFloatRhs abs_vars dest_lvl env rhs
= do { rhs' <- lvlExpr rhs_env rhs
; return (mkLams abs_vars_w_lvls rhs') }
where
(rhs_env, abs_vars_w_lvls) = lvlLamBndrs env dest_lvl abs_vars
{-
************************************************************************
* *
\subsection{Deciding floatability}
* *
************************************************************************
-}
| 531
| true
| true
| 0
| 12
| 234
| 107
| 54
| 53
| null | null |
biegunka/biegunka-archive
|
tests/tar/Main.hs
|
mit
|
compressed :: Test
compressed = TestCase $ do
-- Uncompress and unpack gzipped tar archive and check layout is correct
helper "/tmp" bgz l []
-- Delete everything
helper "/tmp" b' l'
[ DE doesNotExistErrorType "tar/test"
]
-- Uncompress and unpack bzipped tar archive and check layout is correct
helper "/tmp" bbz2 l []
-- Delete everything
helper "/tmp" b' l'
[ DE doesNotExistErrorType "tar/test"
]
where
bgz =
tar_ "http://budueba.com/biegunka-tar-test.tar.gz" "tar/test"
bbz2 =
tar_ "http://budueba.com/biegunka-tar-test.tar.bz2" "tar/test"
l = do
directory "tar" $
directory "test" $ do
directory "x" $ do
directory "y" $ do
file "s" "test1\n"
file "t" "test2\n"
directory "z" $
file_ "v"
directory "w" $
file_ "u"
file_ "q"
directory ".biegunka" $
directory_ "groups"
b' = return ()
l' = do
directory "tar" $
directory_ "test"
directory ".biegunka" $
directory_ "groups"
| 1,058
|
compressed :: Test
compressed = TestCase $ do
-- Uncompress and unpack gzipped tar archive and check layout is correct
helper "/tmp" bgz l []
-- Delete everything
helper "/tmp" b' l'
[ DE doesNotExistErrorType "tar/test"
]
-- Uncompress and unpack bzipped tar archive and check layout is correct
helper "/tmp" bbz2 l []
-- Delete everything
helper "/tmp" b' l'
[ DE doesNotExistErrorType "tar/test"
]
where
bgz =
tar_ "http://budueba.com/biegunka-tar-test.tar.gz" "tar/test"
bbz2 =
tar_ "http://budueba.com/biegunka-tar-test.tar.bz2" "tar/test"
l = do
directory "tar" $
directory "test" $ do
directory "x" $ do
directory "y" $ do
file "s" "test1\n"
file "t" "test2\n"
directory "z" $
file_ "v"
directory "w" $
file_ "u"
file_ "q"
directory ".biegunka" $
directory_ "groups"
b' = return ()
l' = do
directory "tar" $
directory_ "test"
directory ".biegunka" $
directory_ "groups"
| 1,058
|
compressed = TestCase $ do
-- Uncompress and unpack gzipped tar archive and check layout is correct
helper "/tmp" bgz l []
-- Delete everything
helper "/tmp" b' l'
[ DE doesNotExistErrorType "tar/test"
]
-- Uncompress and unpack bzipped tar archive and check layout is correct
helper "/tmp" bbz2 l []
-- Delete everything
helper "/tmp" b' l'
[ DE doesNotExistErrorType "tar/test"
]
where
bgz =
tar_ "http://budueba.com/biegunka-tar-test.tar.gz" "tar/test"
bbz2 =
tar_ "http://budueba.com/biegunka-tar-test.tar.bz2" "tar/test"
l = do
directory "tar" $
directory "test" $ do
directory "x" $ do
directory "y" $ do
file "s" "test1\n"
file "t" "test2\n"
directory "z" $
file_ "v"
directory "w" $
file_ "u"
file_ "q"
directory ".biegunka" $
directory_ "groups"
b' = return ()
l' = do
directory "tar" $
directory_ "test"
directory ".biegunka" $
directory_ "groups"
| 1,039
| false
| true
| 1
| 16
| 316
| 258
| 112
| 146
| null | null |
fegies/pseudocodeCompiler
|
src/Main.hs
|
bsd-3-clause
|
--main = getContents >>= print . parsePSC . lexer
main = getArgs >>= parseArgs
| 80
|
main = getArgs >>= parseArgs
| 28
|
main = getArgs >>= parseArgs
| 28
| true
| false
| 3
| 5
| 15
| 17
| 7
| 10
| null | null |
sdiehl/ghc
|
hadrian/src/Settings/Builders/Common.hs
|
bsd-3-clause
|
packageDatabaseArgs :: Args
packageDatabaseArgs = do
stage <- getStage
dbPath <- expr (packageDbPath stage)
expr (need [dbPath -/- packageDbStamp])
prefix <- ifM (builder Ghc) (return "-package-db ") (return "--package-db=")
arg $ prefix ++ dbPath
| 267
|
packageDatabaseArgs :: Args
packageDatabaseArgs = do
stage <- getStage
dbPath <- expr (packageDbPath stage)
expr (need [dbPath -/- packageDbStamp])
prefix <- ifM (builder Ghc) (return "-package-db ") (return "--package-db=")
arg $ prefix ++ dbPath
| 267
|
packageDatabaseArgs = do
stage <- getStage
dbPath <- expr (packageDbPath stage)
expr (need [dbPath -/- packageDbStamp])
prefix <- ifM (builder Ghc) (return "-package-db ") (return "--package-db=")
arg $ prefix ++ dbPath
| 239
| false
| true
| 0
| 11
| 53
| 103
| 46
| 57
| null | null |
Andrey-Sisoyev/haskell-PCLT
|
Text/PCLT/Parser/ParserInternals.hs
|
lgpl-2.1
|
many1 :: Parser a -> Parser [a]
many1 !p = do x <- p
xs <- many p
return (x:xs)
| 108
|
many1 :: Parser a -> Parser [a]
many1 !p = do x <- p
xs <- many p
return (x:xs)
| 108
|
many1 !p = do x <- p
xs <- many p
return (x:xs)
| 76
| false
| true
| 0
| 9
| 48
| 62
| 27
| 35
| null | null |
cfredric/arithmoi
|
Math/NumberTheory/Moduli/Class.hs
|
mit
|
liftBinOp
:: (forall k. KnownNat k => Mod k -> Mod k -> Mod k)
-> (Rational -> Rational -> Rational)
-> SomeMod
-> SomeMod
-> SomeMod
liftBinOp _ fr (InfMod rx) (InfMod ry) = InfMod (rx `fr` ry)
| 207
|
liftBinOp
:: (forall k. KnownNat k => Mod k -> Mod k -> Mod k)
-> (Rational -> Rational -> Rational)
-> SomeMod
-> SomeMod
-> SomeMod
liftBinOp _ fr (InfMod rx) (InfMod ry) = InfMod (rx `fr` ry)
| 207
|
liftBinOp _ fr (InfMod rx) (InfMod ry) = InfMod (rx `fr` ry)
| 63
| false
| true
| 0
| 12
| 51
| 108
| 53
| 55
| null | null |
snoyberg/ghc
|
compiler/nativeGen/RegAlloc/Graph/SpillClean.hs
|
bsd-3-clause
|
ntersects assocs = foldl1' intersectAssoc assocs
| 55
|
intersects assocs = foldl1' intersectAssoc assocs
| 55
|
intersects assocs = foldl1' intersectAssoc assocs
| 55
| false
| false
| 0
| 5
| 12
| 14
| 6
| 8
| null | null |
danr/hipspec
|
examples/old-examples/hip/Integers.hs
|
gpl-3.0
|
x *. (S y) = (x *. y) +. x
| 26
|
x *. (S y) = (x *. y) +. x
| 26
|
x *. (S y) = (x *. y) +. x
| 26
| false
| false
| 3
| 6
| 9
| 31
| 14
| 17
| null | null |
cchantep/dhek
|
Dhek/Action.hs
|
gpl-3.0
|
onNext :: Instr ()
onNext
= do incrPage
i <- getCurrentPage
nb <- getPageCount
name <- getFilename
setTitle (name ++ " (page " ++ show i ++ " / " ++ show nb ++ ")")
draw
--------------------------------------------------------------------------------
| 305
|
onNext :: Instr ()
onNext
= do incrPage
i <- getCurrentPage
nb <- getPageCount
name <- getFilename
setTitle (name ++ " (page " ++ show i ++ " / " ++ show nb ++ ")")
draw
--------------------------------------------------------------------------------
| 305
|
onNext
= do incrPage
i <- getCurrentPage
nb <- getPageCount
name <- getFilename
setTitle (name ++ " (page " ++ show i ++ " / " ++ show nb ++ ")")
draw
--------------------------------------------------------------------------------
| 286
| false
| true
| 1
| 13
| 91
| 83
| 36
| 47
| null | null |
cullina/Extractor
|
src/Huffman.hs
|
bsd-3-clause
|
buildCode keys [] = Empty
| 25
|
buildCode keys [] = Empty
| 25
|
buildCode keys [] = Empty
| 25
| false
| false
| 1
| 5
| 4
| 18
| 6
| 12
| null | null |
sdiehl/ghc
|
compiler/coreSyn/CoreStats.hs
|
bsd-3-clause
|
bndrStats :: Var -> CoreStats
bndrStats v = oneTM `plusCS` tyStats (varType v)
| 78
|
bndrStats :: Var -> CoreStats
bndrStats v = oneTM `plusCS` tyStats (varType v)
| 78
|
bndrStats v = oneTM `plusCS` tyStats (varType v)
| 48
| false
| true
| 0
| 8
| 12
| 33
| 17
| 16
| null | null |
rfranek/duckling
|
Duckling/Time/VI/Rules.hs
|
bsd-3-clause
|
ruleHourofdayHalf :: Rule
ruleHourofdayHalf = Rule
{ name = "(hour-of-day) half"
, pattern =
[ Predicate isAnHourOfDay
, regex "r(\x01b0)(\x1ee1)i"
]
, prod = \tokens -> case tokens of
(Token Time TimeData {TTime.form = Just (TTime.TimeOfDay (Just hours) is12H)}:_) ->
tt $ hourMinute is12H hours 30
_ -> Nothing
}
| 354
|
ruleHourofdayHalf :: Rule
ruleHourofdayHalf = Rule
{ name = "(hour-of-day) half"
, pattern =
[ Predicate isAnHourOfDay
, regex "r(\x01b0)(\x1ee1)i"
]
, prod = \tokens -> case tokens of
(Token Time TimeData {TTime.form = Just (TTime.TimeOfDay (Just hours) is12H)}:_) ->
tt $ hourMinute is12H hours 30
_ -> Nothing
}
| 354
|
ruleHourofdayHalf = Rule
{ name = "(hour-of-day) half"
, pattern =
[ Predicate isAnHourOfDay
, regex "r(\x01b0)(\x1ee1)i"
]
, prod = \tokens -> case tokens of
(Token Time TimeData {TTime.form = Just (TTime.TimeOfDay (Just hours) is12H)}:_) ->
tt $ hourMinute is12H hours 30
_ -> Nothing
}
| 328
| false
| true
| 0
| 22
| 89
| 121
| 63
| 58
| null | null |
knalbant/wrangell
|
main.hs
|
bsd-3-clause
|
--injects our builtins into defined labels
primitiveBindings :: IO Env
primitiveBindings = nullEnv >>= (flip bindVars $ map makePrimitiveFunc funcTable)
where makePrimitiveFunc (name, func) = (name, BuiltIn func)
--helper function for running a single expression from the CL
| 278
|
primitiveBindings :: IO Env
primitiveBindings = nullEnv >>= (flip bindVars $ map makePrimitiveFunc funcTable)
where makePrimitiveFunc (name, func) = (name, BuiltIn func)
--helper function for running a single expression from the CL
| 235
|
primitiveBindings = nullEnv >>= (flip bindVars $ map makePrimitiveFunc funcTable)
where makePrimitiveFunc (name, func) = (name, BuiltIn func)
--helper function for running a single expression from the CL
| 207
| true
| true
| 0
| 8
| 41
| 60
| 32
| 28
| null | null |
NorfairKing/project-euler
|
005/haskell/solution.hs
|
gpl-2.0
|
main = readLn >>= print . solve
| 31
|
main = readLn >>= print . solve
| 31
|
main = readLn >>= print . solve
| 31
| false
| false
| 3
| 5
| 6
| 19
| 8
| 11
| null | null |
urbanslug/ghc
|
libraries/template-haskell/Language/Haskell/TH/Syntax.hs
|
bsd-3-clause
|
tupleTypeName 1 = error "tupleTypeName 1"
| 41
|
tupleTypeName 1 = error "tupleTypeName 1"
| 41
|
tupleTypeName 1 = error "tupleTypeName 1"
| 41
| false
| false
| 0
| 5
| 5
| 12
| 5
| 7
| null | null |
gsdlab/clafer
|
src/Language/Clafer/Intermediate/StringAnalyzer.hs
|
mit
|
astrPExp (PExp t pid' pos' (IDeclPExp quant' oDecls' bpexp')) =
PExp t pid' pos' `liftM` (IDeclPExp quant' oDecls' `liftM` astrPExp bpexp')
| 143
|
astrPExp (PExp t pid' pos' (IDeclPExp quant' oDecls' bpexp')) =
PExp t pid' pos' `liftM` (IDeclPExp quant' oDecls' `liftM` astrPExp bpexp')
| 143
|
astrPExp (PExp t pid' pos' (IDeclPExp quant' oDecls' bpexp')) =
PExp t pid' pos' `liftM` (IDeclPExp quant' oDecls' `liftM` astrPExp bpexp')
| 143
| false
| false
| 0
| 8
| 24
| 64
| 31
| 33
| null | null |
amccausl/Swish
|
Swish/HaskellRDF/GraphTest.hs
|
lgpl-2.1
|
p311 = LV "p311"
| 17
|
p311 = LV "p311"
| 17
|
p311 = LV "p311"
| 17
| false
| false
| 0
| 5
| 4
| 9
| 4
| 5
| null | null |
plumlife/cabal
|
Cabal/Distribution/PackageDescription/PrettyPrint.hs
|
bsd-3-clause
|
-- | Recompile with false for regression testing
simplifiedPrinting :: Bool
simplifiedPrinting = False
| 102
|
simplifiedPrinting :: Bool
simplifiedPrinting = False
| 53
|
simplifiedPrinting = False
| 26
| true
| true
| 0
| 4
| 13
| 12
| 7
| 5
| null | null |
arjuncomar/fjord
|
Web/Fjord.hs
|
gpl-3.0
|
fjord :: FjordConfig -> IO ()
fjord config = do
_ <- initGUI
pane <- mkPane
a <- async $ runMVC pane modelFjord $ do
(controller, viewer) <- fjordBrowser pane config
(,) <$> viewer <*> controller
mainGUI
void $ wait a
| 241
|
fjord :: FjordConfig -> IO ()
fjord config = do
_ <- initGUI
pane <- mkPane
a <- async $ runMVC pane modelFjord $ do
(controller, viewer) <- fjordBrowser pane config
(,) <$> viewer <*> controller
mainGUI
void $ wait a
| 241
|
fjord config = do
_ <- initGUI
pane <- mkPane
a <- async $ runMVC pane modelFjord $ do
(controller, viewer) <- fjordBrowser pane config
(,) <$> viewer <*> controller
mainGUI
void $ wait a
| 211
| false
| true
| 0
| 14
| 64
| 107
| 48
| 59
| null | null |
beni55/haste-compiler
|
libraries/ghc-7.10/ghc-prim/GHC/Prim.hs
|
bsd-3-clause
|
-- | Read a vector from specified index of mutable array.
readDoubleX2Array# :: MutableByteArray# s -> Int# -> State# s -> (# State# s,DoubleX2# #)
readDoubleX2Array# = let x = x in x
| 185
|
readDoubleX2Array# :: MutableByteArray# s -> Int# -> State# s -> (# State# s,DoubleX2# #)
readDoubleX2Array# = let x = x in x
| 125
|
readDoubleX2Array# = let x = x in x
| 35
| true
| true
| 0
| 11
| 34
| 56
| 25
| 31
| null | null |
Kyly/liquidhaskell
|
src/Language/Haskell/Liquid/RefType.hs
|
bsd-3-clause
|
subsFree m s z (REx x t t')
= REx x (subsFree m s z t) (subsFree m s z t')
| 76
|
subsFree m s z (REx x t t')
= REx x (subsFree m s z t) (subsFree m s z t')
| 76
|
subsFree m s z (REx x t t')
= REx x (subsFree m s z t) (subsFree m s z t')
| 76
| false
| false
| 0
| 7
| 22
| 57
| 27
| 30
| null | null |
intolerable/GroupProject
|
src/Emulator/CPU/Interrupts.hs
|
bsd-2-clause
|
interruptsEnabled :: AddressSpace m => m Bool
interruptsEnabled = do
val <- readAddressHalfWord 0x4000208
return $ testBit val 0
| 132
|
interruptsEnabled :: AddressSpace m => m Bool
interruptsEnabled = do
val <- readAddressHalfWord 0x4000208
return $ testBit val 0
| 132
|
interruptsEnabled = do
val <- readAddressHalfWord 0x4000208
return $ testBit val 0
| 86
| false
| true
| 0
| 8
| 22
| 43
| 19
| 24
| null | null |
facebookincubator/duckling
|
Duckling/Rules/FR.hs
|
bsd-3-clause
|
defaultRules :: Seal Dimension -> [Rule]
defaultRules = langRules
| 65
|
defaultRules :: Seal Dimension -> [Rule]
defaultRules = langRules
| 65
|
defaultRules = langRules
| 24
| false
| true
| 0
| 6
| 8
| 21
| 11
| 10
| null | null |
NorfairKing/yi-solarized
|
src/Yi/Style/Solarized.hs
|
mit
|
-- | Convenience function
rgb :: Word32 -> Color
rgb x = RGB (fi (x `shiftR` 16))
(fi (x `shiftR` 8))
(fi x)
where
fi = fromIntegral
-- | Hex value: 0x002B36
| 189
|
rgb :: Word32 -> Color
rgb x = RGB (fi (x `shiftR` 16))
(fi (x `shiftR` 8))
(fi x)
where
fi = fromIntegral
-- | Hex value: 0x002B36
| 163
|
rgb x = RGB (fi (x `shiftR` 16))
(fi (x `shiftR` 8))
(fi x)
where
fi = fromIntegral
-- | Hex value: 0x002B36
| 140
| true
| true
| 1
| 8
| 63
| 82
| 40
| 42
| null | null |
ashishnegi/hsalgos
|
bench/QuickSort.hs
|
bsd-3-clause
|
qsortFoldl' :: (Ord a) => [a] -> [a]
qsortFoldl' [] = []
| 56
|
qsortFoldl' :: (Ord a) => [a] -> [a]
qsortFoldl' [] = []
| 56
|
qsortFoldl' [] = []
| 19
| false
| true
| 0
| 7
| 11
| 37
| 20
| 17
| null | null |
shockkolate/containers
|
Data/Map/Base.hs
|
bsd-3-clause
|
-- | /O(log n)/. Lookup and update. See also 'updateWithKey'.
-- The function returns changed value, if it is updated.
-- Returns the original key value if the map entry is deleted.
--
-- > let f k x = if x == "a" then Just ((show k) ++ ":new a") else Nothing
-- > updateLookupWithKey f 5 (fromList [(5,"a"), (3,"b")]) == (Just "5:new a", fromList [(3, "b"), (5, "5:new a")])
-- > updateLookupWithKey f 7 (fromList [(5,"a"), (3,"b")]) == (Nothing, fromList [(3, "b"), (5, "a")])
-- > updateLookupWithKey f 3 (fromList [(5,"a"), (3,"b")]) == (Just "b", singleton 5 "a")
-- See Note: Type of local 'go' function
updateLookupWithKey :: Ord k => (k -> a -> Maybe a) -> k -> Map k a -> (Maybe a,Map k a)
updateLookupWithKey = go
where
go :: Ord k => (k -> a -> Maybe a) -> k -> Map k a -> (Maybe a,Map k a)
STRICT_2_OF_3(go)
go _ _ Tip = (Nothing,Tip)
go f k (Bin sx kx x l r) =
case compare k kx of
LT -> let (found,l') = go f k l in (found,balanceR kx x l' r)
GT -> let (found,r') = go f k r in (found,balanceL kx x l r')
EQ -> case f kx x of
Just x' -> (Just x',Bin sx kx x' l r)
Nothing -> (Just x,glue l r)
#if __GLASGOW_HASKELL__ >= 700
| 1,254
|
updateLookupWithKey :: Ord k => (k -> a -> Maybe a) -> k -> Map k a -> (Maybe a,Map k a)
updateLookupWithKey = go
where
go :: Ord k => (k -> a -> Maybe a) -> k -> Map k a -> (Maybe a,Map k a)
STRICT_2_OF_3(go)
go _ _ Tip = (Nothing,Tip)
go f k (Bin sx kx x l r) =
case compare k kx of
LT -> let (found,l') = go f k l in (found,balanceR kx x l' r)
GT -> let (found,r') = go f k r in (found,balanceL kx x l r')
EQ -> case f kx x of
Just x' -> (Just x',Bin sx kx x' l r)
Nothing -> (Just x,glue l r)
#if __GLASGOW_HASKELL__ >= 700
| 642
|
updateLookupWithKey = go
where
go :: Ord k => (k -> a -> Maybe a) -> k -> Map k a -> (Maybe a,Map k a)
STRICT_2_OF_3(go)
go _ _ Tip = (Nothing,Tip)
go f k (Bin sx kx x l r) =
case compare k kx of
LT -> let (found,l') = go f k l in (found,balanceR kx x l' r)
GT -> let (found,r') = go f k r in (found,balanceL kx x l r')
EQ -> case f kx x of
Just x' -> (Just x',Bin sx kx x' l r)
Nothing -> (Just x,glue l r)
#if __GLASGOW_HASKELL__ >= 700
| 553
| true
| true
| 6
| 14
| 351
| 349
| 178
| 171
| null | null |
JacquesCarette/literate-scientific-software
|
code/drasil-example/Drasil/GamePhysics/Requirements.hs
|
bsd-2-clause
|
deterCollRespOverTime = cic "deterCollRespOverTime" deterCollRespOverTimeDesc "Determine-Collision-Response-Over-Time" funcReqDom
| 129
|
deterCollRespOverTime = cic "deterCollRespOverTime" deterCollRespOverTimeDesc "Determine-Collision-Response-Over-Time" funcReqDom
| 129
|
deterCollRespOverTime = cic "deterCollRespOverTime" deterCollRespOverTimeDesc "Determine-Collision-Response-Over-Time" funcReqDom
| 129
| false
| false
| 0
| 5
| 6
| 15
| 7
| 8
| null | null |
amccausl/Swish
|
Swish/HaskellRDF/N3FormatterTest.hs
|
lgpl-2.1
|
exoticRoundTripTest06 = fullRoundTripTest "Exotic06" exoticN3Graph_x6
| 69
|
exoticRoundTripTest06 = fullRoundTripTest "Exotic06" exoticN3Graph_x6
| 69
|
exoticRoundTripTest06 = fullRoundTripTest "Exotic06" exoticN3Graph_x6
| 69
| false
| false
| 0
| 5
| 4
| 11
| 5
| 6
| null | null |
harry830622/cis194-solutions
|
07-folds-monoids/Scrabble.hs
|
mit
|
score :: Char -> Score
score c
| c_lower `elem` "aeilnorstu" = Score 1
| c_lower `elem` "dg" = Score 2
| c_lower `elem` "bcmp" = Score 3
| c_lower `elem` "fhvwy" = Score 4
| c_lower `elem` "k" = Score 5
| c_lower `elem` "jx" = Score 8
| c_lower `elem` "qz" = Score 10
| otherwise = Score 0
where c_lower = toLower c
| 395
|
score :: Char -> Score
score c
| c_lower `elem` "aeilnorstu" = Score 1
| c_lower `elem` "dg" = Score 2
| c_lower `elem` "bcmp" = Score 3
| c_lower `elem` "fhvwy" = Score 4
| c_lower `elem` "k" = Score 5
| c_lower `elem` "jx" = Score 8
| c_lower `elem` "qz" = Score 10
| otherwise = Score 0
where c_lower = toLower c
| 395
|
score c
| c_lower `elem` "aeilnorstu" = Score 1
| c_lower `elem` "dg" = Score 2
| c_lower `elem` "bcmp" = Score 3
| c_lower `elem` "fhvwy" = Score 4
| c_lower `elem` "k" = Score 5
| c_lower `elem` "jx" = Score 8
| c_lower `elem` "qz" = Score 10
| otherwise = Score 0
where c_lower = toLower c
| 372
| false
| true
| 7
| 8
| 145
| 162
| 80
| 82
| null | null |
silky/csound-expression
|
src/Csound/Air/Live.hs
|
bsd-3-clause
|
-- | The filtered white noize widget. The arguments are
--
-- > uiWhite isOn centerFreqOfFilter amountOfNoize
uiWhite :: Bool -> Double -> Double -> Source FxFun
uiWhite isOn freq depth = sourceColor2 C.dimgray $ fxBox "White" fxWhite2 isOn
[("freq", freq), ("depth", depth)]
| 281
|
uiWhite :: Bool -> Double -> Double -> Source FxFun
uiWhite isOn freq depth = sourceColor2 C.dimgray $ fxBox "White" fxWhite2 isOn
[("freq", freq), ("depth", depth)]
| 170
|
uiWhite isOn freq depth = sourceColor2 C.dimgray $ fxBox "White" fxWhite2 isOn
[("freq", freq), ("depth", depth)]
| 118
| true
| true
| 0
| 8
| 48
| 78
| 40
| 38
| null | null |
danr/hipspec
|
testsuite/prod/zeno_version/PropT41.hs
|
gpl-3.0
|
isort (x:xs) = insert x (isort xs)
| 34
|
isort (x:xs) = insert x (isort xs)
| 34
|
isort (x:xs) = insert x (isort xs)
| 34
| false
| false
| 0
| 7
| 6
| 27
| 13
| 14
| null | null |
Bodigrim/katas
|
src/haskell/B-All-None--Any.hs
|
bsd-2-clause
|
all, none, any :: (a -> Bool) -> [a] -> Bool
all f = and . map f
| 65
|
all, none, any :: (a -> Bool) -> [a] -> Bool
all f = and . map f
| 65
|
all f = and . map f
| 20
| false
| true
| 2
| 7
| 18
| 47
| 24
| 23
| null | null |
gleachkr/Carnap
|
Carnap/src/Carnap/Core/Unification/Huet.hs
|
gpl-3.0
|
toVars :: (MonadVar f m) => [AnyPig f] -> m [AnyPig f]
toVars (AnyPig (x :: f t):xs) = do y :: f t <- fresh
tail <- toVars xs
return (AnyPig y:tail)
| 219
|
toVars :: (MonadVar f m) => [AnyPig f] -> m [AnyPig f]
toVars (AnyPig (x :: f t):xs) = do y :: f t <- fresh
tail <- toVars xs
return (AnyPig y:tail)
| 219
|
toVars (AnyPig (x :: f t):xs) = do y :: f t <- fresh
tail <- toVars xs
return (AnyPig y:tail)
| 164
| false
| true
| 0
| 11
| 103
| 104
| 49
| 55
| null | null |
siddhanathan/ghc
|
compiler/prelude/TysWiredIn.hs
|
bsd-3-clause
|
ipCoName = mkWiredInCoAxiomName BuiltInSyntax gHC_CLASSES (fsLit "NTCo:IP")
ipCoNameKey (toBranchedAxiom ipCoAxiom)
| 138
|
ipCoName = mkWiredInCoAxiomName BuiltInSyntax gHC_CLASSES (fsLit "NTCo:IP")
ipCoNameKey (toBranchedAxiom ipCoAxiom)
| 138
|
ipCoName = mkWiredInCoAxiomName BuiltInSyntax gHC_CLASSES (fsLit "NTCo:IP")
ipCoNameKey (toBranchedAxiom ipCoAxiom)
| 138
| false
| false
| 0
| 7
| 32
| 29
| 14
| 15
| null | null |
twittner/cql
|
src/Database/CQL/Protocol/Codec.hs
|
mpl-2.0
|
decodeSignedShort :: Get Int16
decodeSignedShort = get
| 54
|
decodeSignedShort :: Get Int16
decodeSignedShort = get
| 54
|
decodeSignedShort = get
| 23
| false
| true
| 0
| 5
| 6
| 14
| 7
| 7
| null | null |
mpickering/hlint-refactor
|
tests/examples/Extensions0.hs
|
bsd-3-clause
|
f = id
| 6
|
f = id
| 6
|
f = id
| 6
| false
| false
| 1
| 5
| 2
| 10
| 3
| 7
| null | null |
Melvar/Idris-dev
|
src/Idris/Core/TT.hs
|
bsd-3-clause
|
termSmallerThan x (V i) = True
| 30
|
termSmallerThan x (V i) = True
| 30
|
termSmallerThan x (V i) = True
| 30
| false
| false
| 0
| 6
| 5
| 19
| 8
| 11
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.