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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
brendanhay/gogol
|
gogol-sqladmin/gen/Network/Google/Resource/SQL/Instances/TruncateLog.hs
|
mpl-2.0
|
-- | V1 error format.
itlXgafv :: Lens' InstancesTruncateLog (Maybe Xgafv)
itlXgafv = lens _itlXgafv (\ s a -> s{_itlXgafv = a})
| 128
|
itlXgafv :: Lens' InstancesTruncateLog (Maybe Xgafv)
itlXgafv = lens _itlXgafv (\ s a -> s{_itlXgafv = a})
| 106
|
itlXgafv = lens _itlXgafv (\ s a -> s{_itlXgafv = a})
| 53
| true
| true
| 0
| 9
| 21
| 46
| 25
| 21
| null | null |
Pnom/haskell-ast-pretty
|
Test/examples/Unicode.hs
|
mit
|
testRewrite :: a → Bool
testRewrite x = pi
where
f = replicate 2000 x
i = repeat x
lf = length f
li = length i
pf = lf > 300
pi = li > 300
| 174
|
testRewrite :: a → Bool
testRewrite x = pi
where
f = replicate 2000 x
i = repeat x
lf = length f
li = length i
pf = lf > 300
pi = li > 300
| 174
|
testRewrite x = pi
where
f = replicate 2000 x
i = repeat x
lf = length f
li = length i
pf = lf > 300
pi = li > 300
| 150
| false
| true
| 5
| 7
| 72
| 76
| 37
| 39
| null | null |
beni55/text
|
Data/Text/Encoding.hs
|
bsd-2-clause
|
-- | Encode text using big endian UTF-32 encoding.
encodeUtf32BE :: Text -> ByteString
encodeUtf32BE txt = E.unstream (E.restreamUtf32BE (F.stream txt))
| 152
|
encodeUtf32BE :: Text -> ByteString
encodeUtf32BE txt = E.unstream (E.restreamUtf32BE (F.stream txt))
| 101
|
encodeUtf32BE txt = E.unstream (E.restreamUtf32BE (F.stream txt))
| 65
| true
| true
| 0
| 10
| 20
| 40
| 20
| 20
| null | null |
uduki/hsQt
|
Qtc/Enums/Gui/QSizePolicy.hs
|
bsd-2-clause
|
eFrame :: ControlType
eFrame
= ieControlType $ 16
| 51
|
eFrame :: ControlType
eFrame
= ieControlType $ 16
| 51
|
eFrame
= ieControlType $ 16
| 29
| false
| true
| 0
| 6
| 9
| 18
| 8
| 10
| null | null |
leshchevds/ganeti
|
src/Ganeti/Constants.hs
|
bsd-2-clause
|
-- * CPU load collector
statFile :: String
statFile = "/proc/stat"
| 68
|
statFile :: String
statFile = "/proc/stat"
| 42
|
statFile = "/proc/stat"
| 23
| true
| true
| 0
| 4
| 12
| 12
| 7
| 5
| null | null |
osa1/toylisp
|
src/Prim.hs
|
bsd-3-clause
|
stringp :: PrimFunc
stringp [String _] = return $ Bool True
| 59
|
stringp :: PrimFunc
stringp [String _] = return $ Bool True
| 59
|
stringp [String _] = return $ Bool True
| 39
| false
| true
| 1
| 6
| 10
| 31
| 13
| 18
| null | null |
ysnrkdm/Hamlet
|
src/EdaxProtocol.hs
|
mit
|
commandLoop mode bd = do
sfens <- getLine
let cmds = words sfens
case head cmds of
"init" -> putStrLn "" >> commandLoop mode BitBoard.initialBoard
"quit" -> exitWith $ ExitFailure 1
"undo" -> putStrLn "undo (Not yet implemented)"
"redo" -> putStrLn "redo (Not yet implemented)"
"verbose" ->
case cmds !! 1 of
"1" -> putStrLn (show bd) >> putStrLn "\n\n\n"
"0" -> putStr ""
"p" -> putStrLn $ show Eval.showFv
"eval" -> printf "Eval: %d" (Eval.eval bd)
_ -> putStr ""
"go" -> case mode of
(Search searchingmethod) -> do
let (Search.Result _ pv) = case searchingmethod of
AlphaBeta -> Search.alphabeta 7 bd
AlphaBetaWPNS -> Search.alphabetaWEndSolver 7 bd
case
-- SlackMessenger.unsafeSendMessageNow (printf "%s" (show res))
head pv of
Move.Nil -> do
putStrLn "\n\n>Hamlet plays PS"
commandLoop mode $ BitBoard.move bd (head pv)
_ -> do
putStrLn $ "\n\n>Hamlet plays " ++ show (head pv)
commandLoop mode $ BitBoard.move bd (head pv)
(Learn _) -> putStrLn "Not yet supported"
"setboard" -> commandLoop mode $ BitBoard.fromString ((cmds !! 1) ++ " " ++ (cmds !! 2))
"util" -> case cmds !! 1 of
"bit" -> putStrLn (BitBoard.showBitBoard (read (cmds !! 2) :: BitBoard.BitBoard))
"fv" -> putStrLn (show $ Eval.fv (read $ cmds !! 2 :: Int))
"setmode" -> commandLoop (case cmds !! 2 of
"ab" -> Search AlphaBeta
"abwpns" -> Search AlphaBetaWPNS
_ -> Search AlphaBeta) bd
_ -> putStr ""
_ | isMove $ head cmds -> do
putStrLn $ "\n\nYou play " ++ head cmds
commandLoop mode $ BitBoard.moveByPos bd (Util.posFromUSI (head cmds))
| isPass $ head cmds -> do
putStrLn "\n\nYou play PS"
commandLoop mode $ BitBoard.move bd Move.Nil
| otherwise -> putStrLn ("undefined command.." ++ sfens)
commandLoop mode bd -- next
| 2,439
|
commandLoop mode bd = do
sfens <- getLine
let cmds = words sfens
case head cmds of
"init" -> putStrLn "" >> commandLoop mode BitBoard.initialBoard
"quit" -> exitWith $ ExitFailure 1
"undo" -> putStrLn "undo (Not yet implemented)"
"redo" -> putStrLn "redo (Not yet implemented)"
"verbose" ->
case cmds !! 1 of
"1" -> putStrLn (show bd) >> putStrLn "\n\n\n"
"0" -> putStr ""
"p" -> putStrLn $ show Eval.showFv
"eval" -> printf "Eval: %d" (Eval.eval bd)
_ -> putStr ""
"go" -> case mode of
(Search searchingmethod) -> do
let (Search.Result _ pv) = case searchingmethod of
AlphaBeta -> Search.alphabeta 7 bd
AlphaBetaWPNS -> Search.alphabetaWEndSolver 7 bd
case
-- SlackMessenger.unsafeSendMessageNow (printf "%s" (show res))
head pv of
Move.Nil -> do
putStrLn "\n\n>Hamlet plays PS"
commandLoop mode $ BitBoard.move bd (head pv)
_ -> do
putStrLn $ "\n\n>Hamlet plays " ++ show (head pv)
commandLoop mode $ BitBoard.move bd (head pv)
(Learn _) -> putStrLn "Not yet supported"
"setboard" -> commandLoop mode $ BitBoard.fromString ((cmds !! 1) ++ " " ++ (cmds !! 2))
"util" -> case cmds !! 1 of
"bit" -> putStrLn (BitBoard.showBitBoard (read (cmds !! 2) :: BitBoard.BitBoard))
"fv" -> putStrLn (show $ Eval.fv (read $ cmds !! 2 :: Int))
"setmode" -> commandLoop (case cmds !! 2 of
"ab" -> Search AlphaBeta
"abwpns" -> Search AlphaBetaWPNS
_ -> Search AlphaBeta) bd
_ -> putStr ""
_ | isMove $ head cmds -> do
putStrLn $ "\n\nYou play " ++ head cmds
commandLoop mode $ BitBoard.moveByPos bd (Util.posFromUSI (head cmds))
| isPass $ head cmds -> do
putStrLn "\n\nYou play PS"
commandLoop mode $ BitBoard.move bd Move.Nil
| otherwise -> putStrLn ("undefined command.." ++ sfens)
commandLoop mode bd -- next
| 2,439
|
commandLoop mode bd = do
sfens <- getLine
let cmds = words sfens
case head cmds of
"init" -> putStrLn "" >> commandLoop mode BitBoard.initialBoard
"quit" -> exitWith $ ExitFailure 1
"undo" -> putStrLn "undo (Not yet implemented)"
"redo" -> putStrLn "redo (Not yet implemented)"
"verbose" ->
case cmds !! 1 of
"1" -> putStrLn (show bd) >> putStrLn "\n\n\n"
"0" -> putStr ""
"p" -> putStrLn $ show Eval.showFv
"eval" -> printf "Eval: %d" (Eval.eval bd)
_ -> putStr ""
"go" -> case mode of
(Search searchingmethod) -> do
let (Search.Result _ pv) = case searchingmethod of
AlphaBeta -> Search.alphabeta 7 bd
AlphaBetaWPNS -> Search.alphabetaWEndSolver 7 bd
case
-- SlackMessenger.unsafeSendMessageNow (printf "%s" (show res))
head pv of
Move.Nil -> do
putStrLn "\n\n>Hamlet plays PS"
commandLoop mode $ BitBoard.move bd (head pv)
_ -> do
putStrLn $ "\n\n>Hamlet plays " ++ show (head pv)
commandLoop mode $ BitBoard.move bd (head pv)
(Learn _) -> putStrLn "Not yet supported"
"setboard" -> commandLoop mode $ BitBoard.fromString ((cmds !! 1) ++ " " ++ (cmds !! 2))
"util" -> case cmds !! 1 of
"bit" -> putStrLn (BitBoard.showBitBoard (read (cmds !! 2) :: BitBoard.BitBoard))
"fv" -> putStrLn (show $ Eval.fv (read $ cmds !! 2 :: Int))
"setmode" -> commandLoop (case cmds !! 2 of
"ab" -> Search AlphaBeta
"abwpns" -> Search AlphaBetaWPNS
_ -> Search AlphaBeta) bd
_ -> putStr ""
_ | isMove $ head cmds -> do
putStrLn $ "\n\nYou play " ++ head cmds
commandLoop mode $ BitBoard.moveByPos bd (Util.posFromUSI (head cmds))
| isPass $ head cmds -> do
putStrLn "\n\nYou play PS"
commandLoop mode $ BitBoard.move bd Move.Nil
| otherwise -> putStrLn ("undefined command.." ++ sfens)
commandLoop mode bd -- next
| 2,439
| false
| false
| 0
| 27
| 1,024
| 682
| 315
| 367
| null | null |
robdockins/edison
|
edison-core/src/Data/Edison/Coll/UnbalancedSet.hs
|
mit
|
unsafeInsertMin x t = T E x t
| 29
|
unsafeInsertMin x t = T E x t
| 29
|
unsafeInsertMin x t = T E x t
| 29
| false
| false
| 0
| 5
| 7
| 18
| 8
| 10
| null | null |
christiaanb/ghc
|
compiler/nativeGen/X86/CodeGen.hs
|
bsd-3-clause
|
assignMem_FltCode pk addr src = do
(src_reg, src_code) <- getNonClobberedReg src
Amode addr addr_code <- getAmode addr
use_sse2 <- sse2Enabled
let
code = src_code `appOL`
addr_code `snocOL`
if use_sse2 then MOV pk (OpReg src_reg) (OpAddr addr)
else GST pk src_reg addr
return code
-- Floating point assignment to a register/temporary
| 411
|
assignMem_FltCode pk addr src = do
(src_reg, src_code) <- getNonClobberedReg src
Amode addr addr_code <- getAmode addr
use_sse2 <- sse2Enabled
let
code = src_code `appOL`
addr_code `snocOL`
if use_sse2 then MOV pk (OpReg src_reg) (OpAddr addr)
else GST pk src_reg addr
return code
-- Floating point assignment to a register/temporary
| 411
|
assignMem_FltCode pk addr src = do
(src_reg, src_code) <- getNonClobberedReg src
Amode addr addr_code <- getAmode addr
use_sse2 <- sse2Enabled
let
code = src_code `appOL`
addr_code `snocOL`
if use_sse2 then MOV pk (OpReg src_reg) (OpAddr addr)
else GST pk src_reg addr
return code
-- Floating point assignment to a register/temporary
| 411
| false
| false
| 1
| 15
| 127
| 119
| 55
| 64
| null | null |
ford-prefect/haskell-gi
|
lib/Data/GI/CodeGen/GtkDoc.hs
|
lgpl-2.1
|
restoreListPreNewline (l@(List _) : rest) =
Literal "\n" : l : restoreListPreNewline rest
| 91
|
restoreListPreNewline (l@(List _) : rest) =
Literal "\n" : l : restoreListPreNewline rest
| 91
|
restoreListPreNewline (l@(List _) : rest) =
Literal "\n" : l : restoreListPreNewline rest
| 91
| false
| false
| 0
| 10
| 14
| 39
| 19
| 20
| null | null |
pittsburgh-haskell/haskell-intro-session
|
answersrc/Tutorial.hs
|
bsd-3-clause
|
sweetUserResponded Ignore = False
| 35
|
sweetUserResponded Ignore = False
| 35
|
sweetUserResponded Ignore = False
| 35
| false
| false
| 0
| 4
| 5
| 10
| 4
| 6
| null | null |
turion/haskell-asteroids
|
src/Generator.hs
|
mit
|
generateAsteroidShape :: StdGen -> (Shape, StdGen)
generateAsteroidShape g = (Shape [p1, p2, p3, p4, p5, p6, p7, p8], gLast)
where
a = 0.013
b = 0.01
(r1, g1) = randomR (2*a, 3*a) g
(r2, g2) = randomR (2*b, 3*b) g1
(r3, g3) = randomR (2*a, 3*a) g2
(r4, g4) = randomR (2*b, 3*b) g3
(r5, g5) = randomR (2*a, 3*a) g4
(r6, g6) = randomR (2*b, 3*b) g5
(r7, g7) = randomR (2*a, 3*a) g6
(r8, gLast) = randomR (2*b, 3*b) g7
p1 = Vector 0 r1
p2 = Vector r2 r2
p3 = Vector r3 0
p4 = Vector r4 (-r4)
p5 = Vector 0 (-r5)
p6 = Vector (-r6) (-r6)
p7 = Vector (-r7) 0
p8 = Vector (-r8) r8
| 647
|
generateAsteroidShape :: StdGen -> (Shape, StdGen)
generateAsteroidShape g = (Shape [p1, p2, p3, p4, p5, p6, p7, p8], gLast)
where
a = 0.013
b = 0.01
(r1, g1) = randomR (2*a, 3*a) g
(r2, g2) = randomR (2*b, 3*b) g1
(r3, g3) = randomR (2*a, 3*a) g2
(r4, g4) = randomR (2*b, 3*b) g3
(r5, g5) = randomR (2*a, 3*a) g4
(r6, g6) = randomR (2*b, 3*b) g5
(r7, g7) = randomR (2*a, 3*a) g6
(r8, gLast) = randomR (2*b, 3*b) g7
p1 = Vector 0 r1
p2 = Vector r2 r2
p3 = Vector r3 0
p4 = Vector r4 (-r4)
p5 = Vector 0 (-r5)
p6 = Vector (-r6) (-r6)
p7 = Vector (-r7) 0
p8 = Vector (-r8) r8
| 647
|
generateAsteroidShape g = (Shape [p1, p2, p3, p4, p5, p6, p7, p8], gLast)
where
a = 0.013
b = 0.01
(r1, g1) = randomR (2*a, 3*a) g
(r2, g2) = randomR (2*b, 3*b) g1
(r3, g3) = randomR (2*a, 3*a) g2
(r4, g4) = randomR (2*b, 3*b) g3
(r5, g5) = randomR (2*a, 3*a) g4
(r6, g6) = randomR (2*b, 3*b) g5
(r7, g7) = randomR (2*a, 3*a) g6
(r8, gLast) = randomR (2*b, 3*b) g7
p1 = Vector 0 r1
p2 = Vector r2 r2
p3 = Vector r3 0
p4 = Vector r4 (-r4)
p5 = Vector 0 (-r5)
p6 = Vector (-r6) (-r6)
p7 = Vector (-r7) 0
p8 = Vector (-r8) r8
| 596
| false
| true
| 17
| 7
| 195
| 422
| 235
| 187
| null | null |
ggreif/clash-compiler
|
clash-lib/src/CLaSH/Core/Pretty.hs
|
bsd-2-clause
|
dcolon :: Doc
dcolon = text "::"
| 32
|
dcolon :: Doc
dcolon = text "::"
| 32
|
dcolon = text "::"
| 18
| false
| true
| 0
| 6
| 6
| 21
| 8
| 13
| null | null |
silkapp/haskell-opaleye
|
src/Opaleye/Join.hs
|
bsd-3-clause
|
fullJoinExplicit :: U.Unpackspec columnsA columnsA
-> U.Unpackspec columnsB columnsB
-> J.NullMaker columnsA nullableColumnsA
-> J.NullMaker columnsB nullableColumnsB
-> Query columnsA -> Query columnsB
-> ((columnsA, columnsB) -> Column T.PGBool)
-> Query (nullableColumnsA, nullableColumnsB)
fullJoinExplicit unpackA unpackB nullmakerA nullmakerB qA qB cond = Q.simpleQueryArr q where
q ((), startTag) = ((nullableColumnsA, nullableColumnsB), primQueryR, T.next endTag)
where (columnsA, primQueryA, midTag) = Q.runSimpleQueryArr qA ((), startTag)
(columnsB, primQueryB, endTag) = Q.runSimpleQueryArr qB ((), midTag)
(newColumnsA, ljPEsA) =
PM.run (U.runUnpackspec unpackA (J.extractLeftJoinFields 1 endTag) columnsA)
(newColumnsB, ljPEsB) =
PM.run (U.runUnpackspec unpackB (J.extractLeftJoinFields 2 endTag) columnsB)
nullableColumnsA = J.toNullable nullmakerA newColumnsA
nullableColumnsB = J.toNullable nullmakerB newColumnsB
Column cond' = cond (columnsA, columnsB)
primQueryR = PQ.Join PQ.FullJoin (ljPEsA ++ ljPEsB) cond' primQueryA primQueryB
| 1,255
|
fullJoinExplicit :: U.Unpackspec columnsA columnsA
-> U.Unpackspec columnsB columnsB
-> J.NullMaker columnsA nullableColumnsA
-> J.NullMaker columnsB nullableColumnsB
-> Query columnsA -> Query columnsB
-> ((columnsA, columnsB) -> Column T.PGBool)
-> Query (nullableColumnsA, nullableColumnsB)
fullJoinExplicit unpackA unpackB nullmakerA nullmakerB qA qB cond = Q.simpleQueryArr q where
q ((), startTag) = ((nullableColumnsA, nullableColumnsB), primQueryR, T.next endTag)
where (columnsA, primQueryA, midTag) = Q.runSimpleQueryArr qA ((), startTag)
(columnsB, primQueryB, endTag) = Q.runSimpleQueryArr qB ((), midTag)
(newColumnsA, ljPEsA) =
PM.run (U.runUnpackspec unpackA (J.extractLeftJoinFields 1 endTag) columnsA)
(newColumnsB, ljPEsB) =
PM.run (U.runUnpackspec unpackB (J.extractLeftJoinFields 2 endTag) columnsB)
nullableColumnsA = J.toNullable nullmakerA newColumnsA
nullableColumnsB = J.toNullable nullmakerB newColumnsB
Column cond' = cond (columnsA, columnsB)
primQueryR = PQ.Join PQ.FullJoin (ljPEsA ++ ljPEsB) cond' primQueryA primQueryB
| 1,255
|
fullJoinExplicit unpackA unpackB nullmakerA nullmakerB qA qB cond = Q.simpleQueryArr q where
q ((), startTag) = ((nullableColumnsA, nullableColumnsB), primQueryR, T.next endTag)
where (columnsA, primQueryA, midTag) = Q.runSimpleQueryArr qA ((), startTag)
(columnsB, primQueryB, endTag) = Q.runSimpleQueryArr qB ((), midTag)
(newColumnsA, ljPEsA) =
PM.run (U.runUnpackspec unpackA (J.extractLeftJoinFields 1 endTag) columnsA)
(newColumnsB, ljPEsB) =
PM.run (U.runUnpackspec unpackB (J.extractLeftJoinFields 2 endTag) columnsB)
nullableColumnsA = J.toNullable nullmakerA newColumnsA
nullableColumnsB = J.toNullable nullmakerB newColumnsB
Column cond' = cond (columnsA, columnsB)
primQueryR = PQ.Join PQ.FullJoin (ljPEsA ++ ljPEsB) cond' primQueryA primQueryB
| 859
| false
| true
| 0
| 16
| 321
| 371
| 191
| 180
| null | null |
kisp/ksquant2
|
Lisp.hs
|
gpl-3.0
|
clNull :: LispVal -> Bool
clNull (LispSymbol "NIL") = True
| 58
|
clNull :: LispVal -> Bool
clNull (LispSymbol "NIL") = True
| 58
|
clNull (LispSymbol "NIL") = True
| 32
| false
| true
| 0
| 9
| 9
| 30
| 13
| 17
| null | null |
alexander-at-github/eta
|
compiler/ETA/Prelude/PrimOp.hs
|
bsd-3-clause
|
primOpHasSideEffects WriteJShortArrayOp = True
| 48
|
primOpHasSideEffects WriteJShortArrayOp = True
| 48
|
primOpHasSideEffects WriteJShortArrayOp = True
| 48
| false
| false
| 0
| 5
| 5
| 9
| 4
| 5
| null | null |
fmi-lab/fp-elective-2017
|
exams/preparation/growingTrees.hs
|
mit
|
grow :: Tree a -> a -> Tree a
grow Empty x = (Node x Empty Empty)
| 65
|
grow :: Tree a -> a -> Tree a
grow Empty x = (Node x Empty Empty)
| 65
|
grow Empty x = (Node x Empty Empty)
| 35
| false
| true
| 0
| 8
| 16
| 45
| 20
| 25
| null | null |
sdiehl/ghc
|
compiler/main/HscTypes.hs
|
bsd-3-clause
|
setSafeMode :: SafeHaskellMode -> IfaceTrustInfo
setSafeMode = TrustInfo
| 72
|
setSafeMode :: SafeHaskellMode -> IfaceTrustInfo
setSafeMode = TrustInfo
| 72
|
setSafeMode = TrustInfo
| 23
| false
| true
| 0
| 7
| 7
| 22
| 9
| 13
| null | null |
hpacheco/HAAP
|
examples/xterm/Haskassonne.hs
|
mit
|
toScores :: [Element] -> [Score]
toScores l = map snd $ sortBy (comparing fst) $ map toScore l
where toScore :: Element -> (Int,Int)
toScore e = (read $ fromJust $ findAttr (qname "player") e, read $ fromJust $ findAttr (qname "score") e)
| 253
|
toScores :: [Element] -> [Score]
toScores l = map snd $ sortBy (comparing fst) $ map toScore l
where toScore :: Element -> (Int,Int)
toScore e = (read $ fromJust $ findAttr (qname "player") e, read $ fromJust $ findAttr (qname "score") e)
| 253
|
toScores l = map snd $ sortBy (comparing fst) $ map toScore l
where toScore :: Element -> (Int,Int)
toScore e = (read $ fromJust $ findAttr (qname "player") e, read $ fromJust $ findAttr (qname "score") e)
| 220
| false
| true
| 0
| 10
| 57
| 125
| 61
| 64
| null | null |
unisonweb/platform
|
unison-core/src/Unison/Util/Relation.hs
|
mit
|
-- | The 'Relation' that results from the union of two relations: @r@ and @s@.
union :: (Ord a, Ord b) => Relation a b -> Relation a b -> Relation a b
union r s = Relation
{ domain = M.unionWith S.union (domain r) (domain s)
, range = M.unionWith S.union (range r) (range s)
}
| 283
|
union :: (Ord a, Ord b) => Relation a b -> Relation a b -> Relation a b
union r s = Relation
{ domain = M.unionWith S.union (domain r) (domain s)
, range = M.unionWith S.union (range r) (range s)
}
| 204
|
union r s = Relation
{ domain = M.unionWith S.union (domain r) (domain s)
, range = M.unionWith S.union (range r) (range s)
}
| 132
| true
| true
| 0
| 10
| 63
| 119
| 59
| 60
| null | null |
ksaveljev/hake-2
|
src/Game/GameFunc.hs
|
bsd-3-clause
|
doorSecretMove3 :: EntThink
doorSecretMove3 =
GenericEntThink "door_secret_move3" $ \selfRef -> do
self <- readRef selfRef
if (self^.eWait) == -1
then
return True
else do
levelTime <- use $ gameBaseGlobals.gbLevel.llTime
modifyRef selfRef (\v -> v & eNextThink .~ levelTime + (self^.eWait)
& eThink .~ Just doorSecretMove4)
return True
| 428
|
doorSecretMove3 :: EntThink
doorSecretMove3 =
GenericEntThink "door_secret_move3" $ \selfRef -> do
self <- readRef selfRef
if (self^.eWait) == -1
then
return True
else do
levelTime <- use $ gameBaseGlobals.gbLevel.llTime
modifyRef selfRef (\v -> v & eNextThink .~ levelTime + (self^.eWait)
& eThink .~ Just doorSecretMove4)
return True
| 428
|
doorSecretMove3 =
GenericEntThink "door_secret_move3" $ \selfRef -> do
self <- readRef selfRef
if (self^.eWait) == -1
then
return True
else do
levelTime <- use $ gameBaseGlobals.gbLevel.llTime
modifyRef selfRef (\v -> v & eNextThink .~ levelTime + (self^.eWait)
& eThink .~ Just doorSecretMove4)
return True
| 400
| false
| true
| 0
| 19
| 139
| 127
| 62
| 65
| null | null |
gspia/reflex-dom-htmlea
|
lib/src/Reflex/Dom/HTML5/Elements/Elements.hs
|
bsd-3-clause
|
-- | A short-hand notion for @ el \"em\" ... @
emN ∷ forall t m a. DomBuilder t m ⇒ m a → m a
emN children = snd <$> emN' children
| 130
|
emN ∷ forall t m a. DomBuilder t m ⇒ m a → m a
emN children = snd <$> emN' children
| 83
|
emN children = snd <$> emN' children
| 36
| true
| true
| 0
| 9
| 32
| 52
| 25
| 27
| null | null |
svenssonjoel/ObsidianGFX
|
Obsidian/Mutable.hs
|
bsd-3-clause
|
writeTo :: Storable a
=> Mutable Shared Word32 a
-> Push Block Word32 a
-> Program Block ()
writeTo (Mutable n snames) p
| n <= m = p <: assignArray snames
| otherwise = error "WriteTo: Incompatible sizes"
where
m = len p
-- Add forceTo with offsets (why? just thought it might be useful)
| 343
|
writeTo :: Storable a
=> Mutable Shared Word32 a
-> Push Block Word32 a
-> Program Block ()
writeTo (Mutable n snames) p
| n <= m = p <: assignArray snames
| otherwise = error "WriteTo: Incompatible sizes"
where
m = len p
-- Add forceTo with offsets (why? just thought it might be useful)
| 343
|
writeTo (Mutable n snames) p
| n <= m = p <: assignArray snames
| otherwise = error "WriteTo: Incompatible sizes"
where
m = len p
-- Add forceTo with offsets (why? just thought it might be useful)
| 218
| false
| true
| 1
| 9
| 110
| 99
| 46
| 53
| null | null |
haskell-web-intro/secdev
|
examples/common/src/MySafeStore.hs
|
mit
|
initDB :: IO DataStore
initDB = do
conn <- open ":memory:"
exec conn "CREATE TABLE IF NOT EXISTS person (id INTEGER PRIMARY KEY, name TEXT)"
exec conn "INSERT INTO person (name) VALUES ('Tim')"
exec conn "INSERT INTO person (name) VALUES ('Mark')"
exec conn "INSERT INTO person (name) VALUES ('Sarah')"
return $ DataStore conn
| 338
|
initDB :: IO DataStore
initDB = do
conn <- open ":memory:"
exec conn "CREATE TABLE IF NOT EXISTS person (id INTEGER PRIMARY KEY, name TEXT)"
exec conn "INSERT INTO person (name) VALUES ('Tim')"
exec conn "INSERT INTO person (name) VALUES ('Mark')"
exec conn "INSERT INTO person (name) VALUES ('Sarah')"
return $ DataStore conn
| 338
|
initDB = do
conn <- open ":memory:"
exec conn "CREATE TABLE IF NOT EXISTS person (id INTEGER PRIMARY KEY, name TEXT)"
exec conn "INSERT INTO person (name) VALUES ('Tim')"
exec conn "INSERT INTO person (name) VALUES ('Mark')"
exec conn "INSERT INTO person (name) VALUES ('Sarah')"
return $ DataStore conn
| 315
| false
| true
| 0
| 8
| 64
| 66
| 27
| 39
| null | null |
phadej/psqueues
|
src/Data/OrdPSQ/Internal.hs
|
bsd-3-clause
|
tourView (Winner e Start _) = Single e
| 38
|
tourView (Winner e Start _) = Single e
| 38
|
tourView (Winner e Start _) = Single e
| 38
| false
| false
| 0
| 7
| 7
| 22
| 10
| 12
| null | null |
tolysz/yesod
|
yesod-core/test/RouteSpec.hs
|
mit
|
getRootR :: Text
getRootR = pack "this is the root"
| 51
|
getRootR :: Text
getRootR = pack "this is the root"
| 51
|
getRootR = pack "this is the root"
| 34
| false
| true
| 0
| 5
| 9
| 14
| 7
| 7
| null | null |
jeremyong/Yaiba
|
Yaiba/Polynomial.hs
|
bsd-3-clause
|
fromList :: (Ord (Mon ord)) => [(Mon ord, Field)] -> Poly ord
fromList a = prune $ P $ YM.fromList a
| 100
|
fromList :: (Ord (Mon ord)) => [(Mon ord, Field)] -> Poly ord
fromList a = prune $ P $ YM.fromList a
| 100
|
fromList a = prune $ P $ YM.fromList a
| 38
| false
| true
| 0
| 9
| 20
| 61
| 31
| 30
| null | null |
ezyang/ghc
|
hadrian/src/Rules/Libffi.hs
|
bsd-3-clause
|
-- | Build directory for in-tree Libffi library.
libffiBuildPath :: Action FilePath
libffiBuildPath = buildPath libffiContext
| 125
|
libffiBuildPath :: Action FilePath
libffiBuildPath = buildPath libffiContext
| 76
|
libffiBuildPath = buildPath libffiContext
| 41
| true
| true
| 0
| 5
| 15
| 18
| 9
| 9
| null | null |
keithodulaigh/Hets
|
GMP/GMP-CoLoSS/GMP/Logics/P.hs
|
gpl-2.0
|
pml_geq :: ([Int], [Int], Int) -> ([Int], [Int], Int) -> Bool
pml_geq (p1, n1, k1) (p2, n2, k2) = k1 == k2 &&
all (uncurry (>=)) (zip p1 p2 ++ zip n1 n2)
| 189
|
pml_geq :: ([Int], [Int], Int) -> ([Int], [Int], Int) -> Bool
pml_geq (p1, n1, k1) (p2, n2, k2) = k1 == k2 &&
all (uncurry (>=)) (zip p1 p2 ++ zip n1 n2)
| 189
|
pml_geq (p1, n1, k1) (p2, n2, k2) = k1 == k2 &&
all (uncurry (>=)) (zip p1 p2 ++ zip n1 n2)
| 127
| false
| true
| 0
| 9
| 68
| 110
| 63
| 47
| null | null |
michalkonecny/aern
|
aern-ivp/demos/demoPicardView.hs
|
bsd-3-clause
|
-- ++ " [" ++ show p ++ "]"
c1,c0,x,c01,c10,cHalf,cHalf1,cOneOver16,cSevenOver16,cOneMinusOneOver16, samplePoly :: Poly
x = newProjection cfg dombox "x"
| 153
|
c1,c0,x,c01,c10,cHalf,cHalf1,cOneOver16,cSevenOver16,cOneMinusOneOver16, samplePoly :: Poly
x = newProjection cfg dombox "x"
| 124
|
x = newProjection cfg dombox "x"
| 32
| true
| true
| 3
| 5
| 19
| 46
| 30
| 16
| null | null |
spechub/Hets
|
Logic/Prover.hs
|
gpl-2.0
|
-- | determine if a prover kind is implemented
hasProverKind :: ProverKind -> ProverTemplate x s m y z -> Bool
hasProverKind pk pt = case pk of
ProveGUI -> isJust $ proveGUI pt
ProveCMDLautomatic -> isJust $ proveCMDLautomaticBatch pt
| 242
|
hasProverKind :: ProverKind -> ProverTemplate x s m y z -> Bool
hasProverKind pk pt = case pk of
ProveGUI -> isJust $ proveGUI pt
ProveCMDLautomatic -> isJust $ proveCMDLautomaticBatch pt
| 195
|
hasProverKind pk pt = case pk of
ProveGUI -> isJust $ proveGUI pt
ProveCMDLautomatic -> isJust $ proveCMDLautomaticBatch pt
| 131
| true
| true
| 0
| 9
| 47
| 66
| 32
| 34
| null | null |
ice1000/OI-codes
|
codewars/301-400/checking-groups.hs
|
agpl-3.0
|
validBraces :: String -> Bool
-- validBraces xs = count (==')') xs == count (=='(') xs && count (=='[') xs == count (==']') xs && count (=='{') xs == count (=='}') xs
validBraces [] = True
| 188
|
validBraces :: String -> Bool
validBraces [] = True
| 51
|
validBraces [] = True
| 21
| true
| true
| 0
| 8
| 35
| 27
| 12
| 15
| null | null |
alios/gisserver
|
GisServer/Data/Common.hs
|
bsd-3-clause
|
fieldTerm :: Word8
fieldTerm = fromIntegral $ ord fieldTermChar
| 63
|
fieldTerm :: Word8
fieldTerm = fromIntegral $ ord fieldTermChar
| 63
|
fieldTerm = fromIntegral $ ord fieldTermChar
| 44
| false
| true
| 0
| 6
| 8
| 18
| 9
| 9
| null | null |
GaloisInc/halvm-ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
{-
************************************************************************
* *
\subsection{Module names}
* *
************************************************************************
--MetaHaskell Extension Add a new module here
-}
pRELUDE :: Module
pRELUDE = mkBaseModule_ pRELUDE_NAME
| 435
|
pRELUDE :: Module
pRELUDE = mkBaseModule_ pRELUDE_NAME
| 62
|
pRELUDE = mkBaseModule_ pRELUDE_NAME
| 44
| true
| true
| 0
| 6
| 172
| 21
| 9
| 12
| null | null |
jbapple/three-finger-trees
|
bbb-trees/BBBPlus.hs
|
agpl-3.0
|
sizeOf (More s _) = s
| 21
|
sizeOf (More s _) = s
| 21
|
sizeOf (More s _) = s
| 21
| false
| false
| 0
| 6
| 5
| 18
| 8
| 10
| null | null |
AlexeyRaga/eta
|
compiler/ETA/TypeCheck/TcGenDeriv.hs
|
bsd-3-clause
|
mkCompareFields :: TyCon -> OrdOp -> [Type] -> LHsExpr RdrName
-- Generates nested comparisons for (a1,a2...) against (b1,b2,...)
-- where the ai,bi have the given types
mkCompareFields tycon op tys
= go tys as_RDRs bs_RDRs
where
go [] _ _ = eqResult op
go [ty] (a:_) (b:_)
| isUnLiftedType ty = unliftedOrdOp tycon ty op a b
| otherwise = genOpApp (nlHsVar a) (ordMethRdr op) (nlHsVar b)
go (ty:tys) (a:as) (b:bs) = mk_compare ty a b
(ltResult op)
(go tys as bs)
(gtResult op)
go _ _ _ = panic "mkCompareFields"
-- (mk_compare ty a b) generates
-- (case (compare a b) of { LT -> <lt>; EQ -> <eq>; GT -> <bt> })
-- but with suitable special cases for
mk_compare ty a b lt eq gt
| isUnLiftedType ty
= unliftedCompare lt_op eq_op a_expr b_expr lt eq gt
| otherwise
= nlHsCase (nlHsPar (nlHsApp (nlHsApp (nlHsVar compare_RDR) a_expr) b_expr))
[mkSimpleHsAlt (nlNullaryConPat ltTag_RDR) lt,
mkSimpleHsAlt (nlNullaryConPat eqTag_RDR) eq,
mkSimpleHsAlt (nlNullaryConPat gtTag_RDR) gt]
where
a_expr = nlHsVar a
b_expr = nlHsVar b
(lt_op, _, eq_op, _, _) = primOrdOps "Ord" tycon ty
| 1,347
|
mkCompareFields :: TyCon -> OrdOp -> [Type] -> LHsExpr RdrName
mkCompareFields tycon op tys
= go tys as_RDRs bs_RDRs
where
go [] _ _ = eqResult op
go [ty] (a:_) (b:_)
| isUnLiftedType ty = unliftedOrdOp tycon ty op a b
| otherwise = genOpApp (nlHsVar a) (ordMethRdr op) (nlHsVar b)
go (ty:tys) (a:as) (b:bs) = mk_compare ty a b
(ltResult op)
(go tys as bs)
(gtResult op)
go _ _ _ = panic "mkCompareFields"
-- (mk_compare ty a b) generates
-- (case (compare a b) of { LT -> <lt>; EQ -> <eq>; GT -> <bt> })
-- but with suitable special cases for
mk_compare ty a b lt eq gt
| isUnLiftedType ty
= unliftedCompare lt_op eq_op a_expr b_expr lt eq gt
| otherwise
= nlHsCase (nlHsPar (nlHsApp (nlHsApp (nlHsVar compare_RDR) a_expr) b_expr))
[mkSimpleHsAlt (nlNullaryConPat ltTag_RDR) lt,
mkSimpleHsAlt (nlNullaryConPat eqTag_RDR) eq,
mkSimpleHsAlt (nlNullaryConPat gtTag_RDR) gt]
where
a_expr = nlHsVar a
b_expr = nlHsVar b
(lt_op, _, eq_op, _, _) = primOrdOps "Ord" tycon ty
| 1,240
|
mkCompareFields tycon op tys
= go tys as_RDRs bs_RDRs
where
go [] _ _ = eqResult op
go [ty] (a:_) (b:_)
| isUnLiftedType ty = unliftedOrdOp tycon ty op a b
| otherwise = genOpApp (nlHsVar a) (ordMethRdr op) (nlHsVar b)
go (ty:tys) (a:as) (b:bs) = mk_compare ty a b
(ltResult op)
(go tys as bs)
(gtResult op)
go _ _ _ = panic "mkCompareFields"
-- (mk_compare ty a b) generates
-- (case (compare a b) of { LT -> <lt>; EQ -> <eq>; GT -> <bt> })
-- but with suitable special cases for
mk_compare ty a b lt eq gt
| isUnLiftedType ty
= unliftedCompare lt_op eq_op a_expr b_expr lt eq gt
| otherwise
= nlHsCase (nlHsPar (nlHsApp (nlHsApp (nlHsVar compare_RDR) a_expr) b_expr))
[mkSimpleHsAlt (nlNullaryConPat ltTag_RDR) lt,
mkSimpleHsAlt (nlNullaryConPat eqTag_RDR) eq,
mkSimpleHsAlt (nlNullaryConPat gtTag_RDR) gt]
where
a_expr = nlHsVar a
b_expr = nlHsVar b
(lt_op, _, eq_op, _, _) = primOrdOps "Ord" tycon ty
| 1,177
| true
| true
| 0
| 14
| 454
| 406
| 202
| 204
| null | null |
junjihashimoto/persistent
|
persistent-template/Database/Persist/TH.hs
|
mit
|
mkJSON :: MkPersistSettings -> EntityDef -> Q [Dec]
mkJSON _ def | not ("json" `elem` entityAttrs def) = return []
| 114
|
mkJSON :: MkPersistSettings -> EntityDef -> Q [Dec]
mkJSON _ def | not ("json" `elem` entityAttrs def) = return []
| 114
|
mkJSON _ def | not ("json" `elem` entityAttrs def) = return []
| 62
| false
| true
| 0
| 11
| 19
| 56
| 27
| 29
| null | null |
zalora/myrapi
|
src/Main.hs
|
mit
|
commandOptions :: Parser Command
commandOptions = subparser $
(command "create" (info (Create <$> domainOption <*> dnsCreateOptions)
(progDesc "Create a record for a domain")))
<>
(command "list" (info (List <$> dnsListOptions)
(progDesc "List records for a domain")))
| 315
|
commandOptions :: Parser Command
commandOptions = subparser $
(command "create" (info (Create <$> domainOption <*> dnsCreateOptions)
(progDesc "Create a record for a domain")))
<>
(command "list" (info (List <$> dnsListOptions)
(progDesc "List records for a domain")))
| 315
|
commandOptions = subparser $
(command "create" (info (Create <$> domainOption <*> dnsCreateOptions)
(progDesc "Create a record for a domain")))
<>
(command "list" (info (List <$> dnsListOptions)
(progDesc "List records for a domain")))
| 282
| false
| true
| 3
| 12
| 82
| 89
| 43
| 46
| null | null |
pqwy/redex
|
src/Reductions.hs
|
bsd-3-clause
|
odesu :: (Term -> Term -> Term) -> Term -> (Term -> Reduceron a) -> (Term -> Reduceron a) -> Reduceron a
odesu bt t@(ast -> Lam _ _) k1 k2 = k2 t
| 146
|
odesu :: (Term -> Term -> Term) -> Term -> (Term -> Reduceron a) -> (Term -> Reduceron a) -> Reduceron a
odesu bt t@(ast -> Lam _ _) k1 k2 = k2 t
| 145
|
odesu bt t@(ast -> Lam _ _) k1 k2 = k2 t
| 40
| false
| true
| 0
| 11
| 34
| 88
| 44
| 44
| null | null |
tkasu/haskellbook-adventure
|
app/Chap9.hs
|
bsd-3-clause
|
-- empty list, as no y satisfies the filter condition
what3 = take 5 [ (x, y) | x <- mySqr, y <- mySqr, x < 50, y > 50 ]
| 120
|
what3 = take 5 [ (x, y) | x <- mySqr, y <- mySqr, x < 50, y > 50 ]
| 66
|
what3 = take 5 [ (x, y) | x <- mySqr, y <- mySqr, x < 50, y > 50 ]
| 66
| true
| false
| 0
| 8
| 30
| 53
| 28
| 25
| null | null |
semaj/hademlia
|
src/Constants.hs
|
bsd-3-clause
|
-- | Concurrency parameter
a :: Int
a = 2
| 41
|
a :: Int
a = 2
| 14
|
a = 2
| 5
| true
| true
| 0
| 6
| 9
| 19
| 8
| 11
| null | null |
pegurnee/2015-01-341
|
projects/project6_mini_haskell/haskell_mini_project.hs
|
mit
|
permute [] = [[]]
| 17
|
permute [] = [[]]
| 17
|
permute [] = [[]]
| 17
| false
| false
| 1
| 6
| 3
| 19
| 8
| 11
| null | null |
urbanslug/ghc
|
compiler/simplStg/UnariseStg.hs
|
bsd-3-clause
|
unariseLives :: UnariseEnv -> StgLiveVars -> StgLiveVars
unariseLives rho ids = concatMapVarSet (unariseId rho) ids
| 115
|
unariseLives :: UnariseEnv -> StgLiveVars -> StgLiveVars
unariseLives rho ids = concatMapVarSet (unariseId rho) ids
| 115
|
unariseLives rho ids = concatMapVarSet (unariseId rho) ids
| 58
| false
| true
| 0
| 7
| 14
| 35
| 17
| 18
| null | null |
Philonous/hs-otr
|
source/Otr/Serialize.hs
|
mit
|
getMessageHeader :: Get OtrMessageHeader
getMessageHeader = MH <$> getWord16be
<*> getWord8
<*> getWord32be
<*> getWord32be
| 189
|
getMessageHeader :: Get OtrMessageHeader
getMessageHeader = MH <$> getWord16be
<*> getWord8
<*> getWord32be
<*> getWord32be
| 189
|
getMessageHeader = MH <$> getWord16be
<*> getWord8
<*> getWord32be
<*> getWord32be
| 148
| false
| true
| 11
| 6
| 80
| 46
| 22
| 24
| null | null |
andorp/hs-bluesnap
|
src/Bluesnap/API/Request.hs
|
gpl-3.0
|
elementCredit_cards_info :: XMLParser Credit_cards_info
elementCredit_cards_info = parseSchemaType "credit-cards-info"
| 118
|
elementCredit_cards_info :: XMLParser Credit_cards_info
elementCredit_cards_info = parseSchemaType "credit-cards-info"
| 118
|
elementCredit_cards_info = parseSchemaType "credit-cards-info"
| 62
| false
| true
| 0
| 5
| 7
| 17
| 8
| 9
| null | null |
kindl/Hypatia
|
src/Syntax.hs
|
mit
|
getDefsP p =
let
f (VariablePattern v) = [v]
f (AliasPattern i _) = [i]
f _ = []
in foldMap' f (universe p)
| 139
|
getDefsP p =
let
f (VariablePattern v) = [v]
f (AliasPattern i _) = [i]
f _ = []
in foldMap' f (universe p)
| 139
|
getDefsP p =
let
f (VariablePattern v) = [v]
f (AliasPattern i _) = [i]
f _ = []
in foldMap' f (universe p)
| 139
| false
| false
| 0
| 11
| 55
| 72
| 35
| 37
| null | null |
phischu/fragnix
|
builtins/base/GHC.IO.Encoding.UTF32.hs
|
bsd-3-clause
|
ord4 :: Char -> (Word8,Word8,Word8,Word8)
ord4 c = (fromIntegral (x `shiftR` 24),
fromIntegral (x `shiftR` 16),
fromIntegral (x `shiftR` 8),
fromIntegral x)
where
x = ord c
| 209
|
ord4 :: Char -> (Word8,Word8,Word8,Word8)
ord4 c = (fromIntegral (x `shiftR` 24),
fromIntegral (x `shiftR` 16),
fromIntegral (x `shiftR` 8),
fromIntegral x)
where
x = ord c
| 209
|
ord4 c = (fromIntegral (x `shiftR` 24),
fromIntegral (x `shiftR` 16),
fromIntegral (x `shiftR` 8),
fromIntegral x)
where
x = ord c
| 167
| false
| true
| 0
| 8
| 63
| 92
| 52
| 40
| null | null |
aminb/blog
|
src/Minification.hs
|
gpl-3.0
|
stripCssBefore :: String -> String
stripCssBefore = filterWithNext shouldKeep
where shouldKeep s (Just '>') = not $ isSpace s
shouldKeep s (Just '{') = not $ isSpace s
shouldKeep ';' (Just '}') = False
shouldKeep _ _ = True
-- A basic css minifier that merges and removes whitespace. The transformations
-- it makes might not be correct (inside strings for example), but it works for
-- the stylesheets that I use it on.
| 462
|
stripCssBefore :: String -> String
stripCssBefore = filterWithNext shouldKeep
where shouldKeep s (Just '>') = not $ isSpace s
shouldKeep s (Just '{') = not $ isSpace s
shouldKeep ';' (Just '}') = False
shouldKeep _ _ = True
-- A basic css minifier that merges and removes whitespace. The transformations
-- it makes might not be correct (inside strings for example), but it works for
-- the stylesheets that I use it on.
| 462
|
stripCssBefore = filterWithNext shouldKeep
where shouldKeep s (Just '>') = not $ isSpace s
shouldKeep s (Just '{') = not $ isSpace s
shouldKeep ';' (Just '}') = False
shouldKeep _ _ = True
-- A basic css minifier that merges and removes whitespace. The transformations
-- it makes might not be correct (inside strings for example), but it works for
-- the stylesheets that I use it on.
| 427
| false
| true
| 1
| 7
| 115
| 109
| 49
| 60
| null | null |
mcschroeder/ghc
|
compiler/hsSyn/HsBinds.hs
|
bsd-3-clause
|
isEmptyLHsBinds :: LHsBindsLR idL idR -> Bool
isEmptyLHsBinds = isEmptyBag
| 74
|
isEmptyLHsBinds :: LHsBindsLR idL idR -> Bool
isEmptyLHsBinds = isEmptyBag
| 74
|
isEmptyLHsBinds = isEmptyBag
| 28
| false
| true
| 0
| 6
| 9
| 20
| 10
| 10
| null | null |
tdietert/nanocoin
|
src/Key.hs
|
apache-2.0
|
dehexPub :: ByteString -> Either Text ECDSA.PublicKey
dehexPub bs = do
bs' <- first toS $ BAE.convertFromBase BAE.Base16 bs
let (xs, ys) = BS.splitAt 32 bs'
let point = ECC.Point (CNS.os2ip xs) (CNS.os2ip ys)
if ECC.isPointValid sec_p256k1 point
then Right $ ECDSA.PublicKey sec_p256k1 point
else Left "dehexPub: Invalid public key point"
-- | Oh no, Orphan instances!
| 385
|
dehexPub :: ByteString -> Either Text ECDSA.PublicKey
dehexPub bs = do
bs' <- first toS $ BAE.convertFromBase BAE.Base16 bs
let (xs, ys) = BS.splitAt 32 bs'
let point = ECC.Point (CNS.os2ip xs) (CNS.os2ip ys)
if ECC.isPointValid sec_p256k1 point
then Right $ ECDSA.PublicKey sec_p256k1 point
else Left "dehexPub: Invalid public key point"
-- | Oh no, Orphan instances!
| 385
|
dehexPub bs = do
bs' <- first toS $ BAE.convertFromBase BAE.Base16 bs
let (xs, ys) = BS.splitAt 32 bs'
let point = ECC.Point (CNS.os2ip xs) (CNS.os2ip ys)
if ECC.isPointValid sec_p256k1 point
then Right $ ECDSA.PublicKey sec_p256k1 point
else Left "dehexPub: Invalid public key point"
-- | Oh no, Orphan instances!
| 331
| false
| true
| 0
| 13
| 73
| 136
| 64
| 72
| null | null |
beni55/yst
|
Yst/Data.hs
|
gpl-2.0
|
reverseIfDescending Descending LT = GT
| 38
|
reverseIfDescending Descending LT = GT
| 38
|
reverseIfDescending Descending LT = GT
| 38
| false
| false
| 0
| 5
| 4
| 13
| 5
| 8
| null | null |
roberth/uu-helium
|
test/staticerrors/TestCollectFunBinds.hs
|
gpl-3.0
|
a (x:xs) = 1
| 12
|
a (x:xs) = 1
| 12
|
a (x:xs) = 1
| 12
| false
| false
| 0
| 6
| 3
| 17
| 8
| 9
| null | null |
TomRegan/HaskellStarter
|
test/Properties.hs
|
mit
|
prop_list_reverse_reverse :: [Int] -> Bool
prop_list_reverse_reverse list = list == reverse (reverse list)
| 106
|
prop_list_reverse_reverse :: [Int] -> Bool
prop_list_reverse_reverse list = list == reverse (reverse list)
| 106
|
prop_list_reverse_reverse list = list == reverse (reverse list)
| 63
| false
| true
| 0
| 8
| 12
| 34
| 17
| 17
| null | null |
ancientlanguage/haskell-analysis
|
prepare/src/Prepare/Decompose.hs
|
mit
|
decomposeChar '\x013A' = "\x006C\x0301"
| 39
|
decomposeChar '\x013A' = "\x006C\x0301"
| 39
|
decomposeChar '\x013A' = "\x006C\x0301"
| 39
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
GRACeFUL-project/haskelzinc
|
src/Interfaces/MZBuiltIns.hs
|
bsd-3-clause
|
-- Search annotations
mz_bool_search = Annotation "bool_search"
| 64
|
mz_bool_search = Annotation "bool_search"
| 42
|
mz_bool_search = Annotation "bool_search"
| 42
| true
| false
| 0
| 5
| 7
| 10
| 5
| 5
| null | null |
ml9951/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
smallIntegerName = varQual gHC_INTEGER_TYPE (fsLit "smallInteger") smallIntegerIdKey
| 94
|
smallIntegerName = varQual gHC_INTEGER_TYPE (fsLit "smallInteger") smallIntegerIdKey
| 94
|
smallIntegerName = varQual gHC_INTEGER_TYPE (fsLit "smallInteger") smallIntegerIdKey
| 94
| false
| false
| 0
| 7
| 16
| 19
| 9
| 10
| null | null |
tomahawkins/ecu
|
src/CANViewDecompose.hs
|
bsd-3-clause
|
decodeSignal :: [Word8] -> CANSignal -> Float
decodeSignal payload signal = (fromIntegral binaryValue) * factor + offset
where
binaryValue = case (canSignalEndian signal) of
CANBigEndian -> getBinaryValueBE word64 signal
CANLittleEndian -> getBinaryValueLE word64 signal
factor = canSignalFactor signal
offset = canSignalOffset signal
word64 = toWord64 payload
| 393
|
decodeSignal :: [Word8] -> CANSignal -> Float
decodeSignal payload signal = (fromIntegral binaryValue) * factor + offset
where
binaryValue = case (canSignalEndian signal) of
CANBigEndian -> getBinaryValueBE word64 signal
CANLittleEndian -> getBinaryValueLE word64 signal
factor = canSignalFactor signal
offset = canSignalOffset signal
word64 = toWord64 payload
| 393
|
decodeSignal payload signal = (fromIntegral binaryValue) * factor + offset
where
binaryValue = case (canSignalEndian signal) of
CANBigEndian -> getBinaryValueBE word64 signal
CANLittleEndian -> getBinaryValueLE word64 signal
factor = canSignalFactor signal
offset = canSignalOffset signal
word64 = toWord64 payload
| 347
| false
| true
| 1
| 8
| 78
| 85
| 43
| 42
| null | null |
juhp/stack
|
src/Stack/Types/Compiler.hs
|
bsd-3-clause
|
isWantedCompiler _check (WCGhcGit wCommit wFlavour) (ACGhcGit aCommit aFlavour) =
wCommit == aCommit && wFlavour == aFlavour
| 128
|
isWantedCompiler _check (WCGhcGit wCommit wFlavour) (ACGhcGit aCommit aFlavour) =
wCommit == aCommit && wFlavour == aFlavour
| 128
|
isWantedCompiler _check (WCGhcGit wCommit wFlavour) (ACGhcGit aCommit aFlavour) =
wCommit == aCommit && wFlavour == aFlavour
| 128
| false
| false
| 0
| 7
| 19
| 41
| 20
| 21
| null | null |
ekmett/unboxed-containers
|
Data/Set/Unboxed.hs
|
bsd-3-clause
|
-- | /O(n+m)/. Is this a subset?
-- @(s1 `isSubsetOf` s2)@ tells whether @s1@ is a subset of @s2@.
isSubsetOf :: (US a, Ord a) => USet a -> USet a -> Bool
isSubsetOf t1 t2 = (size t1 <= size t2) && (isSubsetOfX t1 t2)
| 217
|
isSubsetOf :: (US a, Ord a) => USet a -> USet a -> Bool
isSubsetOf t1 t2 = (size t1 <= size t2) && (isSubsetOfX t1 t2)
| 118
|
isSubsetOf t1 t2 = (size t1 <= size t2) && (isSubsetOfX t1 t2)
| 62
| true
| true
| 0
| 9
| 45
| 78
| 37
| 41
| null | null |
beni55/texmath
|
src/Text/TeXMath/Readers/TeX/Macros.hs
|
gpl-2.0
|
skipComment :: GenParser Char st ()
skipComment = skipMany comment
| 66
|
skipComment :: GenParser Char st ()
skipComment = skipMany comment
| 66
|
skipComment = skipMany comment
| 30
| false
| true
| 0
| 6
| 9
| 23
| 11
| 12
| null | null |
kvelicka/frag
|
src/Main.hs
|
gpl-2.0
|
createAWindow :: String -> String -> IO ()
createAWindow windowName level = do
initialDisplayMode $= [WithDepthBuffer, DoubleBuffered, RGBAMode]
drawBuffer $= BackBuffers
initialWindowSize $= (Size 640 480)
createWindow windowName
clear [ColorBuffer]
viewport $= ((Position 0 0), Size 640 480)
matrixMode $= Projection
loadIdentity
perspective 70.0 (640/480) 10.0 4000.0
matrixMode $= Modelview 0
loadIdentity
depthFunc $= Just Less
texture Texture2D $= Enabled
cullFace $= Just Front
cursor $= None
--load our level objects from the *.cfg file
iobjs <- readMapCfg (level ++ ".cfg")
let cam = initCamera (80::Int,61::Int,60::Int) (80::Int,611::Int,59::Int) (0::Int,1::Int,0::Int)
camRef <- newIORef(cam)
--read the BSP files and player models specified in the *.med files
(mapRef,modls) <- readMapMedia (level ++ ".med")
listModels <- toList modls
animList <- mapM getAnims listModels
--complete the objects
let objs = toCompleteObjects animList iobjs
--build the fonts
(tex,base)<- buildFonts
numbase <- buildBigNums
--create a hashmap for textures
texs <- fromList hashString []
--create the crosshair
crosshair <- getAndCreateTexture "crosshaira"
insert texs "crosshair" crosshair
--set up the variables needed by our callbacks and game loop
tme <- get elapsedTime
lasttime <- newIORef(tme)
lastDTime <- newIORef(tme)
lastDTime2 <- newIORef(tme)
fpsc1 <- newIORef(0,0)
fps1 <- newIORef(0,0,0)
newIORef(0::Int)
_ <- newIORef(tme)
--hold new keyboard input
newInput <- newIORef(Nothing)
inpState <- newIORef (False)
--hold the new mouse input
newMouseInput <- newIORef(Nothing)
--lock the mouse or not
lck <- newIORef(True)
(_, _) <- getWinInput
(lasttime, (newInput,newMouseInput)) inpState True tme
hasReact <- newIORef(False)
mp <- readIORef mapRef
let gd = GameData {
gamemap = mapRef,
models = modls,
textures = texs,
camera = camRef,
lastDrawTime = lastDTime,
lastDrawTime2 = lastDTime2,
hasReacted = hasReact,
fonts = (tex,base),
nbase = numbase,
lock = lck,
fpsc = fpsc1,
fpss = fps1,
nems = ((length objs)-1)
}
rh <-
reactInit
(initr lasttime (newInput,newMouseInput) inpState)
(actuate gd)
(repeatedly (0.016) () &&&(parseWinInput >>> game mp objs))
--set up the callbacks
displayCallback $= display
keyboardMouseCallback $= Just (keyboardMouse newInput newMouseInput lck)
motionCallback $= Just (dragMotion newMouseInput)
passiveMotionCallback $= Just (mouseMotion newMouseInput)
idleCallback $=
Just (idle lasttime (newInput,newMouseInput)
hasReact (tex,base) inpState rh)
where getAnims (x,y) = do
us <- readIORef (upperState y)
ls <- readIORef (lowerState y)
return (x,us,ls)
-------------------------------------------------------------------------------
-- functions to connect Haskell and Yampa
| 3,532
|
createAWindow :: String -> String -> IO ()
createAWindow windowName level = do
initialDisplayMode $= [WithDepthBuffer, DoubleBuffered, RGBAMode]
drawBuffer $= BackBuffers
initialWindowSize $= (Size 640 480)
createWindow windowName
clear [ColorBuffer]
viewport $= ((Position 0 0), Size 640 480)
matrixMode $= Projection
loadIdentity
perspective 70.0 (640/480) 10.0 4000.0
matrixMode $= Modelview 0
loadIdentity
depthFunc $= Just Less
texture Texture2D $= Enabled
cullFace $= Just Front
cursor $= None
--load our level objects from the *.cfg file
iobjs <- readMapCfg (level ++ ".cfg")
let cam = initCamera (80::Int,61::Int,60::Int) (80::Int,611::Int,59::Int) (0::Int,1::Int,0::Int)
camRef <- newIORef(cam)
--read the BSP files and player models specified in the *.med files
(mapRef,modls) <- readMapMedia (level ++ ".med")
listModels <- toList modls
animList <- mapM getAnims listModels
--complete the objects
let objs = toCompleteObjects animList iobjs
--build the fonts
(tex,base)<- buildFonts
numbase <- buildBigNums
--create a hashmap for textures
texs <- fromList hashString []
--create the crosshair
crosshair <- getAndCreateTexture "crosshaira"
insert texs "crosshair" crosshair
--set up the variables needed by our callbacks and game loop
tme <- get elapsedTime
lasttime <- newIORef(tme)
lastDTime <- newIORef(tme)
lastDTime2 <- newIORef(tme)
fpsc1 <- newIORef(0,0)
fps1 <- newIORef(0,0,0)
newIORef(0::Int)
_ <- newIORef(tme)
--hold new keyboard input
newInput <- newIORef(Nothing)
inpState <- newIORef (False)
--hold the new mouse input
newMouseInput <- newIORef(Nothing)
--lock the mouse or not
lck <- newIORef(True)
(_, _) <- getWinInput
(lasttime, (newInput,newMouseInput)) inpState True tme
hasReact <- newIORef(False)
mp <- readIORef mapRef
let gd = GameData {
gamemap = mapRef,
models = modls,
textures = texs,
camera = camRef,
lastDrawTime = lastDTime,
lastDrawTime2 = lastDTime2,
hasReacted = hasReact,
fonts = (tex,base),
nbase = numbase,
lock = lck,
fpsc = fpsc1,
fpss = fps1,
nems = ((length objs)-1)
}
rh <-
reactInit
(initr lasttime (newInput,newMouseInput) inpState)
(actuate gd)
(repeatedly (0.016) () &&&(parseWinInput >>> game mp objs))
--set up the callbacks
displayCallback $= display
keyboardMouseCallback $= Just (keyboardMouse newInput newMouseInput lck)
motionCallback $= Just (dragMotion newMouseInput)
passiveMotionCallback $= Just (mouseMotion newMouseInput)
idleCallback $=
Just (idle lasttime (newInput,newMouseInput)
hasReact (tex,base) inpState rh)
where getAnims (x,y) = do
us <- readIORef (upperState y)
ls <- readIORef (lowerState y)
return (x,us,ls)
-------------------------------------------------------------------------------
-- functions to connect Haskell and Yampa
| 3,532
|
createAWindow windowName level = do
initialDisplayMode $= [WithDepthBuffer, DoubleBuffered, RGBAMode]
drawBuffer $= BackBuffers
initialWindowSize $= (Size 640 480)
createWindow windowName
clear [ColorBuffer]
viewport $= ((Position 0 0), Size 640 480)
matrixMode $= Projection
loadIdentity
perspective 70.0 (640/480) 10.0 4000.0
matrixMode $= Modelview 0
loadIdentity
depthFunc $= Just Less
texture Texture2D $= Enabled
cullFace $= Just Front
cursor $= None
--load our level objects from the *.cfg file
iobjs <- readMapCfg (level ++ ".cfg")
let cam = initCamera (80::Int,61::Int,60::Int) (80::Int,611::Int,59::Int) (0::Int,1::Int,0::Int)
camRef <- newIORef(cam)
--read the BSP files and player models specified in the *.med files
(mapRef,modls) <- readMapMedia (level ++ ".med")
listModels <- toList modls
animList <- mapM getAnims listModels
--complete the objects
let objs = toCompleteObjects animList iobjs
--build the fonts
(tex,base)<- buildFonts
numbase <- buildBigNums
--create a hashmap for textures
texs <- fromList hashString []
--create the crosshair
crosshair <- getAndCreateTexture "crosshaira"
insert texs "crosshair" crosshair
--set up the variables needed by our callbacks and game loop
tme <- get elapsedTime
lasttime <- newIORef(tme)
lastDTime <- newIORef(tme)
lastDTime2 <- newIORef(tme)
fpsc1 <- newIORef(0,0)
fps1 <- newIORef(0,0,0)
newIORef(0::Int)
_ <- newIORef(tme)
--hold new keyboard input
newInput <- newIORef(Nothing)
inpState <- newIORef (False)
--hold the new mouse input
newMouseInput <- newIORef(Nothing)
--lock the mouse or not
lck <- newIORef(True)
(_, _) <- getWinInput
(lasttime, (newInput,newMouseInput)) inpState True tme
hasReact <- newIORef(False)
mp <- readIORef mapRef
let gd = GameData {
gamemap = mapRef,
models = modls,
textures = texs,
camera = camRef,
lastDrawTime = lastDTime,
lastDrawTime2 = lastDTime2,
hasReacted = hasReact,
fonts = (tex,base),
nbase = numbase,
lock = lck,
fpsc = fpsc1,
fpss = fps1,
nems = ((length objs)-1)
}
rh <-
reactInit
(initr lasttime (newInput,newMouseInput) inpState)
(actuate gd)
(repeatedly (0.016) () &&&(parseWinInput >>> game mp objs))
--set up the callbacks
displayCallback $= display
keyboardMouseCallback $= Just (keyboardMouse newInput newMouseInput lck)
motionCallback $= Just (dragMotion newMouseInput)
passiveMotionCallback $= Just (mouseMotion newMouseInput)
idleCallback $=
Just (idle lasttime (newInput,newMouseInput)
hasReact (tex,base) inpState rh)
where getAnims (x,y) = do
us <- readIORef (upperState y)
ls <- readIORef (lowerState y)
return (x,us,ls)
-------------------------------------------------------------------------------
-- functions to connect Haskell and Yampa
| 3,489
| false
| true
| 0
| 15
| 1,174
| 971
| 490
| 481
| null | null |
artemav/kalman1d
|
src/KF.hs
|
bsd-3-clause
|
a :: Double
a = 1
| 17
|
a :: Double
a = 1
| 17
|
a = 1
| 5
| false
| true
| 0
| 6
| 5
| 18
| 7
| 11
| null | null |
Paow/encore
|
src/types/Typechecker/Util.hs
|
bsd-3-clause
|
pushError expr err = local (pushBT expr) $ tcError err
| 54
|
pushError expr err = local (pushBT expr) $ tcError err
| 54
|
pushError expr err = local (pushBT expr) $ tcError err
| 54
| false
| false
| 1
| 7
| 9
| 31
| 12
| 19
| null | null |
nikita-volkov/stm-containers
|
library/StmContainers/Map.hs
|
mit
|
listT :: Map key value -> ListT STM (key, value)
listT (Map hamt) =
fmap (\ (Product2 k v) -> (k, v)) (A.listT hamt)
| 118
|
listT :: Map key value -> ListT STM (key, value)
listT (Map hamt) =
fmap (\ (Product2 k v) -> (k, v)) (A.listT hamt)
| 118
|
listT (Map hamt) =
fmap (\ (Product2 k v) -> (k, v)) (A.listT hamt)
| 69
| false
| true
| 0
| 9
| 25
| 75
| 39
| 36
| null | null |
denibertovic/haskell
|
kubernetes/lib/Kubernetes/OpenAPI/API/CustomObjects.hs
|
bsd-3-clause
|
-- *** replaceClusterCustomObjectStatus
-- | @PUT \/apis\/{group}\/{version}\/{plural}\/{name}\/status@
--
-- replace status of the cluster scoped specified custom object
--
-- AuthMethod: 'AuthApiKeyBearerToken'
--
replaceClusterCustomObjectStatus
:: (Consumes ReplaceClusterCustomObjectStatus contentType, MimeRender contentType A.Value)
=> ContentType contentType -- ^ request content-type ('MimeType')
-> Accept accept -- ^ request accept ('MimeType')
-> Group -- ^ "group" - the custom resource's group
-> Version -- ^ "version" - the custom resource's version
-> Plural -- ^ "plural" - the custom resource's plural name. For TPRs this would be lowercase plural kind.
-> Name -- ^ "name" - the custom object's name
-> A.Value -- ^ "body"
-> KubernetesRequest ReplaceClusterCustomObjectStatus contentType A.Value accept
replaceClusterCustomObjectStatus _ _ (Group group) (Version version) (Plural plural) (Name name) body =
_mkRequest "PUT" ["/apis/",toPath group,"/",toPath version,"/",toPath plural,"/",toPath name,"/status"]
`_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyBearerToken)
`setBodyParam` body
| 1,147
|
replaceClusterCustomObjectStatus
:: (Consumes ReplaceClusterCustomObjectStatus contentType, MimeRender contentType A.Value)
=> ContentType contentType -- ^ request content-type ('MimeType')
-> Accept accept -- ^ request accept ('MimeType')
-> Group -- ^ "group" - the custom resource's group
-> Version -- ^ "version" - the custom resource's version
-> Plural -- ^ "plural" - the custom resource's plural name. For TPRs this would be lowercase plural kind.
-> Name -- ^ "name" - the custom object's name
-> A.Value -- ^ "body"
-> KubernetesRequest ReplaceClusterCustomObjectStatus contentType A.Value accept
replaceClusterCustomObjectStatus _ _ (Group group) (Version version) (Plural plural) (Name name) body =
_mkRequest "PUT" ["/apis/",toPath group,"/",toPath version,"/",toPath plural,"/",toPath name,"/status"]
`_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyBearerToken)
`setBodyParam` body
| 927
|
replaceClusterCustomObjectStatus _ _ (Group group) (Version version) (Plural plural) (Name name) body =
_mkRequest "PUT" ["/apis/",toPath group,"/",toPath version,"/",toPath plural,"/",toPath name,"/status"]
`_hasAuthType` (P.Proxy :: P.Proxy AuthApiKeyBearerToken)
`setBodyParam` body
| 296
| true
| true
| 1
| 16
| 171
| 206
| 111
| 95
| null | null |
ocean0yohsuke/Simply-Typed-Lambda
|
src/Lambda/Evaluator/Prelude.hs
|
bsd-3-clause
|
evalDiv (INT n1 msp) = localMSPBy msp $ (*:) $ AFUNC ("("++ show n1 ++ "/)") $ f n1
where
f :: Integer -> Term -> Lambda Term
f n1 (INT 0 msp) = localMSPBy msp $ throwEvalError $ strMsg $ "devide by zero"
f n1 (INT n2 _) = (*:) $ int (div n1 n2)
--evalDiv x = error $ "x: " ++ show x
| 298
|
evalDiv (INT n1 msp) = localMSPBy msp $ (*:) $ AFUNC ("("++ show n1 ++ "/)") $ f n1
where
f :: Integer -> Term -> Lambda Term
f n1 (INT 0 msp) = localMSPBy msp $ throwEvalError $ strMsg $ "devide by zero"
f n1 (INT n2 _) = (*:) $ int (div n1 n2)
--evalDiv x = error $ "x: " ++ show x
| 298
|
evalDiv (INT n1 msp) = localMSPBy msp $ (*:) $ AFUNC ("("++ show n1 ++ "/)") $ f n1
where
f :: Integer -> Term -> Lambda Term
f n1 (INT 0 msp) = localMSPBy msp $ throwEvalError $ strMsg $ "devide by zero"
f n1 (INT n2 _) = (*:) $ int (div n1 n2)
--evalDiv x = error $ "x: " ++ show x
| 298
| false
| false
| 4
| 11
| 80
| 142
| 70
| 72
| null | null |
frantisekfarka/ghc-dsi
|
testsuite/tests/profiling/should_run/T3001-2.hs
|
bsd-3-clause
|
ingletonB :: Word8 -> Builder
singletonB = writeN 1 . flip poke
| 64
|
singletonB :: Word8 -> Builder
singletonB = writeN 1 . flip poke
| 64
|
singletonB = writeN 1 . flip poke
| 33
| false
| true
| 0
| 6
| 12
| 25
| 12
| 13
| null | null |
yjwen/hada
|
src/SynType.hs
|
lgpl-3.0
|
showBitWidthC DByte = "int16_t"
| 31
|
showBitWidthC DByte = "int16_t"
| 31
|
showBitWidthC DByte = "int16_t"
| 31
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
pierric/neural-network
|
Backend-blashs/Data/NeuralNetwork/Backend/BLASHS/Utils.hs
|
bsd-3-clause
|
-- | convert a 'DenseVector' to a vector of elements
denseVectorToVector :: (V.Storable a, MonadIO m) => DenseVector a -> m (BV.Vector a)
denseVectorToVector (DenseVector vs) = liftIO $ SV.unsafeFreeze vs >>= return . BV.convert
| 228
|
denseVectorToVector :: (V.Storable a, MonadIO m) => DenseVector a -> m (BV.Vector a)
denseVectorToVector (DenseVector vs) = liftIO $ SV.unsafeFreeze vs >>= return . BV.convert
| 175
|
denseVectorToVector (DenseVector vs) = liftIO $ SV.unsafeFreeze vs >>= return . BV.convert
| 90
| true
| true
| 0
| 10
| 34
| 75
| 37
| 38
| null | null |
mvr/cf
|
src/Math/ContinuedFraction.hs
|
mit
|
homAbsorb :: Num a => Hom a -> a -> Hom a
homAbsorb (n0, n1,
d0, d1) x = (n0*x + n1, n0,
d0*x + d1, d0)
| 138
|
homAbsorb :: Num a => Hom a -> a -> Hom a
homAbsorb (n0, n1,
d0, d1) x = (n0*x + n1, n0,
d0*x + d1, d0)
| 138
|
homAbsorb (n0, n1,
d0, d1) x = (n0*x + n1, n0,
d0*x + d1, d0)
| 96
| false
| true
| 0
| 8
| 61
| 77
| 41
| 36
| null | null |
kumasento/accelerate
|
Data/Array/Accelerate/Pretty/Print.hs
|
bsd-3-clause
|
prettyPrim (PrimMin _) = (False, text "min")
| 55
|
prettyPrim (PrimMin _) = (False, text "min")
| 55
|
prettyPrim (PrimMin _) = (False, text "min")
| 55
| false
| false
| 0
| 7
| 17
| 24
| 12
| 12
| null | null |
nomeata/ghc
|
compiler/nativeGen/PPC/Regs.hs
|
bsd-3-clause
|
freeReg REG_D2 = fastBool False
| 31
|
freeReg REG_D2 = fastBool False
| 31
|
freeReg REG_D2 = fastBool False
| 31
| false
| false
| 1
| 5
| 4
| 15
| 5
| 10
| null | null |
fpco/hlint
|
data/Default.hs
|
bsd-3-clause
|
warn = foldr f z (map g x) ==> foldr (f . g) z x
| 49
|
warn = foldr f z (map g x) ==> foldr (f . g) z x
| 49
|
warn = foldr f z (map g x) ==> foldr (f . g) z x
| 49
| false
| false
| 0
| 8
| 15
| 39
| 19
| 20
| null | null |
spacekitteh/smcghc
|
compiler/codeGen/StgCmmPrim.hs
|
bsd-3-clause
|
vecCmmCat WordVec = cmmBits
| 28
|
vecCmmCat WordVec = cmmBits
| 28
|
vecCmmCat WordVec = cmmBits
| 28
| false
| false
| 1
| 5
| 4
| 13
| 4
| 9
| null | null |
hxw/conlecterm
|
src/ProcessRunner.hs
|
bsd-2-clause
|
shutdown :: ProcRef -> IO ()
shutdown refproc = do
f <- V.isEmptyMVar refproc
if f
then return ()
else do
aProc <- V.takeMVar refproc
dec
_exitStatus <- waitForProcess aProc
return ()
| 219
|
shutdown :: ProcRef -> IO ()
shutdown refproc = do
f <- V.isEmptyMVar refproc
if f
then return ()
else do
aProc <- V.takeMVar refproc
dec
_exitStatus <- waitForProcess aProc
return ()
| 219
|
shutdown refproc = do
f <- V.isEmptyMVar refproc
if f
then return ()
else do
aProc <- V.takeMVar refproc
dec
_exitStatus <- waitForProcess aProc
return ()
| 190
| false
| true
| 0
| 13
| 67
| 89
| 38
| 51
| null | null |
tjakway/ghcjvm
|
compiler/prelude/THNames.hs
|
bsd-3-clause
|
typedRuleVarName = libFun (fsLit ("typedRuleVar")) typedRuleVarIdKey
| 68
|
typedRuleVarName = libFun (fsLit ("typedRuleVar")) typedRuleVarIdKey
| 68
|
typedRuleVarName = libFun (fsLit ("typedRuleVar")) typedRuleVarIdKey
| 68
| false
| false
| 0
| 8
| 5
| 20
| 10
| 10
| null | null |
urbit/urbit
|
pkg/hs/urbit-atom/bench/Main.hs
|
mit
|
-- Examples --------------------------------------------------------------------
a64, a32768 :: Atom
a64 = (2^64) - 1
| 121
|
a64, a32768 :: Atom
a64 = (2^64) - 1
| 39
|
a64 = (2^64) - 1
| 19
| true
| true
| 0
| 7
| 15
| 25
| 15
| 10
| null | null |
cutsea110/aop
|
src/Prime.hs
|
bsd-3-clause
|
approx n (x:xs) | n > 0 = x : approx (n-1) xs
| 45
|
approx n (x:xs) | n > 0 = x : approx (n-1) xs
| 45
|
approx n (x:xs) | n > 0 = x : approx (n-1) xs
| 45
| false
| false
| 0
| 9
| 12
| 44
| 21
| 23
| null | null |
dpiponi/Bine
|
src/OSCLI.hs
|
bsd-3-clause
|
execStarCommand (EXIT n) = liftIO $ exitWith (ExitFailure n)
| 60
|
execStarCommand (EXIT n) = liftIO $ exitWith (ExitFailure n)
| 60
|
execStarCommand (EXIT n) = liftIO $ exitWith (ExitFailure n)
| 60
| false
| false
| 0
| 8
| 8
| 28
| 13
| 15
| null | null |
OpenXT/manager
|
updatemgr/UpdateMgr/Logic.hs
|
gpl-2.0
|
downloadFiles :: Update ()
downloadFiles = do
-- TODO: maybe when we fix curl fork
-- waitNetworkAvailable
mapM_ downloadFile =<< (getDownloadFiles <* setUpdateState DownloadingFiles)
logInfo "finished download of all update files"
setUpdateState DownloadedFiles
| 272
|
downloadFiles :: Update ()
downloadFiles = do
-- TODO: maybe when we fix curl fork
-- waitNetworkAvailable
mapM_ downloadFile =<< (getDownloadFiles <* setUpdateState DownloadingFiles)
logInfo "finished download of all update files"
setUpdateState DownloadedFiles
| 272
|
downloadFiles = do
-- TODO: maybe when we fix curl fork
-- waitNetworkAvailable
mapM_ downloadFile =<< (getDownloadFiles <* setUpdateState DownloadingFiles)
logInfo "finished download of all update files"
setUpdateState DownloadedFiles
| 245
| false
| true
| 0
| 10
| 42
| 50
| 23
| 27
| null | null |
ChrisCoffey/haskell_sandbox
|
99problems.hs
|
mit
|
--18
slice xs i k = take (k - i + 1) $ drop (max (i -1) 0) xs
| 61
|
slice xs i k = take (k - i + 1) $ drop (max (i -1) 0) xs
| 56
|
slice xs i k = take (k - i + 1) $ drop (max (i -1) 0) xs
| 56
| true
| false
| 0
| 10
| 18
| 54
| 26
| 28
| null | null |
josefs/autosar
|
oldARSim/ABS.hs
|
bsd-3-clause
|
a1 = deriv v1
| 13
|
a1 = deriv v1
| 13
|
a1 = deriv v1
| 13
| false
| false
| 1
| 5
| 3
| 13
| 4
| 9
| null | null |
hvr/cassava
|
tests/UnitTests.hs
|
bsd-3-clause
|
customOptionsTests :: [TF.Test]
customOptionsTests =
[ testProperty "customDelim" customDelim
]
| 103
|
customOptionsTests :: [TF.Test]
customOptionsTests =
[ testProperty "customDelim" customDelim
]
| 103
|
customOptionsTests =
[ testProperty "customDelim" customDelim
]
| 71
| false
| true
| 0
| 6
| 17
| 24
| 13
| 11
| null | null |
rueshyna/gogol
|
gogol-identity-toolkit/gen/Network/Google/IdentityToolkit/Types/Product.hs
|
mpl-2.0
|
irpgpcrDynamicLinksDomain :: Lens' IdentitytoolkitRelyingPartyGetProjectConfigResponse (Maybe Text)
irpgpcrDynamicLinksDomain
= lens _irpgpcrDynamicLinksDomain
(\ s a -> s{_irpgpcrDynamicLinksDomain = a})
| 212
|
irpgpcrDynamicLinksDomain :: Lens' IdentitytoolkitRelyingPartyGetProjectConfigResponse (Maybe Text)
irpgpcrDynamicLinksDomain
= lens _irpgpcrDynamicLinksDomain
(\ s a -> s{_irpgpcrDynamicLinksDomain = a})
| 212
|
irpgpcrDynamicLinksDomain
= lens _irpgpcrDynamicLinksDomain
(\ s a -> s{_irpgpcrDynamicLinksDomain = a})
| 112
| false
| true
| 0
| 8
| 24
| 48
| 24
| 24
| null | null |
FranklinChen/hugs98-plus-Sep2006
|
packages/HaXml/src/Text/XML/HaXml/Parse.hs
|
bsd-3-clause
|
report :: (String->XParser a) -> String -> Posn -> TokenT -> XParser a
report fail exp p t = fail ("Expected "++exp++" but found "++show t
++"\n in "++show p)
| 186
|
report :: (String->XParser a) -> String -> Posn -> TokenT -> XParser a
report fail exp p t = fail ("Expected "++exp++" but found "++show t
++"\n in "++show p)
| 186
|
report fail exp p t = fail ("Expected "++exp++" but found "++show t
++"\n in "++show p)
| 115
| false
| true
| 0
| 11
| 57
| 81
| 39
| 42
| null | null |
brendanhay/gogol
|
gogol-clouderrorreporting/gen/Network/Google/CloudErrorReporting/Types/Product.hs
|
mpl-2.0
|
-- | The URL of the request.
httprcURL :: Lens' HTTPRequestContext (Maybe Text)
httprcURL
= lens _httprcURL (\ s a -> s{_httprcURL = a})
| 138
|
httprcURL :: Lens' HTTPRequestContext (Maybe Text)
httprcURL
= lens _httprcURL (\ s a -> s{_httprcURL = a})
| 109
|
httprcURL
= lens _httprcURL (\ s a -> s{_httprcURL = a})
| 58
| true
| true
| 0
| 9
| 25
| 48
| 25
| 23
| null | null |
portnov/dates
|
Data/Dates.hs
|
bsd-3-clause
|
euroNumDate ∷ Stream s m Char => ParsecT s st m DateTime
euroNumDate = do
d ← pDay
char '.'
m ← pMonth
char '.'
y ← pYear
return $ date y m d
| 153
|
euroNumDate ∷ Stream s m Char => ParsecT s st m DateTime
euroNumDate = do
d ← pDay
char '.'
m ← pMonth
char '.'
y ← pYear
return $ date y m d
| 153
|
euroNumDate = do
d ← pDay
char '.'
m ← pMonth
char '.'
y ← pYear
return $ date y m d
| 96
| false
| true
| 0
| 8
| 45
| 78
| 34
| 44
| null | null |
AlainODea/haskell-amqp-examples
|
Main.hs
|
apache-2.0
|
runExample :: (Channel -> IO a) -> IO ()
runExample example = do
conn <- openConnection "127.0.0.1" "/" "guest" "guest"
chan <- openChannel conn
example chan
getLine -- wait for keypress
closeConnection conn
| 217
|
runExample :: (Channel -> IO a) -> IO ()
runExample example = do
conn <- openConnection "127.0.0.1" "/" "guest" "guest"
chan <- openChannel conn
example chan
getLine -- wait for keypress
closeConnection conn
| 217
|
runExample example = do
conn <- openConnection "127.0.0.1" "/" "guest" "guest"
chan <- openChannel conn
example chan
getLine -- wait for keypress
closeConnection conn
| 176
| false
| true
| 0
| 9
| 42
| 80
| 34
| 46
| null | null |
adinapoli/Shelly.hs
|
src/Shelly/Pipe.hs
|
bsd-3-clause
|
-- | see 'S.appendToPath'
appendToPath :: FilePath -> Sh ()
appendToPath = sh1 S.appendToPath
| 93
|
appendToPath :: FilePath -> Sh ()
appendToPath = sh1 S.appendToPath
| 67
|
appendToPath = sh1 S.appendToPath
| 33
| true
| true
| 0
| 7
| 13
| 26
| 13
| 13
| null | null |
ambiata/mismi
|
mismi-ec2-core/src/Mismi/EC2/Core/Device.hs
|
bsd-3-clause
|
instanceStorage M2_XLarge = InstanceStore 1 420 420 HDD
| 55
|
instanceStorage M2_XLarge = InstanceStore 1 420 420 HDD
| 55
|
instanceStorage M2_XLarge = InstanceStore 1 420 420 HDD
| 55
| false
| false
| 0
| 5
| 7
| 18
| 8
| 10
| null | null |
sdiehl/ghc
|
testsuite/tests/simplCore/should_compile/par01.hs
|
bsd-3-clause
|
-- The smoking gun in -ddump-prep is:
-- case Par01.depth d of sat { __DEFAULT -> sat }
-- this should never happen!
depth :: Int -> Int
depth d = d `par` depth d
| 164
|
depth :: Int -> Int
depth d = d `par` depth d
| 45
|
depth d = d `par` depth d
| 25
| true
| true
| 0
| 7
| 36
| 35
| 18
| 17
| null | null |
unisonweb/platform
|
parser-typechecker/src/Unison/Server/Types.hs
|
mit
|
munge :: Text -> LZ.ByteString
munge = Text.encodeUtf8 . Text.fromStrict
| 72
|
munge :: Text -> LZ.ByteString
munge = Text.encodeUtf8 . Text.fromStrict
| 72
|
munge = Text.encodeUtf8 . Text.fromStrict
| 41
| false
| true
| 0
| 6
| 9
| 25
| 13
| 12
| null | null |
johnpmayer/data-annotated
|
src/Data/Annotated/LengthIndexedVectors.hs
|
bsd-3-clause
|
(!!) _ Nil = forbidden
| 38
|
(!!) _ Nil = forbidden
| 38
|
(!!) _ Nil = forbidden
| 38
| false
| false
| 1
| 5
| 20
| 15
| 7
| 8
| null | null |
SAdams601/ParRegexSearch
|
test/tasty-0.9.0.1/Test/Tasty.hs
|
mit
|
-- | Locally set the option value for the given test subtree
localOption :: IsOption v => v -> TestTree -> TestTree
localOption v = PlusTestOptions (setOption v)
| 161
|
localOption :: IsOption v => v -> TestTree -> TestTree
localOption v = PlusTestOptions (setOption v)
| 100
|
localOption v = PlusTestOptions (setOption v)
| 45
| true
| true
| 0
| 7
| 27
| 39
| 19
| 20
| null | null |
tolysz/hypergraph-store
|
src/Database/HypherGraph/IO.hs
|
bsd-3-clause
|
getMMArrayItem :: Storable a => (MMArray a) -> Int -> IO a
getMMArrayItem (MMArray m) i = withMVar m $ \m1 -> peekElemOff (storeMM m1) i
| 137
|
getMMArrayItem :: Storable a => (MMArray a) -> Int -> IO a
getMMArrayItem (MMArray m) i = withMVar m $ \m1 -> peekElemOff (storeMM m1) i
| 137
|
getMMArrayItem (MMArray m) i = withMVar m $ \m1 -> peekElemOff (storeMM m1) i
| 77
| false
| true
| 0
| 11
| 26
| 73
| 34
| 39
| null | null |
philopon/apiary-benchmark
|
src/yesod.hs
|
mit
|
handleNum29R :: Handler TypedContent; handleNum29R = returnBS "deep"
| 68
|
handleNum29R :: Handler TypedContent
handleNum29R = returnBS "deep"
| 67
|
handleNum29R = returnBS "deep"
| 30
| false
| true
| 1
| 5
| 7
| 21
| 9
| 12
| null | null |
DavidAlphaFox/ghc
|
libraries/bytestring/Data/ByteString.hs
|
bsd-3-clause
|
-- | 'foldl'' is like 'foldl', but strict in the accumulator.
--
foldl' :: (a -> Word8 -> a) -> a -> ByteString -> a
foldl' f v (PS fp off len) =
accursedUnutterablePerformIO $ withForeignPtr fp $ \p ->
go v (p `plusPtr` off) (p `plusPtr` (off+len))
where
-- tail recursive; traverses array left to right
go !z !p !q | p == q = return z
| otherwise = do x <- peek p
go (f z x) (p `plusPtr` 1) q
| 481
|
foldl' :: (a -> Word8 -> a) -> a -> ByteString -> a
foldl' f v (PS fp off len) =
accursedUnutterablePerformIO $ withForeignPtr fp $ \p ->
go v (p `plusPtr` off) (p `plusPtr` (off+len))
where
-- tail recursive; traverses array left to right
go !z !p !q | p == q = return z
| otherwise = do x <- peek p
go (f z x) (p `plusPtr` 1) q
| 416
|
foldl' f v (PS fp off len) =
accursedUnutterablePerformIO $ withForeignPtr fp $ \p ->
go v (p `plusPtr` off) (p `plusPtr` (off+len))
where
-- tail recursive; traverses array left to right
go !z !p !q | p == q = return z
| otherwise = do x <- peek p
go (f z x) (p `plusPtr` 1) q
| 364
| true
| true
| 0
| 12
| 170
| 178
| 90
| 88
| null | null |
badp/ganeti
|
src/Ganeti/Constants.hs
|
gpl-2.0
|
esActionSetinfo :: String
esActionSetinfo = "setinfo"
| 53
|
esActionSetinfo :: String
esActionSetinfo = "setinfo"
| 53
|
esActionSetinfo = "setinfo"
| 27
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
Laar/haskell-src-exts-quickcheck
|
src/Test/QuickCheck/Instances/HaskellSrcExts/Generators.hs
|
bsd-3-clause
|
symGenWith :: (Char -> Bool) -> CharGenMode -> Gen Char
symGenWith p m = symGen m `suchThat` p
| 95
|
symGenWith :: (Char -> Bool) -> CharGenMode -> Gen Char
symGenWith p m = symGen m `suchThat` p
| 95
|
symGenWith p m = symGen m `suchThat` p
| 39
| false
| true
| 0
| 8
| 18
| 48
| 23
| 25
| null | null |
4ZP6Capstone2015/ampersand
|
src/Database/Design/Ampersand/Input/ADL1/Lexer.hs
|
gpl-3.0
|
lexNest c p ('{':'-':s) = lexNest (lexNest c) (addPos 2 p) s
| 60
|
lexNest c p ('{':'-':s) = lexNest (lexNest c) (addPos 2 p) s
| 60
|
lexNest c p ('{':'-':s) = lexNest (lexNest c) (addPos 2 p) s
| 60
| false
| false
| 0
| 8
| 11
| 45
| 22
| 23
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.