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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
FranklinChen/hugs98-plus-Sep2006
|
packages/GLUT/examples/RedBook/Model.hs
|
bsd-3-clause
|
main :: IO ()
main = do
(progName, _args) <- getArgsAndInitialize
initialDisplayMode $= [ SingleBuffered, RGBMode ]
initialWindowSize $= Size 500 500
initialWindowPosition $= Position 100 100
createWindow progName
myInit
displayCallback $= display
reshapeCallback $= Just reshape
keyboardMouseCallback $= Just keyboard
mainLoop
| 357
|
main :: IO ()
main = do
(progName, _args) <- getArgsAndInitialize
initialDisplayMode $= [ SingleBuffered, RGBMode ]
initialWindowSize $= Size 500 500
initialWindowPosition $= Position 100 100
createWindow progName
myInit
displayCallback $= display
reshapeCallback $= Just reshape
keyboardMouseCallback $= Just keyboard
mainLoop
| 357
|
main = do
(progName, _args) <- getArgsAndInitialize
initialDisplayMode $= [ SingleBuffered, RGBMode ]
initialWindowSize $= Size 500 500
initialWindowPosition $= Position 100 100
createWindow progName
myInit
displayCallback $= display
reshapeCallback $= Just reshape
keyboardMouseCallback $= Just keyboard
mainLoop
| 343
| false
| true
| 0
| 8
| 71
| 111
| 48
| 63
| null | null |
bitemyapp/rcu
|
examples/ListInt.hs
|
bsd-2-clause
|
snapshot acc (Cons x rn) = snapshot (x + acc) =<< readSRef rn
| 61
|
snapshot acc (Cons x rn) = snapshot (x + acc) =<< readSRef rn
| 61
|
snapshot acc (Cons x rn) = snapshot (x + acc) =<< readSRef rn
| 61
| false
| false
| 0
| 8
| 12
| 38
| 17
| 21
| null | null |
Lupino/dispatch-article
|
app/Main.hs
|
bsd-3-clause
|
parser :: Parser Options
parser = Options <$> strOption (long "config"
<> short 'c'
<> metavar "FILE"
<> help "Article micro server config file."
<> value "config.yaml")
<*> strOption (long "host"
<> short 'H'
<> metavar "HOST"
<> help "Article micro server hostname."
<> value "127.0.0.1")
<*> option auto (long "port"
<> short 'p'
<> metavar "PORT"
<> help "Article micro server port."
<> value 3000)
<*> strOption (long "table_prefix"
<> metavar "TABLE_PREFIX"
<> help "table prefix."
<> value "test")
| 1,035
|
parser :: Parser Options
parser = Options <$> strOption (long "config"
<> short 'c'
<> metavar "FILE"
<> help "Article micro server config file."
<> value "config.yaml")
<*> strOption (long "host"
<> short 'H'
<> metavar "HOST"
<> help "Article micro server hostname."
<> value "127.0.0.1")
<*> option auto (long "port"
<> short 'p'
<> metavar "PORT"
<> help "Article micro server port."
<> value 3000)
<*> strOption (long "table_prefix"
<> metavar "TABLE_PREFIX"
<> help "table prefix."
<> value "test")
| 1,035
|
parser = Options <$> strOption (long "config"
<> short 'c'
<> metavar "FILE"
<> help "Article micro server config file."
<> value "config.yaml")
<*> strOption (long "host"
<> short 'H'
<> metavar "HOST"
<> help "Article micro server hostname."
<> value "127.0.0.1")
<*> option auto (long "port"
<> short 'p'
<> metavar "PORT"
<> help "Article micro server port."
<> value 3000)
<*> strOption (long "table_prefix"
<> metavar "TABLE_PREFIX"
<> help "table prefix."
<> value "test")
| 1,010
| false
| true
| 0
| 15
| 610
| 173
| 77
| 96
| null | null |
nazrhom/vcs-clojure
|
src/Language/Clojure/AST.hs
|
bsd-3-clause
|
collectSubTrees :: Expr -> Int -> [SubTree]
collectSubTrees e i = mbTakeExpr e i
| 80
|
collectSubTrees :: Expr -> Int -> [SubTree]
collectSubTrees e i = mbTakeExpr e i
| 80
|
collectSubTrees e i = mbTakeExpr e i
| 36
| false
| true
| 0
| 7
| 13
| 36
| 17
| 19
| null | null |
pgj/bead
|
snaplets/fay/src/DynamicContents.hs
|
bsd-3-clause
|
cssId :: String -> Text
cssId i = fromString ('#':i)
| 52
|
cssId :: String -> Text
cssId i = fromString ('#':i)
| 52
|
cssId i = fromString ('#':i)
| 28
| false
| true
| 0
| 7
| 9
| 28
| 14
| 14
| null | null |
fluffynukeit/FNIStash
|
src/FNIStash/Logic/DB.hs
|
bsd-3-clause
|
locationChange (env@Env{..}) locFrom@(Location _ _ _) locTo@(Location _ _ _) = do
let selQuery = "select ID from ITEMS " ++ whereContPosStat
upQuery = "update ITEMS set CONTAINER=?, POSITION=?, STATUS=?"
contPosStatVals loc = [toSql $ locContainer loc, toSql $ locIndex loc, toSql Stashed]
getID r = fromSql $ ((head r) !! 0)
-- First check to see if anything is already at the TO location
rows <- quickQuery' dbConn selQuery (contPosStatVals locTo)
let destOccupied = length rows > 0
-- Update the item that will be in the new TO location
run dbConn (upQuery ++ whereContPosStat) $
contPosStatVals locTo ++ contPosStatVals locFrom
-- If something exists at the TO location, swap it with the FROM location
when destOccupied $ do
void $ run dbConn (upQuery ++ " where ID=?;") ((contPosStatVals locFrom) ++ [getID rows])
itemF <- getItemFromDb env locFrom
itemT <- getItemFromDb env locTo
return $ sequence [itemF, itemT] >>= \(f:t:[]) -> Right [(locFrom, f), (locTo, t)]
| 1,056
|
locationChange (env@Env{..}) locFrom@(Location _ _ _) locTo@(Location _ _ _) = do
let selQuery = "select ID from ITEMS " ++ whereContPosStat
upQuery = "update ITEMS set CONTAINER=?, POSITION=?, STATUS=?"
contPosStatVals loc = [toSql $ locContainer loc, toSql $ locIndex loc, toSql Stashed]
getID r = fromSql $ ((head r) !! 0)
-- First check to see if anything is already at the TO location
rows <- quickQuery' dbConn selQuery (contPosStatVals locTo)
let destOccupied = length rows > 0
-- Update the item that will be in the new TO location
run dbConn (upQuery ++ whereContPosStat) $
contPosStatVals locTo ++ contPosStatVals locFrom
-- If something exists at the TO location, swap it with the FROM location
when destOccupied $ do
void $ run dbConn (upQuery ++ " where ID=?;") ((contPosStatVals locFrom) ++ [getID rows])
itemF <- getItemFromDb env locFrom
itemT <- getItemFromDb env locTo
return $ sequence [itemF, itemT] >>= \(f:t:[]) -> Right [(locFrom, f), (locTo, t)]
| 1,056
|
locationChange (env@Env{..}) locFrom@(Location _ _ _) locTo@(Location _ _ _) = do
let selQuery = "select ID from ITEMS " ++ whereContPosStat
upQuery = "update ITEMS set CONTAINER=?, POSITION=?, STATUS=?"
contPosStatVals loc = [toSql $ locContainer loc, toSql $ locIndex loc, toSql Stashed]
getID r = fromSql $ ((head r) !! 0)
-- First check to see if anything is already at the TO location
rows <- quickQuery' dbConn selQuery (contPosStatVals locTo)
let destOccupied = length rows > 0
-- Update the item that will be in the new TO location
run dbConn (upQuery ++ whereContPosStat) $
contPosStatVals locTo ++ contPosStatVals locFrom
-- If something exists at the TO location, swap it with the FROM location
when destOccupied $ do
void $ run dbConn (upQuery ++ " where ID=?;") ((contPosStatVals locFrom) ++ [getID rows])
itemF <- getItemFromDb env locFrom
itemT <- getItemFromDb env locTo
return $ sequence [itemF, itemT] >>= \(f:t:[]) -> Right [(locFrom, f), (locTo, t)]
| 1,056
| false
| false
| 0
| 15
| 243
| 329
| 165
| 164
| null | null |
sanjoy/hLLVM
|
src/Llvm/Pass/PhiFixUp.hs
|
bsd-3-clause
|
removePhi x _ live | trace ("removePhi is called over " ++ show x) False = undefined
| 84
|
removePhi x _ live | trace ("removePhi is called over " ++ show x) False = undefined
| 84
|
removePhi x _ live | trace ("removePhi is called over " ++ show x) False = undefined
| 84
| false
| false
| 1
| 11
| 16
| 36
| 15
| 21
| null | null |
DavidAlphaFox/ghc
|
utils/hsc2hs/Flags.hs
|
bsd-3-clause
|
emptyMode :: Mode
emptyMode = UseConfig $ Config {
cmTemplate = Nothing,
cmCompiler = Nothing,
cmLinker = Nothing,
cKeepFiles = False,
cNoCompile = False,
cCrossCompile = False,
cCrossSafe = False,
cVerbose = False,
cFlags = []
}
| 537
|
emptyMode :: Mode
emptyMode = UseConfig $ Config {
cmTemplate = Nothing,
cmCompiler = Nothing,
cmLinker = Nothing,
cKeepFiles = False,
cNoCompile = False,
cCrossCompile = False,
cCrossSafe = False,
cVerbose = False,
cFlags = []
}
| 537
|
emptyMode = UseConfig $ Config {
cmTemplate = Nothing,
cmCompiler = Nothing,
cmLinker = Nothing,
cKeepFiles = False,
cNoCompile = False,
cCrossCompile = False,
cCrossSafe = False,
cVerbose = False,
cFlags = []
}
| 519
| false
| true
| 0
| 8
| 344
| 73
| 46
| 27
| null | null |
ocean0yohsuke/Simply-Typed-Lambda
|
src/Lambda/Evaluator/Meta.hs
|
bsd-3-clause
|
evalLazyEvalN :: Term -> Lambda ReturnT
evalLazyEvalN int@(INT n _) = (*:) $ RETURN $ META ("(lazyEvalN "++ show int ++")") $ fromInteger n >- f
where
f :: Int -> Term -> Lambda ReturnT
f n t = do
x <- t >- (iterateM n lazyEval1)
e <- restore x
liftIO $ putStrLn $ show e
(*:) VOID
| 325
|
evalLazyEvalN :: Term -> Lambda ReturnT
evalLazyEvalN int@(INT n _) = (*:) $ RETURN $ META ("(lazyEvalN "++ show int ++")") $ fromInteger n >- f
where
f :: Int -> Term -> Lambda ReturnT
f n t = do
x <- t >- (iterateM n lazyEval1)
e <- restore x
liftIO $ putStrLn $ show e
(*:) VOID
| 325
|
evalLazyEvalN int@(INT n _) = (*:) $ RETURN $ META ("(lazyEvalN "++ show int ++")") $ fromInteger n >- f
where
f :: Int -> Term -> Lambda ReturnT
f n t = do
x <- t >- (iterateM n lazyEval1)
e <- restore x
liftIO $ putStrLn $ show e
(*:) VOID
| 285
| false
| true
| 0
| 12
| 102
| 150
| 72
| 78
| null | null |
joe9/barrelfish
|
tools/mackerel/ShiftDriver.hs
|
mit
|
register_dump_comment :: RT.Rec -> C.Unit
register_dump_comment r
= C.MultiComment ([name, typedesc] ++ fields)
where title = if (RT.is_array r) then " array" else ""
name = printf "Register%s %s: %s" title (RT.name r) (RT.desc r)
typedesc = printf "Type: %s (%s)"
(TN.toString $ RT.typename r)
(if TT.is_primitive $ RT.tpe r
then "primitive type"
else TT.tt_desc $ RT.tpe r)
fields = if TT.is_primitive $ RT.tpe r
then []
else [ field_dump f | f <- RT.fl r ]
--
-- Return a declaration for the length of a register array.
--
| 721
|
register_dump_comment :: RT.Rec -> C.Unit
register_dump_comment r
= C.MultiComment ([name, typedesc] ++ fields)
where title = if (RT.is_array r) then " array" else ""
name = printf "Register%s %s: %s" title (RT.name r) (RT.desc r)
typedesc = printf "Type: %s (%s)"
(TN.toString $ RT.typename r)
(if TT.is_primitive $ RT.tpe r
then "primitive type"
else TT.tt_desc $ RT.tpe r)
fields = if TT.is_primitive $ RT.tpe r
then []
else [ field_dump f | f <- RT.fl r ]
--
-- Return a declaration for the length of a register array.
--
| 721
|
register_dump_comment r
= C.MultiComment ([name, typedesc] ++ fields)
where title = if (RT.is_array r) then " array" else ""
name = printf "Register%s %s: %s" title (RT.name r) (RT.desc r)
typedesc = printf "Type: %s (%s)"
(TN.toString $ RT.typename r)
(if TT.is_primitive $ RT.tpe r
then "primitive type"
else TT.tt_desc $ RT.tpe r)
fields = if TT.is_primitive $ RT.tpe r
then []
else [ field_dump f | f <- RT.fl r ]
--
-- Return a declaration for the length of a register array.
--
| 679
| false
| true
| 0
| 12
| 285
| 200
| 105
| 95
| null | null |
leepike/copilot-c99
|
src/Copilot/Compile/C99/Test/Driver.hs
|
bsd-3-clause
|
ppUType :: UType -> Doc
ppUType UType { uTypeType = t }
= text $ case t of
Bool -> "bool"
Int8 -> "int8_t"
Int16 -> "int16_t"
Int32 -> "int32_t"
Int64 -> "int64_t"
Word8 -> "uint8_t"
Word16 -> "uint16_t"
Word32 -> "uint32_t"
Word64 -> "uint64_t"
Float -> "float"
Double -> "double"
--------------------------------------------------------------------------------
| 440
|
ppUType :: UType -> Doc
ppUType UType { uTypeType = t }
= text $ case t of
Bool -> "bool"
Int8 -> "int8_t"
Int16 -> "int16_t"
Int32 -> "int32_t"
Int64 -> "int64_t"
Word8 -> "uint8_t"
Word16 -> "uint16_t"
Word32 -> "uint32_t"
Word64 -> "uint64_t"
Float -> "float"
Double -> "double"
--------------------------------------------------------------------------------
| 440
|
ppUType UType { uTypeType = t }
= text $ case t of
Bool -> "bool"
Int8 -> "int8_t"
Int16 -> "int16_t"
Int32 -> "int32_t"
Int64 -> "int64_t"
Word8 -> "uint8_t"
Word16 -> "uint16_t"
Word32 -> "uint32_t"
Word64 -> "uint64_t"
Float -> "float"
Double -> "double"
--------------------------------------------------------------------------------
| 416
| false
| true
| 0
| 8
| 129
| 102
| 52
| 50
| null | null |
bos/inttable
|
IntMap.hs
|
bsd-3-clause
|
-- GHC: use unboxing to get @shiftRL@ inlined.
shiftRL (W# x) (I# i) = W# (shiftRL# x i)
| 88
|
shiftRL (W# x) (I# i) = W# (shiftRL# x i)
| 41
|
shiftRL (W# x) (I# i) = W# (shiftRL# x i)
| 41
| true
| false
| 0
| 7
| 17
| 37
| 17
| 20
| null | null |
mrd/fishtank
|
Main.hs
|
bsd-3-clause
|
keyboard state (MouseButton WheelDown) Down _ mpos = do
viewingS state $~ (* (1 - zoomFactor))
| 96
|
keyboard state (MouseButton WheelDown) Down _ mpos = do
viewingS state $~ (* (1 - zoomFactor))
| 96
|
keyboard state (MouseButton WheelDown) Down _ mpos = do
viewingS state $~ (* (1 - zoomFactor))
| 96
| false
| false
| 0
| 10
| 17
| 44
| 22
| 22
| null | null |
BartMassey/monty-hall
|
hall.hs
|
bsd-3-clause
|
shuffle doors = do
-- Pick a position to move to the front of the list.
pos <- getRandomR (1, length doors)
-- Break the doors into those before, at and after the position.
let (left, door : right) = splitAt (pos - 1) doors
-- Join the before and after doors and shuffle them.
rest <- shuffle (left ++ right)
-- Stick the at door on the front and return.
return (door : rest)
-- | Run a bunch of experiments with stay or switch as indicated
-- on the command line.
| 494
|
shuffle doors = do
-- Pick a position to move to the front of the list.
pos <- getRandomR (1, length doors)
-- Break the doors into those before, at and after the position.
let (left, door : right) = splitAt (pos - 1) doors
-- Join the before and after doors and shuffle them.
rest <- shuffle (left ++ right)
-- Stick the at door on the front and return.
return (door : rest)
-- | Run a bunch of experiments with stay or switch as indicated
-- on the command line.
| 494
|
shuffle doors = do
-- Pick a position to move to the front of the list.
pos <- getRandomR (1, length doors)
-- Break the doors into those before, at and after the position.
let (left, door : right) = splitAt (pos - 1) doors
-- Join the before and after doors and shuffle them.
rest <- shuffle (left ++ right)
-- Stick the at door on the front and return.
return (door : rest)
-- | Run a bunch of experiments with stay or switch as indicated
-- on the command line.
| 494
| false
| false
| 0
| 12
| 122
| 96
| 49
| 47
| null | null |
vTurbine/ghc
|
compiler/typecheck/TcRnTypes.hs
|
bsd-3-clause
|
isTypeLevel KindLevel = False
| 29
|
isTypeLevel KindLevel = False
| 29
|
isTypeLevel KindLevel = False
| 29
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
jtobin/deprecated-observable
|
test/TestSuite.hs
|
bsd-3-clause
|
customStrategy :: PrimMonad m => Transition m Double
customStrategy = do
firstWithProb 0.8
(metropolisHastings (Just 3.0))
(hamiltonian (Just 0.05) (Just 20))
slice 3.0
nuts
| 187
|
customStrategy :: PrimMonad m => Transition m Double
customStrategy = do
firstWithProb 0.8
(metropolisHastings (Just 3.0))
(hamiltonian (Just 0.05) (Just 20))
slice 3.0
nuts
| 187
|
customStrategy = do
firstWithProb 0.8
(metropolisHastings (Just 3.0))
(hamiltonian (Just 0.05) (Just 20))
slice 3.0
nuts
| 134
| false
| true
| 0
| 11
| 37
| 80
| 35
| 45
| null | null |
vikraman/ghc
|
compiler/hsSyn/HsUtils.hs
|
bsd-3-clause
|
-- A name (uniquified later) to
-- identify the quasi-quote
mkHsString :: String -> HsLit
mkHsString s = HsString s (mkFastString s)
| 149
|
mkHsString :: String -> HsLit
mkHsString s = HsString s (mkFastString s)
| 72
|
mkHsString s = HsString s (mkFastString s)
| 42
| true
| true
| 0
| 7
| 38
| 38
| 17
| 21
| null | null |
TOSPIO/yi
|
src/library/Yi/Modes.hs
|
gpl-2.0
|
svnCommitMode :: StyleBasedMode
svnCommitMode = styleMode SVNCommit.lexer
& modeNameA .~ "svn-commit"
& modeAppliesA .~ isCommit
where
isCommit p _ = "svn-commit" `isPrefixOf` p && extensionMatches ["tmp"] p
| 217
|
svnCommitMode :: StyleBasedMode
svnCommitMode = styleMode SVNCommit.lexer
& modeNameA .~ "svn-commit"
& modeAppliesA .~ isCommit
where
isCommit p _ = "svn-commit" `isPrefixOf` p && extensionMatches ["tmp"] p
| 217
|
svnCommitMode = styleMode SVNCommit.lexer
& modeNameA .~ "svn-commit"
& modeAppliesA .~ isCommit
where
isCommit p _ = "svn-commit" `isPrefixOf` p && extensionMatches ["tmp"] p
| 185
| false
| true
| 8
| 7
| 36
| 80
| 36
| 44
| null | null |
kojiromike/Idris-dev
|
src/IRTS/LangOpts.hs
|
bsd-3-clause
|
evalAlt stk env rec defs (LDefaultCase e)
= LDefaultCase <$> eval stk env rec defs e
| 88
|
evalAlt stk env rec defs (LDefaultCase e)
= LDefaultCase <$> eval stk env rec defs e
| 88
|
evalAlt stk env rec defs (LDefaultCase e)
= LDefaultCase <$> eval stk env rec defs e
| 88
| false
| false
| 0
| 7
| 19
| 38
| 18
| 20
| null | null |
ryoia/utah-haskell
|
infrastructure/src/Service/Interact.hs
|
apache-2.0
|
expect = ce snd
| 18
|
expect = ce snd
| 18
|
expect = ce snd
| 18
| false
| false
| 0
| 5
| 6
| 9
| 4
| 5
| null | null |
benb/MetAl
|
src/Phylo/Alignment/Dist.hs
|
gpl-3.0
|
--
--gapEvent :: Node -> ListAlignment -> [[Maybe Split]]
--gapEvent tree (ListAlignment names seqs cols) = gapEvent' tree names cols
--
--gapEvent' :: Node -> [Name] -> [Column] -> [[Maybe Split]]
--gapEvent' (Tree l r) names cols = if (contained leftNames gapNames) where
-- gapNames = map (\x -> fst x) $ filter (\x -> (snd x=='-')) $ zip names cols
-- leftNames = names l
-- rightNames = names r
-- contained x y = contained' x x y
-- contained' full (x:[]) (y:[]) = x==y
-- contained' full (x:[]) (y:ys) = x==y || contained full full ys
-- contained' full (x:xs) (y:ys) = x==y || contained full xs (y:ys)
--
hom0Dist = labDistPerSeq diffSSP numberifyBasic
| 970
|
hom0Dist = labDistPerSeq diffSSP numberifyBasic
| 47
|
hom0Dist = labDistPerSeq diffSSP numberifyBasic
| 47
| true
| false
| 0
| 5
| 426
| 25
| 19
| 6
| null | null |
jstolarek/slicer
|
lib/Language/Slicer/Slice.hs
|
gpl-3.0
|
annotTrace (TIfExn t) = mkPureAnnotTrace [t]
| 55
|
annotTrace (TIfExn t) = mkPureAnnotTrace [t]
| 55
|
annotTrace (TIfExn t) = mkPureAnnotTrace [t]
| 55
| false
| false
| 0
| 7
| 16
| 21
| 10
| 11
| null | null |
Erdwolf/autotool-bonn
|
server/src/Util/Description.hs
|
gpl-2.0
|
fromDoc :: AT.Doc -> IO Description
fromDoc = fromOutput . AO.Doc
| 65
|
fromDoc :: AT.Doc -> IO Description
fromDoc = fromOutput . AO.Doc
| 65
|
fromDoc = fromOutput . AO.Doc
| 29
| false
| true
| 0
| 7
| 10
| 32
| 14
| 18
| null | null |
haskell-opengl/OpenGLRaw
|
src/Graphics/GL/Functions/F06.hs
|
bsd-3-clause
|
ptr_glDetachShader :: FunPtr (GLuint -> GLuint -> IO ())
ptr_glDetachShader = unsafePerformIO $ getCommand "glDetachShader"
| 123
|
ptr_glDetachShader :: FunPtr (GLuint -> GLuint -> IO ())
ptr_glDetachShader = unsafePerformIO $ getCommand "glDetachShader"
| 123
|
ptr_glDetachShader = unsafePerformIO $ getCommand "glDetachShader"
| 66
| false
| true
| 0
| 10
| 14
| 37
| 18
| 19
| null | null |
tolysz/prepare-ghcjs
|
spec-lts8/cabal/cabal-install/Distribution/Client/Dependency/Modular/Dependency.hs
|
bsd-3-clause
|
mapCompFlaggedDep g (Simple pn a ) = Simple pn (g a)
| 59
|
mapCompFlaggedDep g (Simple pn a ) = Simple pn (g a)
| 59
|
mapCompFlaggedDep g (Simple pn a ) = Simple pn (g a)
| 59
| false
| false
| 0
| 7
| 17
| 32
| 14
| 18
| null | null |
samtay/samtay.github.io
|
diagrams/pgm-intro/generic-dag-400-140.hs
|
bsd-3-clause
|
c' :: QDiagram B V2 Double Any
c' = circle 3.7 # fc lightblue <> c
| 66
|
c' :: QDiagram B V2 Double Any
c' = circle 3.7 # fc lightblue <> c
| 66
|
c' = circle 3.7 # fc lightblue <> c
| 35
| false
| true
| 0
| 7
| 15
| 34
| 16
| 18
| null | null |
jsnajder/fer3-catalogue
|
src/fer3.hs
|
bsd-3-clause
|
sim3 :: (SemRep a, Eq a) => CatalogueSim a
sim3 c1@(Node (x1,r1) _) c2@(Node (x2,r2) _)
| ((itemType x1 == KT && itemType x2 /= KT) ||
(itemType x1 /= KT && itemType x2 == KT)) && (not $ sameArea c1' c2')
= 1 - sqrt (1 - compare r1 r2)
| itemType x1 `elem` [KA,KU] && itemType x2 `elem` [KA,KU] && (not $ sameArea c1' c2')
= compare r1' r2'
| otherwise = 0
where
r1' = foldl1 compose . map snd $ flatten c1
r2' = foldl1 compose . map snd $ flatten c2
c1' = fmap fst c1
c2' = fmap fst c2
| 523
|
sim3 :: (SemRep a, Eq a) => CatalogueSim a
sim3 c1@(Node (x1,r1) _) c2@(Node (x2,r2) _)
| ((itemType x1 == KT && itemType x2 /= KT) ||
(itemType x1 /= KT && itemType x2 == KT)) && (not $ sameArea c1' c2')
= 1 - sqrt (1 - compare r1 r2)
| itemType x1 `elem` [KA,KU] && itemType x2 `elem` [KA,KU] && (not $ sameArea c1' c2')
= compare r1' r2'
| otherwise = 0
where
r1' = foldl1 compose . map snd $ flatten c1
r2' = foldl1 compose . map snd $ flatten c2
c1' = fmap fst c1
c2' = fmap fst c2
| 523
|
sim3 c1@(Node (x1,r1) _) c2@(Node (x2,r2) _)
| ((itemType x1 == KT && itemType x2 /= KT) ||
(itemType x1 /= KT && itemType x2 == KT)) && (not $ sameArea c1' c2')
= 1 - sqrt (1 - compare r1 r2)
| itemType x1 `elem` [KA,KU] && itemType x2 `elem` [KA,KU] && (not $ sameArea c1' c2')
= compare r1' r2'
| otherwise = 0
where
r1' = foldl1 compose . map snd $ flatten c1
r2' = foldl1 compose . map snd $ flatten c2
c1' = fmap fst c1
c2' = fmap fst c2
| 480
| false
| true
| 6
| 15
| 142
| 332
| 153
| 179
| null | null |
comonoidial/ALFIN
|
ExtCore/Parser.hs
|
mit
|
getToken (Pos _ _ token) = token
| 32
|
getToken (Pos _ _ token) = token
| 32
|
getToken (Pos _ _ token) = token
| 32
| false
| false
| 0
| 7
| 6
| 19
| 9
| 10
| null | null |
mariefarrell/Hets
|
OMDoc/XmlInterface.hs
|
gpl-2.0
|
el_oms = toQNOM "OMS"
| 21
|
el_oms = toQNOM "OMS"
| 21
|
el_oms = toQNOM "OMS"
| 21
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
Zankoku-Okuno/ammonite
|
Language/Ammonite/Syntax/Sugar/AnonPoint.hs
|
gpl-3.0
|
_go x@(Name _) = pure x
| 23
|
_go x@(Name _) = pure x
| 23
|
_go x@(Name _) = pure x
| 23
| false
| false
| 1
| 7
| 5
| 27
| 10
| 17
| null | null |
JPMoresmau/ghcid
|
src/Language/Haskell/Ghcid.hs
|
bsd-3-clause
|
-- | Interrupt Ghci, stopping the current computation (if any),
-- but leaving the process open to new input.
interrupt :: Ghci -> IO ()
interrupt = ghciInterrupt
| 164
|
interrupt :: Ghci -> IO ()
interrupt = ghciInterrupt
| 52
|
interrupt = ghciInterrupt
| 25
| true
| true
| 0
| 8
| 29
| 28
| 13
| 15
| null | null |
faylang/fay-server
|
modules/project/Demo/Console.hs
|
bsd-3-clause
|
main :: Fay ()
main = do
print "Hello, World!"
printAnything "Beep!"
-- | The argument must be monomorphic, otherwise Fay can't tell how to serialize it.
| 158
|
main :: Fay ()
main = do
print "Hello, World!"
printAnything "Beep!"
-- | The argument must be monomorphic, otherwise Fay can't tell how to serialize it.
| 158
|
main = do
print "Hello, World!"
printAnything "Beep!"
-- | The argument must be monomorphic, otherwise Fay can't tell how to serialize it.
| 143
| false
| true
| 0
| 8
| 31
| 35
| 14
| 21
| null | null |
forked-upstream-packages-for-ghcjs/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
rep1TyConName = tcQual gHC_GENERICS (fsLit "Rep1") rep1TyConKey
| 63
|
rep1TyConName = tcQual gHC_GENERICS (fsLit "Rep1") rep1TyConKey
| 63
|
rep1TyConName = tcQual gHC_GENERICS (fsLit "Rep1") rep1TyConKey
| 63
| false
| false
| 1
| 7
| 6
| 23
| 9
| 14
| null | null |
sapek/pandoc
|
src/Text/Pandoc/Readers/LaTeX.hs
|
gpl-2.0
|
macron 'i' = "ī"
| 16
|
macron 'i' = "ī"
| 16
|
macron 'i' = "ī"
| 16
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
gafiatulin/codewars
|
src/8 kyu/Odds.hs
|
mit
|
odds :: [Int] -> [Int]
odds = filter odd
| 40
|
odds :: [Int] -> [Int]
odds = filter odd
| 40
|
odds = filter odd
| 17
| false
| true
| 0
| 6
| 8
| 24
| 13
| 11
| null | null |
MichielDerhaeg/stack
|
src/Stack/Image.hs
|
bsd-3-clause
|
fromMaybeProjectRoot :: Maybe (Path Abs Dir) -> Path Abs Dir
fromMaybeProjectRoot =
fromMaybe (impureThrow StackImageCannotDetermineProjectRootException)
| 157
|
fromMaybeProjectRoot :: Maybe (Path Abs Dir) -> Path Abs Dir
fromMaybeProjectRoot =
fromMaybe (impureThrow StackImageCannotDetermineProjectRootException)
| 157
|
fromMaybeProjectRoot =
fromMaybe (impureThrow StackImageCannotDetermineProjectRootException)
| 96
| false
| true
| 0
| 8
| 18
| 40
| 19
| 21
| null | null |
Persi/shellcheck
|
ShellCheck/Analytics.hs
|
gpl-3.0
|
prop_checkStderrRedirect4 = verifyNot checkStderrRedirect "errors=$(test 2>&1 > file)"
| 86
|
prop_checkStderrRedirect4 = verifyNot checkStderrRedirect "errors=$(test 2>&1 > file)"
| 86
|
prop_checkStderrRedirect4 = verifyNot checkStderrRedirect "errors=$(test 2>&1 > file)"
| 86
| false
| false
| 0
| 5
| 7
| 11
| 5
| 6
| null | null |
kumasento/accelerate
|
Data/Array/Accelerate/Analysis/Match.hs
|
bsd-3-clause
|
matchSliceExtend _ _
= Nothing
| 32
|
matchSliceExtend _ _
= Nothing
| 32
|
matchSliceExtend _ _
= Nothing
| 32
| false
| false
| 0
| 5
| 6
| 11
| 5
| 6
| null | null |
technogeeky/d-A
|
include/containers-0.5.0.0/Data/IntMap/Base.hs
|
gpl-3.0
|
equal :: Eq a => IntMap a -> IntMap a -> Bool
equal (Bin p1 m1 l1 r1) (Bin p2 m2 l2 r2)
= (m1 == m2) && (p1 == p2) && (equal l1 l2) && (equal r1 r2)
| 150
|
equal :: Eq a => IntMap a -> IntMap a -> Bool
equal (Bin p1 m1 l1 r1) (Bin p2 m2 l2 r2)
= (m1 == m2) && (p1 == p2) && (equal l1 l2) && (equal r1 r2)
| 150
|
equal (Bin p1 m1 l1 r1) (Bin p2 m2 l2 r2)
= (m1 == m2) && (p1 == p2) && (equal l1 l2) && (equal r1 r2)
| 104
| false
| true
| 0
| 9
| 40
| 103
| 51
| 52
| null | null |
kkspeed/SICP-Practise
|
Interpreter/code/Parse.hs
|
lgpl-3.0
|
readExpr :: String -> ThrowsError LispVal
readExpr input = case parse parseExpr "lisp" input of
Left err -> throwError $ Parser err
Right val -> return val
| 193
|
readExpr :: String -> ThrowsError LispVal
readExpr input = case parse parseExpr "lisp" input of
Left err -> throwError $ Parser err
Right val -> return val
| 193
|
readExpr input = case parse parseExpr "lisp" input of
Left err -> throwError $ Parser err
Right val -> return val
| 151
| false
| true
| 0
| 9
| 64
| 60
| 27
| 33
| null | null |
vbalalla/financial_contract_language
|
calender-new.hs
|
mit
|
x = evalCalenderAt 4 (terms u5)
| 31
|
x = evalCalenderAt 4 (terms u5)
| 31
|
x = evalCalenderAt 4 (terms u5)
| 31
| false
| false
| 1
| 7
| 5
| 20
| 8
| 12
| null | null |
timjb/robot-karel
|
haskell/RobotKarel.hs
|
mit
|
removeBrick :: Karel ()
removeBrick = addBricks (-1)
| 52
|
removeBrick :: Karel ()
removeBrick = addBricks (-1)
| 52
|
removeBrick = addBricks (-1)
| 28
| false
| true
| 0
| 7
| 7
| 24
| 12
| 12
| null | null |
alexisVallet/hnn
|
src/HNN/Data.hs
|
bsd-3-clause
|
runEvery :: (Monad m) => Int -> (a -> m ()) -> Pipe a a m c
runEvery n action = forever $ do
replicateM (n - 1) $ await >>= yield
x <- await
lift $ action x
yield x
| 172
|
runEvery :: (Monad m) => Int -> (a -> m ()) -> Pipe a a m c
runEvery n action = forever $ do
replicateM (n - 1) $ await >>= yield
x <- await
lift $ action x
yield x
| 172
|
runEvery n action = forever $ do
replicateM (n - 1) $ await >>= yield
x <- await
lift $ action x
yield x
| 112
| false
| true
| 0
| 12
| 48
| 102
| 48
| 54
| null | null |
da-x/ghc
|
compiler/basicTypes/IdInfo.hs
|
bsd-3-clause
|
zapFragileInfo :: IdInfo -> Maybe IdInfo
-- ^ Zap info that depends on free variables
zapFragileInfo info
= Just (info `setRuleInfo` emptyRuleInfo
`setUnfoldingInfo` noUnfolding
`setOccInfo` zapFragileOcc occ)
where
occ = occInfo info
{-
************************************************************************
* *
\subsection{TickBoxOp}
* *
************************************************************************
-}
| 594
|
zapFragileInfo :: IdInfo -> Maybe IdInfo
zapFragileInfo info
= Just (info `setRuleInfo` emptyRuleInfo
`setUnfoldingInfo` noUnfolding
`setOccInfo` zapFragileOcc occ)
where
occ = occInfo info
{-
************************************************************************
* *
\subsection{TickBoxOp}
* *
************************************************************************
-}
| 549
|
zapFragileInfo info
= Just (info `setRuleInfo` emptyRuleInfo
`setUnfoldingInfo` noUnfolding
`setOccInfo` zapFragileOcc occ)
where
occ = occInfo info
{-
************************************************************************
* *
\subsection{TickBoxOp}
* *
************************************************************************
-}
| 508
| true
| true
| 1
| 8
| 217
| 69
| 34
| 35
| null | null |
kmate/HaRe
|
old/testing/liftToToplevel/LetIn2AST.hs
|
bsd-3-clause
|
sq z = z ^ pow
| 14
|
sq z = z ^ pow
| 14
|
sq z = z ^ pow
| 14
| false
| false
| 0
| 5
| 5
| 13
| 6
| 7
| null | null |
nevrenato/Hets_Fork
|
PGIP/XMLstate.hs
|
gpl-2.0
|
-- adds a ready element at the end of the xml packet that represents the
-- current output of the interface to the broker
addPGIPReady :: CmdlPgipState -> CmdlPgipState
addPGIPReady pgData = addPGIPElement pgData $ unode "ready" ()
| 231
|
addPGIPReady :: CmdlPgipState -> CmdlPgipState
addPGIPReady pgData = addPGIPElement pgData $ unode "ready" ()
| 109
|
addPGIPReady pgData = addPGIPElement pgData $ unode "ready" ()
| 62
| true
| true
| 0
| 7
| 37
| 34
| 17
| 17
| null | null |
geraldus/transient
|
src/Transient/Backtrack.hs
|
mit
|
-- | initialize the event variable for finalization.
-- all the following computations in different threads will share it
-- it also isolate this event from other branches that may have his own finish variable
initFinish= backCut (FinishReason Nothing)
| 255
|
initFinish= backCut (FinishReason Nothing)
| 42
|
initFinish= backCut (FinishReason Nothing)
| 42
| true
| false
| 0
| 7
| 41
| 18
| 10
| 8
| null | null |
atomb/dalvik
|
Dalvik/Printer.hs
|
bsd-3-clause
|
insnString dex _ (LoadConst d c@(ConstWideHigh16 _)) =
constStr dex "const-wide/high16" d c
| 93
|
insnString dex _ (LoadConst d c@(ConstWideHigh16 _)) =
constStr dex "const-wide/high16" d c
| 93
|
insnString dex _ (LoadConst d c@(ConstWideHigh16 _)) =
constStr dex "const-wide/high16" d c
| 93
| false
| false
| 1
| 9
| 14
| 46
| 19
| 27
| null | null |
pparkkin/eta
|
compiler/ETA/Prelude/TysWiredIn.hs
|
bsd-3-clause
|
gtDataCon = pcDataCon gtDataConName [] [] orderingTyCon
| 56
|
gtDataCon = pcDataCon gtDataConName [] [] orderingTyCon
| 56
|
gtDataCon = pcDataCon gtDataConName [] [] orderingTyCon
| 56
| false
| false
| 0
| 6
| 7
| 19
| 9
| 10
| null | null |
pusher-community/pusher-http-haskell
|
src/Network/Pusher/Internal.hs
|
mit
|
mkGetRequest ::
Pusher ->
B.ByteString ->
Query ->
Word64 ->
RequestParams
mkGetRequest pusher subPath params = mkRequest pusher "GET" subPath params ""
| 162
|
mkGetRequest ::
Pusher ->
B.ByteString ->
Query ->
Word64 ->
RequestParams
mkGetRequest pusher subPath params = mkRequest pusher "GET" subPath params ""
| 162
|
mkGetRequest pusher subPath params = mkRequest pusher "GET" subPath params ""
| 77
| false
| true
| 0
| 10
| 31
| 52
| 24
| 28
| null | null |
rudymatela/leancheck
|
src/Test/LeanCheck/Utils/Operators.hs
|
bsd-3-clause
|
distributive :: Eq a => (a -> a -> a) -> (a -> a -> a) -> a -> a -> a -> Bool
distributive = isDistributiveOver
| 113
|
distributive :: Eq a => (a -> a -> a) -> (a -> a -> a) -> a -> a -> a -> Bool
distributive = isDistributiveOver
| 113
|
distributive = isDistributiveOver
| 35
| false
| true
| 0
| 12
| 28
| 67
| 32
| 35
| null | null |
nitrix/lspace
|
legacy/Camera.hs
|
unlicense
|
cameraMove East = cameraCoordinate . coordinateX %~ (+1)
| 57
|
cameraMove East = cameraCoordinate . coordinateX %~ (+1)
| 57
|
cameraMove East = cameraCoordinate . coordinateX %~ (+1)
| 57
| false
| false
| 0
| 6
| 8
| 21
| 11
| 10
| null | null |
riccardotommasini/plp16
|
haskell/prepared/ESE20181109/ESE20181109.hs
|
apache-2.0
|
pointy (ClikePoint _ y) = y
| 27
|
pointy (ClikePoint _ y) = y
| 27
|
pointy (ClikePoint _ y) = y
| 27
| false
| false
| 0
| 6
| 5
| 18
| 8
| 10
| null | null |
asmyczek/hreviewboard
|
ReviewBoard/Response.hs
|
bsd-3-clause
|
err = (mkrb "err") :: JSValue -> JSValue
| 66
|
err = (mkrb "err") :: JSValue -> JSValue
| 66
|
err = (mkrb "err") :: JSValue -> JSValue
| 66
| false
| false
| 0
| 6
| 33
| 19
| 10
| 9
| null | null |
chpatrick/rethinkdb-typed
|
src/Database/RethinkDB/Typed.hs
|
mit
|
-- Aggregation
reduce :: Sequence s => (Expr a -> Expr a -> Expr a) -> Expr (s a) -> Expr a
reduce = coerce (R.reduce :: (ReQL -> ReQL -> ReQL) -> ReQL -> ReQL)
| 161
|
reduce :: Sequence s => (Expr a -> Expr a -> Expr a) -> Expr (s a) -> Expr a
reduce = coerce (R.reduce :: (ReQL -> ReQL -> ReQL) -> ReQL -> ReQL)
| 145
|
reduce = coerce (R.reduce :: (ReQL -> ReQL -> ReQL) -> ReQL -> ReQL)
| 68
| true
| true
| 0
| 10
| 36
| 89
| 44
| 45
| null | null |
dblia/nosql-ganeti
|
src/Ganeti/HTools/CLI.hs
|
gpl-2.0
|
maybePrintNodes (Just fields) msg fn = do
hPutStrLn stderr ""
hPutStrLn stderr (msg ++ " status:")
hPutStrLn stderr $ fn fields
-- | Optionally print the instance list.
| 175
|
maybePrintNodes (Just fields) msg fn = do
hPutStrLn stderr ""
hPutStrLn stderr (msg ++ " status:")
hPutStrLn stderr $ fn fields
-- | Optionally print the instance list.
| 175
|
maybePrintNodes (Just fields) msg fn = do
hPutStrLn stderr ""
hPutStrLn stderr (msg ++ " status:")
hPutStrLn stderr $ fn fields
-- | Optionally print the instance list.
| 175
| false
| false
| 0
| 9
| 34
| 56
| 25
| 31
| null | null |
bobgru/tree-derivations
|
src/LSystem5.hs
|
mit
|
buildXfm' m f (x:xs) = buildXfm' m (g . f) xs
where g = fromJust (M.lookup x m)
--parseRule :: Text -> Tree [String]
| 121
|
buildXfm' m f (x:xs) = buildXfm' m (g . f) xs
where g = fromJust (M.lookup x m)
--parseRule :: Text -> Tree [String]
| 121
|
buildXfm' m f (x:xs) = buildXfm' m (g . f) xs
where g = fromJust (M.lookup x m)
--parseRule :: Text -> Tree [String]
| 121
| false
| false
| 0
| 10
| 28
| 55
| 28
| 27
| null | null |
FunctioningIdiots/jilo-cli-haskell
|
src/Jilo/Cli.hs
|
mit
|
parseArgs ("stats" : _) = NotImplemented "stats"
| 48
|
parseArgs ("stats" : _) = NotImplemented "stats"
| 48
|
parseArgs ("stats" : _) = NotImplemented "stats"
| 48
| false
| false
| 0
| 6
| 6
| 20
| 9
| 11
| null | null |
VictorDenisov/keystone
|
src/Keystone/Web/Domain.hs
|
gpl-2.0
|
listDomainsH :: (Functor m, MonadIO m, IdentityApi m)
=> AT.Policy -> KeystoneConfig -> ActionM m ()
listDomainsH policy config = A.requireToken config $ \token -> do
A.authorize policy AT.ListDomains token AT.EmptyResource $ do
S.status status200
withHostUrl config $ produceDomainsReply []
| 319
|
listDomainsH :: (Functor m, MonadIO m, IdentityApi m)
=> AT.Policy -> KeystoneConfig -> ActionM m ()
listDomainsH policy config = A.requireToken config $ \token -> do
A.authorize policy AT.ListDomains token AT.EmptyResource $ do
S.status status200
withHostUrl config $ produceDomainsReply []
| 319
|
listDomainsH policy config = A.requireToken config $ \token -> do
A.authorize policy AT.ListDomains token AT.EmptyResource $ do
S.status status200
withHostUrl config $ produceDomainsReply []
| 206
| false
| true
| 0
| 15
| 67
| 118
| 54
| 64
| null | null |
acowley/ghc
|
compiler/coreSyn/TrieMap.hs
|
bsd-3-clause
|
xtT (D env (TyConApp tc tys)) f m = m { tm_tc_app = tm_tc_app m |> xtNamed tc
|>> xtList (xtG . D env) tys f }
| 158
|
xtT (D env (TyConApp tc tys)) f m = m { tm_tc_app = tm_tc_app m |> xtNamed tc
|>> xtList (xtG . D env) tys f }
| 158
|
xtT (D env (TyConApp tc tys)) f m = m { tm_tc_app = tm_tc_app m |> xtNamed tc
|>> xtList (xtG . D env) tys f }
| 158
| false
| false
| 1
| 12
| 74
| 71
| 33
| 38
| null | null |
eklavya/Idris-dev
|
src/Idris/AbsSyntaxTree.hs
|
bsd-3-clause
|
getShowArgs :: [PArg] -> [PArg]
getShowArgs [] = []
| 51
|
getShowArgs :: [PArg] -> [PArg]
getShowArgs [] = []
| 51
|
getShowArgs [] = []
| 19
| false
| true
| 0
| 6
| 8
| 28
| 15
| 13
| null | null |
noughtmare/yi
|
yi-keymap-vim/src/Yi/Keymap/Vim/Operator.hs
|
gpl-2.0
|
formatRegionB _style reg = do
start <- solPointB $ regionStart reg
end <- eolPointB $ regionEnd reg
moveTo start
-- Don't use firstNonSpaceB since paragraphs can start with lines made
-- completely of whitespace (which should be fixed)
untilB_ ((not . isSpace) <$> readB) rightB
indent <- curCol
modifyRegionB (formatStringWithIndent indent) $ reg { regionStart = start
, regionEnd = end
}
-- Emulate vim behaviour
moveTo =<< solPointB end
firstNonSpaceB
| 610
|
formatRegionB _style reg = do
start <- solPointB $ regionStart reg
end <- eolPointB $ regionEnd reg
moveTo start
-- Don't use firstNonSpaceB since paragraphs can start with lines made
-- completely of whitespace (which should be fixed)
untilB_ ((not . isSpace) <$> readB) rightB
indent <- curCol
modifyRegionB (formatStringWithIndent indent) $ reg { regionStart = start
, regionEnd = end
}
-- Emulate vim behaviour
moveTo =<< solPointB end
firstNonSpaceB
| 610
|
formatRegionB _style reg = do
start <- solPointB $ regionStart reg
end <- eolPointB $ regionEnd reg
moveTo start
-- Don't use firstNonSpaceB since paragraphs can start with lines made
-- completely of whitespace (which should be fixed)
untilB_ ((not . isSpace) <$> readB) rightB
indent <- curCol
modifyRegionB (formatStringWithIndent indent) $ reg { regionStart = start
, regionEnd = end
}
-- Emulate vim behaviour
moveTo =<< solPointB end
firstNonSpaceB
| 610
| false
| false
| 0
| 11
| 226
| 120
| 57
| 63
| null | null |
NICTA/validation
|
examples/src/Person.hs
|
bsd-3-clause
|
-- Right (Person {name = Name {unName = "Bob"}, email = Email {unEmail = "bob@gmail.com"}, age = Age {unAge = 25}})
asEitherBad :: Either [Error] Person
asEitherBad = badEverything ^. _Either
| 192
|
asEitherBad :: Either [Error] Person
asEitherBad = badEverything ^. _Either
| 75
|
asEitherBad = badEverything ^. _Either
| 38
| true
| true
| 0
| 6
| 31
| 24
| 13
| 11
| null | null |
ezyang/ghc
|
compiler/cmm/SMRep.hs
|
bsd-3-clause
|
hdrSizeW dflags (ArrayPtrsRep _ _) = arrPtrsHdrSizeW dflags
| 62
|
hdrSizeW dflags (ArrayPtrsRep _ _) = arrPtrsHdrSizeW dflags
| 62
|
hdrSizeW dflags (ArrayPtrsRep _ _) = arrPtrsHdrSizeW dflags
| 62
| false
| false
| 0
| 6
| 10
| 24
| 10
| 14
| null | null |
grnet/snf-ganeti
|
src/Ganeti/Constants.hs
|
bsd-2-clause
|
idiskParams :: FrozenSet String
idiskParams = ConstantUtils.mkSet (Map.keys idiskParamsTypes)
| 93
|
idiskParams :: FrozenSet String
idiskParams = ConstantUtils.mkSet (Map.keys idiskParamsTypes)
| 93
|
idiskParams = ConstantUtils.mkSet (Map.keys idiskParamsTypes)
| 61
| false
| true
| 0
| 8
| 8
| 32
| 14
| 18
| null | null |
TravisWhitaker/rdf
|
src/Data/RDF/Graph.hs
|
mit
|
objectNode (LiteralObject l) = LiteralGNode l
| 45
|
objectNode (LiteralObject l) = LiteralGNode l
| 45
|
objectNode (LiteralObject l) = LiteralGNode l
| 45
| false
| false
| 0
| 7
| 5
| 18
| 8
| 10
| null | null |
jepst/CloudHaskell
|
examples/pi/Pi7.hs
|
bsd-3-clause
|
main = remoteInit (Just "config") [Main.__remoteCallMetaData] initialProcess
| 76
|
main = remoteInit (Just "config") [Main.__remoteCallMetaData] initialProcess
| 76
|
main = remoteInit (Just "config") [Main.__remoteCallMetaData] initialProcess
| 76
| false
| false
| 0
| 7
| 6
| 24
| 12
| 12
| null | null |
lukexi/ghc
|
compiler/main/DynFlags.hs
|
bsd-3-clause
|
supportedLanguageOverlays :: [String]
supportedLanguageOverlays = [ name | (name, _, _) <- safeHaskellFlags ]
| 109
|
supportedLanguageOverlays :: [String]
supportedLanguageOverlays = [ name | (name, _, _) <- safeHaskellFlags ]
| 109
|
supportedLanguageOverlays = [ name | (name, _, _) <- safeHaskellFlags ]
| 71
| false
| true
| 0
| 8
| 13
| 34
| 20
| 14
| null | null |
bhamrick/hsmath
|
Math/Polynomial/Division.hs
|
bsd-3-clause
|
divModPoly :: (Eq a, Fractional a) => P a -> P a -> (P a, P a)
divModPoly (P as) (P bs) =
let (q', r') = _divModPoly (reverse as) (reverse bs)
in (P (reverse . dropWhile (== 0) $ q'), P (reverse . dropWhile (== 0) $ r'))
| 228
|
divModPoly :: (Eq a, Fractional a) => P a -> P a -> (P a, P a)
divModPoly (P as) (P bs) =
let (q', r') = _divModPoly (reverse as) (reverse bs)
in (P (reverse . dropWhile (== 0) $ q'), P (reverse . dropWhile (== 0) $ r'))
| 228
|
divModPoly (P as) (P bs) =
let (q', r') = _divModPoly (reverse as) (reverse bs)
in (P (reverse . dropWhile (== 0) $ q'), P (reverse . dropWhile (== 0) $ r'))
| 165
| false
| true
| 0
| 13
| 56
| 152
| 77
| 75
| null | null |
rahulmutt/ghcvm
|
compiler/Eta/Core/CoreFVs.hs
|
bsd-3-clause
|
-- | Find all locally defined free Ids in a binding group
bindFreeVars :: CoreBind -> VarSet
bindFreeVars (NonRec b r) = fvVarSet $ filterFV isLocalVar $ rhs_fvs (b,r)
| 167
|
bindFreeVars :: CoreBind -> VarSet
bindFreeVars (NonRec b r) = fvVarSet $ filterFV isLocalVar $ rhs_fvs (b,r)
| 109
|
bindFreeVars (NonRec b r) = fvVarSet $ filterFV isLocalVar $ rhs_fvs (b,r)
| 74
| true
| true
| 0
| 7
| 28
| 47
| 24
| 23
| null | null |
kmspriyatham/nlp
|
nlp.hs
|
mit
|
ngramModel :: Int -> String -> Map [String] Double
ngramModel n x = Data.Map.map (\x -> logBase 10 (fromIntegral x) - lsmx) mx
where lsmx = logBase 10 (fromIntegral $ length tx)
mx = foldl' (\x y -> insertWith (+) y 1 x) empty tx
tx = ngrams n x
| 309
|
ngramModel :: Int -> String -> Map [String] Double
ngramModel n x = Data.Map.map (\x -> logBase 10 (fromIntegral x) - lsmx) mx
where lsmx = logBase 10 (fromIntegral $ length tx)
mx = foldl' (\x y -> insertWith (+) y 1 x) empty tx
tx = ngrams n x
| 308
|
ngramModel n x = Data.Map.map (\x -> logBase 10 (fromIntegral x) - lsmx) mx
where lsmx = logBase 10 (fromIntegral $ length tx)
mx = foldl' (\x y -> insertWith (+) y 1 x) empty tx
tx = ngrams n x
| 257
| false
| true
| 0
| 11
| 113
| 128
| 66
| 62
| null | null |
dzamkov/Oedel
|
src/Graphics/Oedel/Terminal/Draw.hs
|
mit
|
withAppearance :: Appearance -> Draw -> Draw
withAppearance appr (Draw ops) = Draw $ map f ops where
f (String _ offset str) = String appr offset str
f (Space _ offset wid) = Space (fst appr) offset wid
-- | Performs a drawing operation on the current terminal within a REPL
-- output section. This assumes that the origin of the drawing is at the top-
-- left corner of the section.
| 399
|
withAppearance :: Appearance -> Draw -> Draw
withAppearance appr (Draw ops) = Draw $ map f ops where
f (String _ offset str) = String appr offset str
f (Space _ offset wid) = Space (fst appr) offset wid
-- | Performs a drawing operation on the current terminal within a REPL
-- output section. This assumes that the origin of the drawing is at the top-
-- left corner of the section.
| 398
|
withAppearance appr (Draw ops) = Draw $ map f ops where
f (String _ offset str) = String appr offset str
f (Space _ offset wid) = Space (fst appr) offset wid
-- | Performs a drawing operation on the current terminal within a REPL
-- output section. This assumes that the origin of the drawing is at the top-
-- left corner of the section.
| 353
| false
| true
| 0
| 9
| 88
| 105
| 51
| 54
| null | null |
pgj/bead
|
src/Test/Tasty/TestSet.hs
|
bsd-3-clause
|
-- IO related test suite
ioTest :: TestName -> IO a -> TestSet ()
ioTest name computation = add (HU.testCase name (void computation))
| 134
|
ioTest :: TestName -> IO a -> TestSet ()
ioTest name computation = add (HU.testCase name (void computation))
| 108
|
ioTest name computation = add (HU.testCase name (void computation))
| 67
| true
| true
| 0
| 9
| 23
| 56
| 26
| 30
| null | null |
carlohamalainen/imagetrove-uploader
|
src/Network/ImageTrove/Utils.hs
|
bsd-2-clause
|
getWithE opts x = (Right <$> getWith opts x) `catch` handler
where
handler (e :: SomeException) = return $ Left $ "Error in getWithE: " ++ show e
| 151
|
getWithE opts x = (Right <$> getWith opts x) `catch` handler
where
handler (e :: SomeException) = return $ Left $ "Error in getWithE: " ++ show e
| 151
|
getWithE opts x = (Right <$> getWith opts x) `catch` handler
where
handler (e :: SomeException) = return $ Left $ "Error in getWithE: " ++ show e
| 151
| false
| false
| 0
| 8
| 33
| 62
| 31
| 31
| null | null |
peterokagey/haskellOEIS
|
test/Tables/A273825Spec.hs
|
apache-2.0
|
spec :: Spec
spec = describe "A273825" $
it "correctly computes the first 20 elements" $
take 20 (map a273825 [1..]) `shouldBe` expectedValue where
expectedValue = [1,2,3,4,5,1,6,7,8,2,9,3,10,11,12,4,13,5,1,14]
-- Row 1: []
-- Row 2: []
-- Row 3: []
-- Row 4: []
-- Row 5: [1]
-- Row 6: []
-- Row 7: []
-- Row 8: [2]
-- Row 9: [3]
-- Row 10: []
-- Row 11: []
-- Row 12: [4]
-- Row 13: [5, 1]
-- Row 14: [6]
-- Row 15: []
-- Row 16: []
-- Row 17: [7]
-- Row 18: [8, 2]
-- Row 19: [9, 3]
-- Row 20: [10]
-- Row 21: []
-- Row 22: []
-- Row 23: [11]
| 558
|
spec :: Spec
spec = describe "A273825" $
it "correctly computes the first 20 elements" $
take 20 (map a273825 [1..]) `shouldBe` expectedValue where
expectedValue = [1,2,3,4,5,1,6,7,8,2,9,3,10,11,12,4,13,5,1,14]
-- Row 1: []
-- Row 2: []
-- Row 3: []
-- Row 4: []
-- Row 5: [1]
-- Row 6: []
-- Row 7: []
-- Row 8: [2]
-- Row 9: [3]
-- Row 10: []
-- Row 11: []
-- Row 12: [4]
-- Row 13: [5, 1]
-- Row 14: [6]
-- Row 15: []
-- Row 16: []
-- Row 17: [7]
-- Row 18: [8, 2]
-- Row 19: [9, 3]
-- Row 20: [10]
-- Row 21: []
-- Row 22: []
-- Row 23: [11]
| 558
|
spec = describe "A273825" $
it "correctly computes the first 20 elements" $
take 20 (map a273825 [1..]) `shouldBe` expectedValue where
expectedValue = [1,2,3,4,5,1,6,7,8,2,9,3,10,11,12,4,13,5,1,14]
-- Row 1: []
-- Row 2: []
-- Row 3: []
-- Row 4: []
-- Row 5: [1]
-- Row 6: []
-- Row 7: []
-- Row 8: [2]
-- Row 9: [3]
-- Row 10: []
-- Row 11: []
-- Row 12: [4]
-- Row 13: [5, 1]
-- Row 14: [6]
-- Row 15: []
-- Row 16: []
-- Row 17: [7]
-- Row 18: [8, 2]
-- Row 19: [9, 3]
-- Row 20: [10]
-- Row 21: []
-- Row 22: []
-- Row 23: [11]
| 545
| false
| true
| 0
| 10
| 134
| 137
| 91
| 46
| null | null |
agrafix/legoDSL
|
NXT/Types.hs
|
bsd-3-clause
|
prettyOp :: BinOpT -> String
prettyOp BAdd = "+"
| 48
|
prettyOp :: BinOpT -> String
prettyOp BAdd = "+"
| 48
|
prettyOp BAdd = "+"
| 19
| false
| true
| 0
| 7
| 8
| 24
| 10
| 14
| null | null |
Zigazou/containers
|
Data/Sequence.hs
|
bsd-3-clause
|
cycleN n (Seq xsFT) = case rigidify xsFT of
RigidEmpty -> empty
RigidOne (Elem x) -> replicate n x
RigidTwo x1 x2 -> Seq $
Deep (n*2) pair
(runIdentity $ applicativeTree (n-2) 2 (Identity (node2 x1 x2)))
pair
where pair = Two x1 x2
RigidThree x1 x2 x3 -> Seq $
Deep (n*3) triple
(runIdentity $ applicativeTree (n-2) 3 (Identity (node3 x1 x2 x3)))
triple
where triple = Three x1 x2 x3
RigidFull r@(Rigid s pr _m sf) -> Seq $
Deep (n*s)
(nodeToDigit pr)
(cycleNMiddle (n-2) r)
(nodeToDigit sf)
| 787
|
cycleN n (Seq xsFT) = case rigidify xsFT of
RigidEmpty -> empty
RigidOne (Elem x) -> replicate n x
RigidTwo x1 x2 -> Seq $
Deep (n*2) pair
(runIdentity $ applicativeTree (n-2) 2 (Identity (node2 x1 x2)))
pair
where pair = Two x1 x2
RigidThree x1 x2 x3 -> Seq $
Deep (n*3) triple
(runIdentity $ applicativeTree (n-2) 3 (Identity (node3 x1 x2 x3)))
triple
where triple = Three x1 x2 x3
RigidFull r@(Rigid s pr _m sf) -> Seq $
Deep (n*s)
(nodeToDigit pr)
(cycleNMiddle (n-2) r)
(nodeToDigit sf)
| 787
|
cycleN n (Seq xsFT) = case rigidify xsFT of
RigidEmpty -> empty
RigidOne (Elem x) -> replicate n x
RigidTwo x1 x2 -> Seq $
Deep (n*2) pair
(runIdentity $ applicativeTree (n-2) 2 (Identity (node2 x1 x2)))
pair
where pair = Two x1 x2
RigidThree x1 x2 x3 -> Seq $
Deep (n*3) triple
(runIdentity $ applicativeTree (n-2) 3 (Identity (node3 x1 x2 x3)))
triple
where triple = Three x1 x2 x3
RigidFull r@(Rigid s pr _m sf) -> Seq $
Deep (n*s)
(nodeToDigit pr)
(cycleNMiddle (n-2) r)
(nodeToDigit sf)
| 787
| false
| false
| 0
| 16
| 385
| 283
| 140
| 143
| null | null |
h8gi/Open-usp-Tukubai
|
COMMANDS.HS/marume.hs
|
mit
|
pickOp :: [Field] -> Int -> Maybe Field
pickOp fs pos = if length x == 0 then Nothing else Just $ Prelude.head x
where f pos (Field p _) = p == pos
x = filter (f pos) fs
| 205
|
pickOp :: [Field] -> Int -> Maybe Field
pickOp fs pos = if length x == 0 then Nothing else Just $ Prelude.head x
where f pos (Field p _) = p == pos
x = filter (f pos) fs
| 205
|
pickOp fs pos = if length x == 0 then Nothing else Just $ Prelude.head x
where f pos (Field p _) = p == pos
x = filter (f pos) fs
| 165
| false
| true
| 1
| 8
| 75
| 103
| 48
| 55
| null | null |
mstksg/hledger
|
hledger-lib/Hledger/Utils/Debug.hs
|
gpl-3.0
|
-- | Convenience aliases for tracePrettyAtIO.
-- Like dbg, but convenient to insert in an IO monad.
-- XXX These have a bug; they should use traceIO, not trace,
-- otherwise GHC can occasionally over-optimise
-- (cf lpaste a few days ago where it killed/blocked a child thread).
dbg0IO :: (MonadIO m, Show a) => String -> a -> m ()
dbg0IO = tracePrettyAtIO 0
| 358
|
dbg0IO :: (MonadIO m, Show a) => String -> a -> m ()
dbg0IO = tracePrettyAtIO 0
| 79
|
dbg0IO = tracePrettyAtIO 0
| 26
| true
| true
| 0
| 9
| 64
| 47
| 26
| 21
| null | null |
ihc/futhark
|
src/Futhark/Util.hs
|
isc
|
encodeChar '.' = "zi"
| 22
|
encodeChar '.' = "zi"
| 22
|
encodeChar '.' = "zi"
| 22
| false
| false
| 1
| 5
| 4
| 13
| 4
| 9
| null | null |
fmapfmapfmap/amazonka
|
amazonka-cognito-sync/gen/Network/AWS/CognitoSync/UpdateRecords.hs
|
mpl-2.0
|
-- | The unique ID generated for this device by Cognito.
urDeviceId :: Lens' UpdateRecords (Maybe Text)
urDeviceId = lens _urDeviceId (\ s a -> s{_urDeviceId = a})
| 163
|
urDeviceId :: Lens' UpdateRecords (Maybe Text)
urDeviceId = lens _urDeviceId (\ s a -> s{_urDeviceId = a})
| 106
|
urDeviceId = lens _urDeviceId (\ s a -> s{_urDeviceId = a})
| 59
| true
| true
| 0
| 9
| 27
| 46
| 25
| 21
| null | null |
Denommus/stack
|
src/Stack/Dot.hs
|
bsd-3-clause
|
localDependencies :: DotOpts -> [LocalPackage] -> [(PackageName,(Set PackageName,Maybe Version))]
localDependencies dotOpts locals =
map (\lp -> (packageName (lpPackage lp), (deps lp,Just (lpVersion lp)))) locals
where deps lp = if dotIncludeExternal dotOpts
then Set.delete (lpName lp) (packageAllDeps (lpPackage lp))
else Set.intersection localNames (packageAllDeps (lpPackage lp))
lpName lp = packageName (lpPackage lp)
localNames = Set.fromList $ map (packageName . lpPackage) locals
lpVersion lp = packageVersion (lpPackage lp)
-- | Print a graphviz graph of the edges in the Map and highlight the given local packages
| 686
|
localDependencies :: DotOpts -> [LocalPackage] -> [(PackageName,(Set PackageName,Maybe Version))]
localDependencies dotOpts locals =
map (\lp -> (packageName (lpPackage lp), (deps lp,Just (lpVersion lp)))) locals
where deps lp = if dotIncludeExternal dotOpts
then Set.delete (lpName lp) (packageAllDeps (lpPackage lp))
else Set.intersection localNames (packageAllDeps (lpPackage lp))
lpName lp = packageName (lpPackage lp)
localNames = Set.fromList $ map (packageName . lpPackage) locals
lpVersion lp = packageVersion (lpPackage lp)
-- | Print a graphviz graph of the edges in the Map and highlight the given local packages
| 686
|
localDependencies dotOpts locals =
map (\lp -> (packageName (lpPackage lp), (deps lp,Just (lpVersion lp)))) locals
where deps lp = if dotIncludeExternal dotOpts
then Set.delete (lpName lp) (packageAllDeps (lpPackage lp))
else Set.intersection localNames (packageAllDeps (lpPackage lp))
lpName lp = packageName (lpPackage lp)
localNames = Set.fromList $ map (packageName . lpPackage) locals
lpVersion lp = packageVersion (lpPackage lp)
-- | Print a graphviz graph of the edges in the Map and highlight the given local packages
| 588
| false
| true
| 4
| 12
| 145
| 235
| 112
| 123
| null | null |
Th30n/hasgel
|
src/Hasgel/GL/Framebuffer.hs
|
mit
|
marshalFramebufferTarget DrawFramebuffer = GL_DRAW_FRAMEBUFFER
| 62
|
marshalFramebufferTarget DrawFramebuffer = GL_DRAW_FRAMEBUFFER
| 62
|
marshalFramebufferTarget DrawFramebuffer = GL_DRAW_FRAMEBUFFER
| 62
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
ArturB/Multilinear
|
src/Multilinear/Generic/GPU.hs
|
gpl-3.0
|
zipT ::
(Double -> Double -> Double) -- ^ The zipping combinator
-> Tensor Double -- ^ First tensor to zip
-> Tensor Double -- ^ Second tensor to zip
-> Tensor Double -- ^ Result tensor
-- Two simple tensors case
zipT f t1@(SimpleFinite index1 v1) t2@(SimpleFinite index2 v2) =
if index1 == index2 then
SimpleFinite index1 $ StorableV.zipWith f v1 v2
else dot t1 t2
| 457
|
zipT ::
(Double -> Double -> Double) -- ^ The zipping combinator
-> Tensor Double -- ^ First tensor to zip
-> Tensor Double -- ^ Second tensor to zip
-> Tensor Double
zipT f t1@(SimpleFinite index1 v1) t2@(SimpleFinite index2 v2) =
if index1 == index2 then
SimpleFinite index1 $ StorableV.zipWith f v1 v2
else dot t1 t2
| 396
|
zipT f t1@(SimpleFinite index1 v1) t2@(SimpleFinite index2 v2) =
if index1 == index2 then
SimpleFinite index1 $ StorableV.zipWith f v1 v2
else dot t1 t2
| 171
| true
| true
| 0
| 8
| 158
| 110
| 57
| 53
| null | null |
nuttycom/haskoin
|
tests/Network/Haskoin/Crypto/Base58/Tests.hs
|
unlicense
|
decodeEncode58 :: ArbitraryByteString -> Bool
decodeEncode58 (ArbitraryByteString bs) =
decodeBase58 (encodeBase58 bs) == Just bs
| 134
|
decodeEncode58 :: ArbitraryByteString -> Bool
decodeEncode58 (ArbitraryByteString bs) =
decodeBase58 (encodeBase58 bs) == Just bs
| 134
|
decodeEncode58 (ArbitraryByteString bs) =
decodeBase58 (encodeBase58 bs) == Just bs
| 88
| false
| true
| 0
| 8
| 19
| 40
| 19
| 21
| null | null |
urbanslug/ghc
|
compiler/main/DynFlags.hs
|
bsd-3-clause
|
supportedLanguages :: [String]
supportedLanguages = map flagSpecName languageFlags
| 82
|
supportedLanguages :: [String]
supportedLanguages = map flagSpecName languageFlags
| 82
|
supportedLanguages = map flagSpecName languageFlags
| 51
| false
| true
| 0
| 5
| 7
| 19
| 10
| 9
| null | null |
taylor1791/adventofcode
|
2015/src/Day19.hs
|
bsd-2-clause
|
replacement :: String -> (String, String) -> [String]
replacement s (regex, splice) = map (replace splice) $ multiMatch regex s
| 127
|
replacement :: String -> (String, String) -> [String]
replacement s (regex, splice) = map (replace splice) $ multiMatch regex s
| 127
|
replacement s (regex, splice) = map (replace splice) $ multiMatch regex s
| 73
| false
| true
| 0
| 8
| 19
| 62
| 31
| 31
| null | null |
sakari/hgit
|
src/Git/Commit.hs
|
gpl-2.0
|
lookup::Repository -> Oid -> Result Commit
lookup repo oid = lookup_wrapped_object repo oid wrap c'GIT_OBJ_COMMIT
where
wrap fptr = Commit { commit_ptr = fptr, commit_repo_ptr = repository_ptr repo}
| 204
|
lookup::Repository -> Oid -> Result Commit
lookup repo oid = lookup_wrapped_object repo oid wrap c'GIT_OBJ_COMMIT
where
wrap fptr = Commit { commit_ptr = fptr, commit_repo_ptr = repository_ptr repo}
| 204
|
lookup repo oid = lookup_wrapped_object repo oid wrap c'GIT_OBJ_COMMIT
where
wrap fptr = Commit { commit_ptr = fptr, commit_repo_ptr = repository_ptr repo}
| 161
| false
| true
| 1
| 8
| 33
| 73
| 33
| 40
| null | null |
tabemann/botwars
|
src/Robots/Genetic/HunterKiller/Mutate.hs
|
bsd-3-clause
|
randomSimple :: Int -> Int -> State.State RobotMutate RobotExpr
randomSimple contextDepth totalDepth = do
params <- robotMutateParams <$> State.get
exprValue <- random
let constWeight = robotParamsRandomSimpleConstWeight params
specialConstWeight = robotParamsRandomSimpleSpecialConstWeight params
maxCodeDepth = robotParamsMaxCodeDepth params
if totalDepth < maxCodeDepth - 1
then do if exprValue < constWeight
then RobotConst <$> randomValue (totalDepth + 1)
else if exprValue < constWeight + specialConstWeight
then randomSpecialConst
else RobotLoad <$> randomR (0, contextDepth - 1)
else if exprValue < specialConstWeight
then randomSpecialConst
else RobotLoad <$> randomR (0, contextDepth - 1)
-- | Modify a value randomly.
| 821
|
randomSimple :: Int -> Int -> State.State RobotMutate RobotExpr
randomSimple contextDepth totalDepth = do
params <- robotMutateParams <$> State.get
exprValue <- random
let constWeight = robotParamsRandomSimpleConstWeight params
specialConstWeight = robotParamsRandomSimpleSpecialConstWeight params
maxCodeDepth = robotParamsMaxCodeDepth params
if totalDepth < maxCodeDepth - 1
then do if exprValue < constWeight
then RobotConst <$> randomValue (totalDepth + 1)
else if exprValue < constWeight + specialConstWeight
then randomSpecialConst
else RobotLoad <$> randomR (0, contextDepth - 1)
else if exprValue < specialConstWeight
then randomSpecialConst
else RobotLoad <$> randomR (0, contextDepth - 1)
-- | Modify a value randomly.
| 821
|
randomSimple contextDepth totalDepth = do
params <- robotMutateParams <$> State.get
exprValue <- random
let constWeight = robotParamsRandomSimpleConstWeight params
specialConstWeight = robotParamsRandomSimpleSpecialConstWeight params
maxCodeDepth = robotParamsMaxCodeDepth params
if totalDepth < maxCodeDepth - 1
then do if exprValue < constWeight
then RobotConst <$> randomValue (totalDepth + 1)
else if exprValue < constWeight + specialConstWeight
then randomSpecialConst
else RobotLoad <$> randomR (0, contextDepth - 1)
else if exprValue < specialConstWeight
then randomSpecialConst
else RobotLoad <$> randomR (0, contextDepth - 1)
-- | Modify a value randomly.
| 757
| false
| true
| 0
| 15
| 184
| 190
| 97
| 93
| null | null |
fmapfmapfmap/amazonka
|
amazonka-swf/gen/Network/AWS/SWF/Types/Product.hs
|
mpl-2.0
|
-- | If the type is in deprecated state, then it is set to the date when the
-- type was deprecated.
wtiDeprecationDate :: Lens' WorkflowTypeInfo (Maybe UTCTime)
wtiDeprecationDate = lens _wtiDeprecationDate (\ s a -> s{_wtiDeprecationDate = a}) . mapping _Time
| 261
|
wtiDeprecationDate :: Lens' WorkflowTypeInfo (Maybe UTCTime)
wtiDeprecationDate = lens _wtiDeprecationDate (\ s a -> s{_wtiDeprecationDate = a}) . mapping _Time
| 160
|
wtiDeprecationDate = lens _wtiDeprecationDate (\ s a -> s{_wtiDeprecationDate = a}) . mapping _Time
| 99
| true
| true
| 0
| 10
| 41
| 54
| 29
| 25
| null | null |
jamesdabbs/leeloo
|
app/Main.hs
|
bsd-3-clause
|
main :: IO ()
main = do
conf <- mkConf
args <- getArgs
port <- maybe 3000 read <$> lookupEnv "PORT"
if null args || head args == "api"
then startApi port conf
else startCli conf
| 195
|
main :: IO ()
main = do
conf <- mkConf
args <- getArgs
port <- maybe 3000 read <$> lookupEnv "PORT"
if null args || head args == "api"
then startApi port conf
else startCli conf
| 195
|
main = do
conf <- mkConf
args <- getArgs
port <- maybe 3000 read <$> lookupEnv "PORT"
if null args || head args == "api"
then startApi port conf
else startCli conf
| 181
| false
| true
| 0
| 10
| 53
| 82
| 37
| 45
| null | null |
brownsys/pane
|
src/Set.hs
|
bsd-3-clause
|
isSubsetOf _ All = True
| 23
|
isSubsetOf _ All = True
| 23
|
isSubsetOf _ All = True
| 23
| false
| false
| 1
| 5
| 4
| 13
| 5
| 8
| null | null |
denibertovic/haskell
|
kubernetes/lib/Kubernetes/OpenAPI/Logging.hs
|
bsd-3-clause
|
-- | A Katip Log environment which targets stderr
stderrLoggingContext :: LogContext -> IO LogContext
stderrLoggingContext cxt = do
handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr LG.InfoS LG.V2
LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt
-- * Null logger
-- | Disables Katip logging
| 333
|
stderrLoggingContext :: LogContext -> IO LogContext
stderrLoggingContext cxt = do
handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr LG.InfoS LG.V2
LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt
-- * Null logger
-- | Disables Katip logging
| 283
|
stderrLoggingContext cxt = do
handleScribe <- LG.mkHandleScribe LG.ColorIfTerminal IO.stderr LG.InfoS LG.V2
LG.registerScribe "stderr" handleScribe LG.defaultScribeSettings cxt
-- * Null logger
-- | Disables Katip logging
| 231
| true
| true
| 0
| 9
| 49
| 66
| 32
| 34
| null | null |
AlexBaranosky/QuickCheck
|
Test/QuickCheck/Function.hs
|
bsd-3-clause
|
shrinkFun shr (Table xys) =
[ table xys' | xys' <- shrinkList shrXy xys ]
where
shrXy (x,y) = [(x,y') | y' <- shr y]
table [] = Nil
table xys = Table xys
| 166
|
shrinkFun shr (Table xys) =
[ table xys' | xys' <- shrinkList shrXy xys ]
where
shrXy (x,y) = [(x,y') | y' <- shr y]
table [] = Nil
table xys = Table xys
| 166
|
shrinkFun shr (Table xys) =
[ table xys' | xys' <- shrinkList shrXy xys ]
where
shrXy (x,y) = [(x,y') | y' <- shr y]
table [] = Nil
table xys = Table xys
| 166
| false
| false
| 2
| 8
| 46
| 104
| 47
| 57
| null | null |
ulikoehler/ProjectEuler
|
Euler14.hs
|
apache-2.0
|
main = do
let numbers = [1..1000000]
let collatzLengths = map (length . collatz) numbers
let maximumInput = 1 + findMaximum collatzLengths -- +1: We start with 1
print maximumInput
| 197
|
main = do
let numbers = [1..1000000]
let collatzLengths = map (length . collatz) numbers
let maximumInput = 1 + findMaximum collatzLengths -- +1: We start with 1
print maximumInput
| 197
|
main = do
let numbers = [1..1000000]
let collatzLengths = map (length . collatz) numbers
let maximumInput = 1 + findMaximum collatzLengths -- +1: We start with 1
print maximumInput
| 197
| false
| false
| 1
| 13
| 46
| 68
| 30
| 38
| null | null |
ndmitchell/fossilizer
|
Metadata.hs
|
apache-2.0
|
pink = colorD 0.95 0.34 0.80
| 28
|
pink = colorD 0.95 0.34 0.80
| 28
|
pink = colorD 0.95 0.34 0.80
| 28
| false
| false
| 1
| 5
| 5
| 17
| 6
| 11
| null | null |
urbanslug/ghc
|
compiler/basicTypes/MkId.hs
|
bsd-3-clause
|
coercionTokenName = mkWiredInIdName gHC_PRIM (fsLit "coercionToken#") coercionTokenIdKey coercionTokenId
| 105
|
coercionTokenName = mkWiredInIdName gHC_PRIM (fsLit "coercionToken#") coercionTokenIdKey coercionTokenId
| 105
|
coercionTokenName = mkWiredInIdName gHC_PRIM (fsLit "coercionToken#") coercionTokenIdKey coercionTokenId
| 105
| false
| false
| 0
| 7
| 8
| 21
| 10
| 11
| null | null |
GaloisInc/halvm-ghc
|
compiler/hsSyn/HsPat.hs
|
bsd-3-clause
|
hsPatNeedsParens (ConPatIn _ ds) = conPatNeedsParens ds
| 59
|
hsPatNeedsParens (ConPatIn _ ds) = conPatNeedsParens ds
| 59
|
hsPatNeedsParens (ConPatIn _ ds) = conPatNeedsParens ds
| 59
| false
| false
| 0
| 6
| 10
| 21
| 9
| 12
| null | null |
sru-systems/protobuf-simple
|
src/Parser/MessageDesc.hs
|
mit
|
addEnumDescs :: [Parser.EnumDesc] -> MessageDesc -> MessageDesc
addEnumDescs vs self = self{enumDescs = enumDescs self >< Seq.fromList vs}
| 138
|
addEnumDescs :: [Parser.EnumDesc] -> MessageDesc -> MessageDesc
addEnumDescs vs self = self{enumDescs = enumDescs self >< Seq.fromList vs}
| 138
|
addEnumDescs vs self = self{enumDescs = enumDescs self >< Seq.fromList vs}
| 74
| false
| true
| 0
| 10
| 17
| 59
| 27
| 32
| null | null |
vdweegen/UvA-Software_Testing
|
Lab2/Lecture2.hs
|
gpl-3.0
|
testR :: Int -> Int -> ([Int] -> [Int])
-> ([Int] -> [Int] -> Bool) -> IO ()
testR k n f r = if k == n then print (show n ++ " tests passed")
else do
xs <- genIntList
if r xs (f xs) then
do print ("pass on: " ++ show xs)
testR (k+1) n f r
else error ("failed test on: " ++ show xs)
| 414
|
testR :: Int -> Int -> ([Int] -> [Int])
-> ([Int] -> [Int] -> Bool) -> IO ()
testR k n f r = if k == n then print (show n ++ " tests passed")
else do
xs <- genIntList
if r xs (f xs) then
do print ("pass on: " ++ show xs)
testR (k+1) n f r
else error ("failed test on: " ++ show xs)
| 414
|
testR k n f r = if k == n then print (show n ++ " tests passed")
else do
xs <- genIntList
if r xs (f xs) then
do print ("pass on: " ++ show xs)
testR (k+1) n f r
else error ("failed test on: " ++ show xs)
| 317
| false
| true
| 0
| 14
| 201
| 173
| 87
| 86
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.