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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mfpi/OpenGLRaw
|
src/Graphics/Rendering/OpenGL/Raw/ARB/Compatibility/Tokens.hs
|
bsd-3-clause
|
gl_CONVOLUTION_BORDER_COLOR :: GLenum
gl_CONVOLUTION_BORDER_COLOR = 0x8154
| 74
|
gl_CONVOLUTION_BORDER_COLOR :: GLenum
gl_CONVOLUTION_BORDER_COLOR = 0x8154
| 74
|
gl_CONVOLUTION_BORDER_COLOR = 0x8154
| 36
| false
| true
| 0
| 4
| 5
| 11
| 6
| 5
| null | null |
sanjoy/echoes
|
src/HIR/DeadAssignmentElimination.hs
|
gpl-3.0
|
transferDAE :: BwdTransfer HNode DAEFact
transferDAE = mkBTransfer3 closeOpen openOpen openClose
where
closeOpen _ = id
openOpen node f =
let rVars = getHVarsRead node
wVars = getHVarsWritten node
clearDefinedVars = L.foldl (flip S.delete) f wVars
in L.foldl (flip S.insert) clearDefinedVars rVars
openClose :: HNode O C -> FactBase DAEFact -> DAEFact
openClose node fBase =
let rVars = getHVarsRead node
wVars = getHVarsWritten node
totalFacts = S.unions $ map getFact $ successors node
clearDefinedVars = L.foldl (flip S.delete) totalFacts wVars
in L.foldl (flip S.insert) clearDefinedVars rVars
where getFact lbl = Mby.fromMaybe S.empty $ mapLookup lbl fBase
| 761
|
transferDAE :: BwdTransfer HNode DAEFact
transferDAE = mkBTransfer3 closeOpen openOpen openClose
where
closeOpen _ = id
openOpen node f =
let rVars = getHVarsRead node
wVars = getHVarsWritten node
clearDefinedVars = L.foldl (flip S.delete) f wVars
in L.foldl (flip S.insert) clearDefinedVars rVars
openClose :: HNode O C -> FactBase DAEFact -> DAEFact
openClose node fBase =
let rVars = getHVarsRead node
wVars = getHVarsWritten node
totalFacts = S.unions $ map getFact $ successors node
clearDefinedVars = L.foldl (flip S.delete) totalFacts wVars
in L.foldl (flip S.insert) clearDefinedVars rVars
where getFact lbl = Mby.fromMaybe S.empty $ mapLookup lbl fBase
| 761
|
transferDAE = mkBTransfer3 closeOpen openOpen openClose
where
closeOpen _ = id
openOpen node f =
let rVars = getHVarsRead node
wVars = getHVarsWritten node
clearDefinedVars = L.foldl (flip S.delete) f wVars
in L.foldl (flip S.insert) clearDefinedVars rVars
openClose :: HNode O C -> FactBase DAEFact -> DAEFact
openClose node fBase =
let rVars = getHVarsRead node
wVars = getHVarsWritten node
totalFacts = S.unions $ map getFact $ successors node
clearDefinedVars = L.foldl (flip S.delete) totalFacts wVars
in L.foldl (flip S.insert) clearDefinedVars rVars
where getFact lbl = Mby.fromMaybe S.empty $ mapLookup lbl fBase
| 720
| false
| true
| 1
| 12
| 196
| 263
| 118
| 145
| null | null |
schell/odin
|
odin-engine/src/Odin/Engine/New.hs
|
mit
|
ffor3 :: Applicative f => f a -> f b -> f c -> (a -> b -> c -> d) -> f d
ffor3 a b c f = f <$> a <*> b <*> c
| 108
|
ffor3 :: Applicative f => f a -> f b -> f c -> (a -> b -> c -> d) -> f d
ffor3 a b c f = f <$> a <*> b <*> c
| 108
|
ffor3 a b c f = f <$> a <*> b <*> c
| 35
| false
| true
| 0
| 13
| 36
| 82
| 39
| 43
| null | null |
elieux/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
randomGenClassName = clsQual rANDOM (fsLit "RandomGen") randomGenClassKey
| 78
|
randomGenClassName = clsQual rANDOM (fsLit "RandomGen") randomGenClassKey
| 78
|
randomGenClassName = clsQual rANDOM (fsLit "RandomGen") randomGenClassKey
| 78
| false
| false
| 0
| 7
| 11
| 19
| 9
| 10
| null | null |
kazu-yamamoto/http2
|
bench-priority/Main.hs
|
bsd-3-clause
|
deleteBIO :: [(Key,Weight)] -> IO ()
deleteBIO xs = do
q <- BIO.new numOfStreams
ents <- createBIO xs q
mapM_ (\ent -> BIO.delete ent q) ents
| 153
|
deleteBIO :: [(Key,Weight)] -> IO ()
deleteBIO xs = do
q <- BIO.new numOfStreams
ents <- createBIO xs q
mapM_ (\ent -> BIO.delete ent q) ents
| 153
|
deleteBIO xs = do
q <- BIO.new numOfStreams
ents <- createBIO xs q
mapM_ (\ent -> BIO.delete ent q) ents
| 116
| false
| true
| 0
| 12
| 37
| 84
| 39
| 45
| null | null |
ssaavedra/liquidhaskell
|
src/Language/Haskell/Liquid/GHC/Misc.hs
|
bsd-3-clause
|
fSrcSpan :: (F.Loc a) => a -> SrcSpan
fSrcSpan = fSrcSpanSrcSpan . F.srcSpan
| 76
|
fSrcSpan :: (F.Loc a) => a -> SrcSpan
fSrcSpan = fSrcSpanSrcSpan . F.srcSpan
| 76
|
fSrcSpan = fSrcSpanSrcSpan . F.srcSpan
| 38
| false
| true
| 0
| 7
| 12
| 32
| 17
| 15
| null | null |
lukexi/cabal
|
Cabal/tests/UnitTests/Distribution/Version.hs
|
bsd-3-clause
|
-- | 'intersectVersionIntervals' is commutative
--
prop_intersectVersionIntervals_commutative :: VersionIntervals
-> VersionIntervals -> Bool
prop_intersectVersionIntervals_commutative =
Laws.commutative intersectVersionIntervals
| 274
|
prop_intersectVersionIntervals_commutative :: VersionIntervals
-> VersionIntervals -> Bool
prop_intersectVersionIntervals_commutative =
Laws.commutative intersectVersionIntervals
| 223
|
prop_intersectVersionIntervals_commutative =
Laws.commutative intersectVersionIntervals
| 89
| true
| true
| 0
| 6
| 61
| 26
| 14
| 12
| null | null |
spechub/Hets
|
Comorphisms/CommonLogic2IsabelleHOL.hs
|
gpl-2.0
|
quantify :: RENAMES -> ClBasic.QUANT -> String -> Term -> Term
quantify rn q v s = termAppl (conDouble $ qname q)
(Abs (con $ rename rn v) s NotCont)
where qname ClBasic.Universal = allS
qname ClBasic.Existential = exS
| 245
|
quantify :: RENAMES -> ClBasic.QUANT -> String -> Term -> Term
quantify rn q v s = termAppl (conDouble $ qname q)
(Abs (con $ rename rn v) s NotCont)
where qname ClBasic.Universal = allS
qname ClBasic.Existential = exS
| 245
|
quantify rn q v s = termAppl (conDouble $ qname q)
(Abs (con $ rename rn v) s NotCont)
where qname ClBasic.Universal = allS
qname ClBasic.Existential = exS
| 182
| false
| true
| 1
| 10
| 65
| 98
| 48
| 50
| null | null |
sdiehl/ghc
|
testsuite/tests/codeGen/should_run/T15038/common/Data/Trie/Naive.hs
|
bsd-3-clause
|
c2w :: Char -> Word8
c2w = fromIntegral . Data.Char.ord
| 55
|
c2w :: Char -> Word8
c2w = fromIntegral . Data.Char.ord
| 55
|
c2w = fromIntegral . Data.Char.ord
| 34
| false
| true
| 0
| 7
| 9
| 29
| 13
| 16
| null | null |
haskell-servant/cretheus
|
Data/Cretheus.hs
|
bsd-3-clause
|
interpretP Mzero = mzero
| 24
|
interpretP Mzero = mzero
| 24
|
interpretP Mzero = mzero
| 24
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
Fuco1/mpris
|
src/DBus/Mpris/MediaPlayer2/Player/Properties.hs
|
gpl-3.0
|
-- | A value of 'False' indicates that playback is progressing
-- linearly through a playlist, while 'True' means playback is
-- progressing through a playlist in some other order.
shuffle :: BusName -> Mpris (Maybe Bool)
shuffle = property "Shuffle"
| 250
|
shuffle :: BusName -> Mpris (Maybe Bool)
shuffle = property "Shuffle"
| 69
|
shuffle = property "Shuffle"
| 28
| true
| true
| 0
| 8
| 40
| 30
| 16
| 14
| null | null |
lexml/lexml-linker
|
src/main/haskell/LexML/URN/Atalhos.hs
|
gpl-2.0
|
apelidoCLT = normaFederal ["decreto","lei"] [5452] 1 5 1943
| 59
|
apelidoCLT = normaFederal ["decreto","lei"] [5452] 1 5 1943
| 59
|
apelidoCLT = normaFederal ["decreto","lei"] [5452] 1 5 1943
| 59
| false
| false
| 1
| 6
| 7
| 30
| 14
| 16
| null | null |
ulricha/dsh
|
src/Database/DSH/SL/Opt/Rewrite/Projections.hs
|
bsd-3-clause
|
pullProjectUnboxDefaultLeft :: SLRule TExpr TExpr ()
pullProjectUnboxDefaultLeft q =
$(dagPatMatch 'q "(Project e (q1)) UnboxDefault d (q2)"
[| do
return $ do
logRewrite "Redundant.Project.UnboxDefault.Left" q
-- Employ projection expressions on top of the unboxing
-- operator, add right input columns.
let e' = partialEval $ appExprFst $(v "e")
unboxNode <- insert $ BinOp (UnboxDefault $(v "d")) $(v "q1") $(v "q2")
void $ replaceWithNew q $ UnOp (Project e') unboxNode |])
| 559
|
pullProjectUnboxDefaultLeft :: SLRule TExpr TExpr ()
pullProjectUnboxDefaultLeft q =
$(dagPatMatch 'q "(Project e (q1)) UnboxDefault d (q2)"
[| do
return $ do
logRewrite "Redundant.Project.UnboxDefault.Left" q
-- Employ projection expressions on top of the unboxing
-- operator, add right input columns.
let e' = partialEval $ appExprFst $(v "e")
unboxNode <- insert $ BinOp (UnboxDefault $(v "d")) $(v "q1") $(v "q2")
void $ replaceWithNew q $ UnOp (Project e') unboxNode |])
| 559
|
pullProjectUnboxDefaultLeft q =
$(dagPatMatch 'q "(Project e (q1)) UnboxDefault d (q2)"
[| do
return $ do
logRewrite "Redundant.Project.UnboxDefault.Left" q
-- Employ projection expressions on top of the unboxing
-- operator, add right input columns.
let e' = partialEval $ appExprFst $(v "e")
unboxNode <- insert $ BinOp (UnboxDefault $(v "d")) $(v "q1") $(v "q2")
void $ replaceWithNew q $ UnOp (Project e') unboxNode |])
| 506
| false
| true
| 1
| 8
| 152
| 42
| 20
| 22
| null | null |
danidiaz/checkpointed-pipeline
|
tests/tests.hs
|
mit
|
testfolder :: String
testfolder = "/tmp/_384sd9f9_checkpointed_tests_"
| 70
|
testfolder :: String
testfolder = "/tmp/_384sd9f9_checkpointed_tests_"
| 70
|
testfolder = "/tmp/_384sd9f9_checkpointed_tests_"
| 49
| false
| true
| 0
| 6
| 5
| 18
| 7
| 11
| null | null |
FranklinChen/hugs98-plus-Sep2006
|
packages/network/tests/URITest.hs
|
bsd-3-clause
|
testRFC33 = testRelJoin "testRFC33" rfcbase "../../../../g" "http://a/g"
| 72
|
testRFC33 = testRelJoin "testRFC33" rfcbase "../../../../g" "http://a/g"
| 72
|
testRFC33 = testRelJoin "testRFC33" rfcbase "../../../../g" "http://a/g"
| 72
| false
| false
| 1
| 5
| 6
| 20
| 7
| 13
| null | null |
rmies/tetris
|
Tetris/Controller.hs
|
bsd-3-clause
|
processKey _ tetronimo _ _ = tetronimo
| 38
|
processKey _ tetronimo _ _ = tetronimo
| 38
|
processKey _ tetronimo _ _ = tetronimo
| 38
| false
| false
| 0
| 5
| 6
| 15
| 7
| 8
| null | null |
roelvandijk/aeson
|
tests/UnitTests.hs
|
bsd-3-clause
|
jsonEncoding :: [Assertion]
jsonEncoding = [
assertEqual "Either Left" "{\"Left\":1}" $ encode (Left 1 :: Either Int Int)
, assertEqual "Either Right" "{\"Right\":1}" $ encode (Right 1 :: Either Int Int)
, assertEqual "Nothing" "null" $ encode (Nothing :: Maybe Int)
, assertEqual "Just" "1" $ encode (Just 1 :: Maybe Int)
, assertEqual "Just Nothing" "null" $ encode (Just Nothing :: Maybe (Maybe Int))
, assertEqual "Proxy Int" "null" $ encode (Proxy :: Proxy Int)
, assertEqual "Tagged Char Int" "1" $ encode (Tagged 1 :: Tagged Char Int)
, assertEqual "Const Char Int" "\"c\"" $ encode (Const 'c' :: Const Char Int)
, assertEqual "Tuple" "[1,2]" $ encode ((1, 2) :: (Int, Int))
, assertEqual "NonEmpty" "[1,2,3]" $ encode (1 :| [2, 3] :: NonEmpty Int)
, assertEqual "()" "[]" $ encode ()
]
| 821
|
jsonEncoding :: [Assertion]
jsonEncoding = [
assertEqual "Either Left" "{\"Left\":1}" $ encode (Left 1 :: Either Int Int)
, assertEqual "Either Right" "{\"Right\":1}" $ encode (Right 1 :: Either Int Int)
, assertEqual "Nothing" "null" $ encode (Nothing :: Maybe Int)
, assertEqual "Just" "1" $ encode (Just 1 :: Maybe Int)
, assertEqual "Just Nothing" "null" $ encode (Just Nothing :: Maybe (Maybe Int))
, assertEqual "Proxy Int" "null" $ encode (Proxy :: Proxy Int)
, assertEqual "Tagged Char Int" "1" $ encode (Tagged 1 :: Tagged Char Int)
, assertEqual "Const Char Int" "\"c\"" $ encode (Const 'c' :: Const Char Int)
, assertEqual "Tuple" "[1,2]" $ encode ((1, 2) :: (Int, Int))
, assertEqual "NonEmpty" "[1,2,3]" $ encode (1 :| [2, 3] :: NonEmpty Int)
, assertEqual "()" "[]" $ encode ()
]
| 821
|
jsonEncoding = [
assertEqual "Either Left" "{\"Left\":1}" $ encode (Left 1 :: Either Int Int)
, assertEqual "Either Right" "{\"Right\":1}" $ encode (Right 1 :: Either Int Int)
, assertEqual "Nothing" "null" $ encode (Nothing :: Maybe Int)
, assertEqual "Just" "1" $ encode (Just 1 :: Maybe Int)
, assertEqual "Just Nothing" "null" $ encode (Just Nothing :: Maybe (Maybe Int))
, assertEqual "Proxy Int" "null" $ encode (Proxy :: Proxy Int)
, assertEqual "Tagged Char Int" "1" $ encode (Tagged 1 :: Tagged Char Int)
, assertEqual "Const Char Int" "\"c\"" $ encode (Const 'c' :: Const Char Int)
, assertEqual "Tuple" "[1,2]" $ encode ((1, 2) :: (Int, Int))
, assertEqual "NonEmpty" "[1,2,3]" $ encode (1 :| [2, 3] :: NonEmpty Int)
, assertEqual "()" "[]" $ encode ()
]
| 793
| false
| true
| 0
| 12
| 163
| 329
| 163
| 166
| null | null |
shlevy/ghc
|
compiler/codeGen/StgCmmPrim.hs
|
bsd-3-clause
|
emitPrimOp dflags res (VecReadScalarByteArrayOp vcat n w) args = do
checkVecCompatibility dflags vcat n w
doIndexByteArrayOpAs Nothing vecty ty res args
where
vecty :: CmmType
vecty = vecVmmType vcat n w
ty :: CmmType
ty = vecCmmCat vcat w
| 266
|
emitPrimOp dflags res (VecReadScalarByteArrayOp vcat n w) args = do
checkVecCompatibility dflags vcat n w
doIndexByteArrayOpAs Nothing vecty ty res args
where
vecty :: CmmType
vecty = vecVmmType vcat n w
ty :: CmmType
ty = vecCmmCat vcat w
| 266
|
emitPrimOp dflags res (VecReadScalarByteArrayOp vcat n w) args = do
checkVecCompatibility dflags vcat n w
doIndexByteArrayOpAs Nothing vecty ty res args
where
vecty :: CmmType
vecty = vecVmmType vcat n w
ty :: CmmType
ty = vecCmmCat vcat w
| 266
| false
| false
| 1
| 8
| 65
| 106
| 43
| 63
| null | null |
acharal/hopes
|
src/frontend/ParseUtils.hs
|
gpl-2.0
|
mkTyp (L l t) = parseErrorWithLoc (spanBegin l) (text "Not a valid type")
| 73
|
mkTyp (L l t) = parseErrorWithLoc (spanBegin l) (text "Not a valid type")
| 73
|
mkTyp (L l t) = parseErrorWithLoc (spanBegin l) (text "Not a valid type")
| 73
| false
| false
| 0
| 7
| 12
| 34
| 16
| 18
| null | null |
metabrainz/musicbrainz-data-service
|
src/MusicBrainz/API/Url.hs
|
gpl-2.0
|
--------------------------------------------------------------------------------
findLatest :: Form Text MusicBrainz (Map.Map (Ref Url) (CoreEntity Url))
findLatest = Common.findLatest
| 184
|
findLatest :: Form Text MusicBrainz (Map.Map (Ref Url) (CoreEntity Url))
findLatest = Common.findLatest
| 103
|
findLatest = Common.findLatest
| 30
| true
| true
| 0
| 9
| 13
| 43
| 22
| 21
| null | null |
vikraman/ghc
|
compiler/utils/Outputable.hs
|
bsd-3-clause
|
userStyle _other = False
| 31
|
userStyle _other = False
| 31
|
userStyle _other = False
| 31
| false
| false
| 0
| 5
| 10
| 9
| 4
| 5
| null | null |
alokpndy/haskell-learn
|
src/monads/monadTMore.hs
|
mit
|
isValid :: String -> Bool
isValid = (>= 10) . length
| 52
|
isValid :: String -> Bool
isValid = (>= 10) . length
| 52
|
isValid = (>= 10) . length
| 26
| false
| true
| 0
| 6
| 10
| 23
| 13
| 10
| null | null |
beni55/text
|
Data/Text.hs
|
bsd-2-clause
|
-- | /O(n)/ Remove trailing white space from a string. Equivalent to:
--
-- > dropWhileEnd isSpace
stripEnd :: Text -> Text
stripEnd = dropWhileEnd isSpace
| 156
|
stripEnd :: Text -> Text
stripEnd = dropWhileEnd isSpace
| 56
|
stripEnd = dropWhileEnd isSpace
| 31
| true
| true
| 0
| 5
| 26
| 21
| 12
| 9
| null | null |
brendanhay/gogol
|
gogol-blogger/gen/Network/Google/Blogger/Types/Product.hs
|
mpl-2.0
|
-- | Creates a value of 'PostList' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'plEtag'
--
-- * 'plNextPageToken'
--
-- * 'plKind'
--
-- * 'plItems'
--
-- * 'plPrevPageToken'
postList
:: PostList
postList =
PostList'
{ _plEtag = Nothing
, _plNextPageToken = Nothing
, _plKind = Nothing
, _plItems = Nothing
, _plPrevPageToken = Nothing
}
| 456
|
postList
:: PostList
postList =
PostList'
{ _plEtag = Nothing
, _plNextPageToken = Nothing
, _plKind = Nothing
, _plItems = Nothing
, _plPrevPageToken = Nothing
}
| 192
|
postList =
PostList'
{ _plEtag = Nothing
, _plNextPageToken = Nothing
, _plKind = Nothing
, _plItems = Nothing
, _plPrevPageToken = Nothing
}
| 167
| true
| true
| 0
| 7
| 106
| 66
| 42
| 24
| null | null |
tomjaguarpaw/postgresql-simple
|
src/Database/PostgreSQL/Simple/TypeInfo/Static.hs
|
bsd-3-clause
|
array_jsonbOid :: Oid
array_jsonbOid = Oid 3807
| 47
|
array_jsonbOid :: Oid
array_jsonbOid = Oid 3807
| 47
|
array_jsonbOid = Oid 3807
| 25
| false
| true
| 0
| 5
| 6
| 14
| 7
| 7
| null | null |
tomwadeson/cis194
|
week12/Risk.hs
|
mit
|
success :: [Battlefield] -> Rand StdGen Double
success bfs = return $ fromIntegral attackerWins / fromIntegral (length bfs)
where
attackerWins = length . filter (== 0) . map defenders $ bfs
| 195
|
success :: [Battlefield] -> Rand StdGen Double
success bfs = return $ fromIntegral attackerWins / fromIntegral (length bfs)
where
attackerWins = length . filter (== 0) . map defenders $ bfs
| 195
|
success bfs = return $ fromIntegral attackerWins / fromIntegral (length bfs)
where
attackerWins = length . filter (== 0) . map defenders $ bfs
| 148
| false
| true
| 3
| 9
| 36
| 85
| 38
| 47
| null | null |
Deewiant/haschoo
|
Haschoo/Evaluator/Standard/Numeric.hs
|
bsd-3-clause
|
scmQuotRemMod :: (Integer -> Integer -> Integer) -> String
-> [ScmValue] -> ErrOr ScmValue
scmQuotRemMod f s [x,y] = do
(e1,a) <- asInt s x
(e2,b) <- asInt s y
return . (if e1 && e2 then ScmInt else ScmReal . fromInteger) $ f a b
| 252
|
scmQuotRemMod :: (Integer -> Integer -> Integer) -> String
-> [ScmValue] -> ErrOr ScmValue
scmQuotRemMod f s [x,y] = do
(e1,a) <- asInt s x
(e2,b) <- asInt s y
return . (if e1 && e2 then ScmInt else ScmReal . fromInteger) $ f a b
| 252
|
scmQuotRemMod f s [x,y] = do
(e1,a) <- asInt s x
(e2,b) <- asInt s y
return . (if e1 && e2 then ScmInt else ScmReal . fromInteger) $ f a b
| 147
| false
| true
| 0
| 12
| 68
| 129
| 65
| 64
| null | null |
uduki/hsQt
|
Qtc/Core/QDate.hs
|
bsd-2-clause
|
qDateShortDayName :: ((Int)) -> IO (String)
qDateShortDayName (x1)
= withStringResult $
qtc_QDate_shortDayName (toCInt x1)
| 128
|
qDateShortDayName :: ((Int)) -> IO (String)
qDateShortDayName (x1)
= withStringResult $
qtc_QDate_shortDayName (toCInt x1)
| 128
|
qDateShortDayName (x1)
= withStringResult $
qtc_QDate_shortDayName (toCInt x1)
| 84
| false
| true
| 0
| 8
| 19
| 46
| 24
| 22
| null | null |
randen/cabal
|
Cabal/Distribution/ParseUtils.hs
|
bsd-3-clause
|
parseFilePathQ :: ReadP r FilePath
parseFilePathQ = parseTokenQ
| 63
|
parseFilePathQ :: ReadP r FilePath
parseFilePathQ = parseTokenQ
| 63
|
parseFilePathQ = parseTokenQ
| 28
| false
| true
| 0
| 5
| 7
| 16
| 8
| 8
| null | null |
nerggnet/blog
|
_archive/Main-20170126.hs
|
bsd-3-clause
|
insertProject :: Project -> DB.Pipe -> IO ()
insertProject project pipe = do
DB.access pipe DB.master "projects" run
return ()
where
run = DB.insert "projects" (projectToDocument project)
| 197
|
insertProject :: Project -> DB.Pipe -> IO ()
insertProject project pipe = do
DB.access pipe DB.master "projects" run
return ()
where
run = DB.insert "projects" (projectToDocument project)
| 197
|
insertProject project pipe = do
DB.access pipe DB.master "projects" run
return ()
where
run = DB.insert "projects" (projectToDocument project)
| 152
| false
| true
| 0
| 8
| 36
| 76
| 35
| 41
| null | null |
ageldama/monad-transformer-basics
|
mtWithNewtype.hs
|
mit
|
-- 이렇게 deriving에 MonadState, MonadWriter을 추가해서, 직접 이 타입에
-- get, put, tell등 MonadState, MonadWriter으로 역할. 이거 없으면,
-- 그냥 lift을 명시적으로 해서 접근해야함.
--
-- SEE: http://stackoverflow.com/questions/18519774/monad-transformer-explicit-lifting
-- SEE: http://stackoverflow.com/a/18520161
appWithNewtypeLiftWriter a = AppWithNewtype $ lift $ a
| 333
|
appWithNewtypeLiftWriter a = AppWithNewtype $ lift $ a
| 54
|
appWithNewtypeLiftWriter a = AppWithNewtype $ lift $ a
| 54
| true
| false
| 0
| 6
| 41
| 23
| 14
| 9
| null | null |
olsner/ghc
|
compiler/utils/Outputable.hs
|
bsd-3-clause
|
renderWithStyle :: DynFlags -> SDoc -> PprStyle -> String
renderWithStyle dflags sdoc sty
= let s = Pretty.style{ Pretty.mode = PageMode,
Pretty.lineLength = pprCols dflags }
in Pretty.renderStyle s $ runSDoc sdoc (initSDocContext dflags sty)
| 274
|
renderWithStyle :: DynFlags -> SDoc -> PprStyle -> String
renderWithStyle dflags sdoc sty
= let s = Pretty.style{ Pretty.mode = PageMode,
Pretty.lineLength = pprCols dflags }
in Pretty.renderStyle s $ runSDoc sdoc (initSDocContext dflags sty)
| 274
|
renderWithStyle dflags sdoc sty
= let s = Pretty.style{ Pretty.mode = PageMode,
Pretty.lineLength = pprCols dflags }
in Pretty.renderStyle s $ runSDoc sdoc (initSDocContext dflags sty)
| 216
| false
| true
| 0
| 11
| 66
| 86
| 43
| 43
| null | null |
bartfrenk/jira-client
|
test/StateSpec.hs
|
bsd-3-clause
|
spec :: Spec
spec =
describe "toWorkLog" $ do
it "should keep the last item if it is a 'started' entry" $
forAll validLog $ \log -> not (null log) && isStarted (last log) ==>
let (_, rest) = toWorkLog log
in [last log] == rest
it "remaining event log items should be independent of prefix" $
forAll subsequentLogs $ \(p, q) ->
last p < last q ==> snd (toWorkLog $ p ++ q) == snd (toWorkLog q)
it "appending to a closed event log should give appended work logs" $
forAll subsequentLogs $ \(p, q) ->
not (isStarted (last p)) ==>
fst (toWorkLog p) ++ fst (toWorkLog q) == fst (toWorkLog $ p ++ q)
| 718
|
spec :: Spec
spec =
describe "toWorkLog" $ do
it "should keep the last item if it is a 'started' entry" $
forAll validLog $ \log -> not (null log) && isStarted (last log) ==>
let (_, rest) = toWorkLog log
in [last log] == rest
it "remaining event log items should be independent of prefix" $
forAll subsequentLogs $ \(p, q) ->
last p < last q ==> snd (toWorkLog $ p ++ q) == snd (toWorkLog q)
it "appending to a closed event log should give appended work logs" $
forAll subsequentLogs $ \(p, q) ->
not (isStarted (last p)) ==>
fst (toWorkLog p) ++ fst (toWorkLog q) == fst (toWorkLog $ p ++ q)
| 718
|
spec =
describe "toWorkLog" $ do
it "should keep the last item if it is a 'started' entry" $
forAll validLog $ \log -> not (null log) && isStarted (last log) ==>
let (_, rest) = toWorkLog log
in [last log] == rest
it "remaining event log items should be independent of prefix" $
forAll subsequentLogs $ \(p, q) ->
last p < last q ==> snd (toWorkLog $ p ++ q) == snd (toWorkLog q)
it "appending to a closed event log should give appended work logs" $
forAll subsequentLogs $ \(p, q) ->
not (isStarted (last p)) ==>
fst (toWorkLog p) ++ fst (toWorkLog q) == fst (toWorkLog $ p ++ q)
| 705
| false
| true
| 0
| 17
| 241
| 253
| 121
| 132
| null | null |
jaspervdj/firefly
|
src/Firefly/Audio/Sound.hs
|
bsd-3-clause
|
--------------------------------------------------------------------------------
-- | Load a sound sample from a file. Supported formats depend on your SDL_mixer
-- version, WAV is probably the safest bet, but OGG should also be fine.
soundFromFile :: FilePath -> IO Sound
soundFromFile filePath = do
ptr <- withCString filePath ff_soundFromFile
if ptr /= nullPtr
then Sound <$> newForeignPtr ff_soundFree ptr
else error $
"Firefly.Audio.Sound.soundFromFile: Can't load " ++ show filePath
--------------------------------------------------------------------------------
| 607
|
soundFromFile :: FilePath -> IO Sound
soundFromFile filePath = do
ptr <- withCString filePath ff_soundFromFile
if ptr /= nullPtr
then Sound <$> newForeignPtr ff_soundFree ptr
else error $
"Firefly.Audio.Sound.soundFromFile: Can't load " ++ show filePath
--------------------------------------------------------------------------------
| 372
|
soundFromFile filePath = do
ptr <- withCString filePath ff_soundFromFile
if ptr /= nullPtr
then Sound <$> newForeignPtr ff_soundFree ptr
else error $
"Firefly.Audio.Sound.soundFromFile: Can't load " ++ show filePath
--------------------------------------------------------------------------------
| 334
| true
| true
| 0
| 10
| 103
| 76
| 37
| 39
| null | null |
ml9951/ghc
|
compiler/cmm/CmmUtils.hs
|
bsd-3-clause
|
analRewBwd :: DataflowLattice f
-> BwdTransfer n f
-> BwdRewrite UniqSM n f
-> BwdPass UniqSM n f
analRewFwd lat xfer rew = FwdPass {fp_lattice = lat, fp_transfer = xfer, fp_rewrite = rew}
| 222
|
analRewBwd :: DataflowLattice f
-> BwdTransfer n f
-> BwdRewrite UniqSM n f
-> BwdPass UniqSM n f
analRewFwd lat xfer rew = FwdPass {fp_lattice = lat, fp_transfer = xfer, fp_rewrite = rew}
| 221
|
analRewFwd lat xfer rew = FwdPass {fp_lattice = lat, fp_transfer = xfer, fp_rewrite = rew}
| 90
| false
| true
| 0
| 8
| 66
| 72
| 37
| 35
| null | null |
HJvT/com
|
System/Win32/Com/Automation.hs
|
bsd-3-clause
|
methodID5 :: DISPID
-> [VarIn]
-> ArgOut a1 -> ArgOut a2 -> ArgOut a3
-> ArgOut a4 -> ArgOut a5
-> IDispatch i
-> IO (a1,a2,a3,a4,a5)
methodID5 dispid args (varin1,argres1) (varin2,argres2)
(varin3,argres3) (varin4,argres4)
(varin5,argres5) obj = do
p <- obj # invokeMethod dispid args [varin1,varin2,varin3,varin4,varin5]
unmarshallVariants5 argres1 argres2 argres3 argres4 argres5 p
| 485
|
methodID5 :: DISPID
-> [VarIn]
-> ArgOut a1 -> ArgOut a2 -> ArgOut a3
-> ArgOut a4 -> ArgOut a5
-> IDispatch i
-> IO (a1,a2,a3,a4,a5)
methodID5 dispid args (varin1,argres1) (varin2,argres2)
(varin3,argres3) (varin4,argres4)
(varin5,argres5) obj = do
p <- obj # invokeMethod dispid args [varin1,varin2,varin3,varin4,varin5]
unmarshallVariants5 argres1 argres2 argres3 argres4 argres5 p
| 485
|
methodID5 dispid args (varin1,argres1) (varin2,argres2)
(varin3,argres3) (varin4,argres4)
(varin5,argres5) obj = do
p <- obj # invokeMethod dispid args [varin1,varin2,varin3,varin4,varin5]
unmarshallVariants5 argres1 argres2 argres3 argres4 argres5 p
| 300
| false
| true
| 0
| 14
| 152
| 178
| 94
| 84
| null | null |
rueshyna/gogol
|
gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs
|
mpl-2.0
|
-- | Source application where creative was authored. Presently, only DBM
-- authored creatives will have this field set. Applicable to all creative
-- types.
creAuthoringSource :: Lens' Creative (Maybe CreativeAuthoringSource)
creAuthoringSource
= lens _creAuthoringSource
(\ s a -> s{_creAuthoringSource = a})
| 318
|
creAuthoringSource :: Lens' Creative (Maybe CreativeAuthoringSource)
creAuthoringSource
= lens _creAuthoringSource
(\ s a -> s{_creAuthoringSource = a})
| 160
|
creAuthoringSource
= lens _creAuthoringSource
(\ s a -> s{_creAuthoringSource = a})
| 91
| true
| true
| 0
| 8
| 49
| 51
| 27
| 24
| null | null |
da-x/lamdu
|
bottlelib/Graphics/UI/Bottle/WidgetsEnvT.hs
|
gpl-3.0
|
runWidgetEnvT ::
Monad m => Env -> WidgetEnvT m a -> m a
runWidgetEnvT env (WidgetEnvT action) = runReaderT action env
| 122
|
runWidgetEnvT ::
Monad m => Env -> WidgetEnvT m a -> m a
runWidgetEnvT env (WidgetEnvT action) = runReaderT action env
| 122
|
runWidgetEnvT env (WidgetEnvT action) = runReaderT action env
| 61
| false
| true
| 0
| 11
| 24
| 54
| 24
| 30
| null | null |
roldugin/LiveFusion
|
Data/LiveFusion/Loop/Expr.hs
|
bsd-3-clause
|
-- Even uglier, problematic in untyped exps
-------------------------------------------------------------------------------
-- * Dealing with Terms
-- | Shorthand for applying a 1-argument function to a var.
fun1 :: (Elt a, Elt b) => (Term a -> Term b) -> Var -> Expr
fun1 f x = (TermE (lam f)) `AppE` (VarE x)
| 312
|
fun1 :: (Elt a, Elt b) => (Term a -> Term b) -> Var -> Expr
fun1 f x = (TermE (lam f)) `AppE` (VarE x)
| 102
|
fun1 f x = (TermE (lam f)) `AppE` (VarE x)
| 42
| true
| true
| 0
| 10
| 51
| 86
| 44
| 42
| null | null |
ancientlanguage/haskell-analysis
|
grammar/src/Grammar/Common/Decompose.hs
|
mit
|
decomposeChar '\x1E69' = "\x0073\x0323\x0307"
| 45
|
decomposeChar '\x1E69' = "\x0073\x0323\x0307"
| 45
|
decomposeChar '\x1E69' = "\x0073\x0323\x0307"
| 45
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
brendanhay/gogol
|
gogol-translate/gen/Network/Google/Resource/Translate/Projects/GetSupportedLanguages.hs
|
mpl-2.0
|
-- | Creates a value of 'ProjectsGetSupportedLanguages' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'pgslParent'
--
-- * 'pgslXgafv'
--
-- * 'pgslUploadProtocol'
--
-- * 'pgslDisplayLanguageCode'
--
-- * 'pgslAccessToken'
--
-- * 'pgslUploadType'
--
-- * 'pgslModel'
--
-- * 'pgslCallback'
projectsGetSupportedLanguages
:: Text -- ^ 'pgslParent'
-> ProjectsGetSupportedLanguages
projectsGetSupportedLanguages pPgslParent_ =
ProjectsGetSupportedLanguages'
{ _pgslParent = pPgslParent_
, _pgslXgafv = Nothing
, _pgslUploadProtocol = Nothing
, _pgslDisplayLanguageCode = Nothing
, _pgslAccessToken = Nothing
, _pgslUploadType = Nothing
, _pgslModel = Nothing
, _pgslCallback = Nothing
}
| 818
|
projectsGetSupportedLanguages
:: Text -- ^ 'pgslParent'
-> ProjectsGetSupportedLanguages
projectsGetSupportedLanguages pPgslParent_ =
ProjectsGetSupportedLanguages'
{ _pgslParent = pPgslParent_
, _pgslXgafv = Nothing
, _pgslUploadProtocol = Nothing
, _pgslDisplayLanguageCode = Nothing
, _pgslAccessToken = Nothing
, _pgslUploadType = Nothing
, _pgslModel = Nothing
, _pgslCallback = Nothing
}
| 439
|
projectsGetSupportedLanguages pPgslParent_ =
ProjectsGetSupportedLanguages'
{ _pgslParent = pPgslParent_
, _pgslXgafv = Nothing
, _pgslUploadProtocol = Nothing
, _pgslDisplayLanguageCode = Nothing
, _pgslAccessToken = Nothing
, _pgslUploadType = Nothing
, _pgslModel = Nothing
, _pgslCallback = Nothing
}
| 342
| true
| true
| 0
| 7
| 152
| 97
| 64
| 33
| null | null |
ramirez7/configurator-applicative
|
examples/main.hs
|
bsd-3-clause
|
databaseConfigParser :: Parser DatabaseConfig
databaseConfigParser = fork (require "database.type" "rdbms | file | in-memory") $
[ ("rdbms" :: Text, RDBMS <$> require "database.user" "postgres user" <*> require "database.password" "postgres password")
, ("file", File <$> require "database.path" "relative path to where files should be stored")
, ("in-memory", pure InMemory)
]
| 385
|
databaseConfigParser :: Parser DatabaseConfig
databaseConfigParser = fork (require "database.type" "rdbms | file | in-memory") $
[ ("rdbms" :: Text, RDBMS <$> require "database.user" "postgres user" <*> require "database.password" "postgres password")
, ("file", File <$> require "database.path" "relative path to where files should be stored")
, ("in-memory", pure InMemory)
]
| 385
|
databaseConfigParser = fork (require "database.type" "rdbms | file | in-memory") $
[ ("rdbms" :: Text, RDBMS <$> require "database.user" "postgres user" <*> require "database.password" "postgres password")
, ("file", File <$> require "database.path" "relative path to where files should be stored")
, ("in-memory", pure InMemory)
]
| 339
| false
| true
| 0
| 10
| 56
| 89
| 47
| 42
| null | null |
peterbb/depend
|
src/Parser.hs
|
bsd-3-clause
|
parseAxiom :: Parser TopLevel
parseAxiom = do
T.reserved lexer "Axiom"
name <- T.identifier lexer
T.reservedOp lexer ":"
typ <- parseExpr
T.reservedOp lexer "."
return $ TopLevel name typ Nothing
| 219
|
parseAxiom :: Parser TopLevel
parseAxiom = do
T.reserved lexer "Axiom"
name <- T.identifier lexer
T.reservedOp lexer ":"
typ <- parseExpr
T.reservedOp lexer "."
return $ TopLevel name typ Nothing
| 219
|
parseAxiom = do
T.reserved lexer "Axiom"
name <- T.identifier lexer
T.reservedOp lexer ":"
typ <- parseExpr
T.reservedOp lexer "."
return $ TopLevel name typ Nothing
| 189
| false
| true
| 0
| 9
| 52
| 77
| 33
| 44
| null | null |
rahulmutt/ghcvm
|
compiler/Eta/TypeCheck/TcGenDeriv.hs
|
bsd-3-clause
|
-- One more than the precedence of the most
-- tightly-binding operator
getPrecedence :: (Name -> Fixity) -> Name -> Integer
getPrecedence get_fixity nm
= case get_fixity nm of
Fixity x _assoc -> fromIntegral x
-- NB: the Report says that associativity is not taken
-- into account for either Read or Show; hence we
-- ignore associativity here
{-
************************************************************************
* *
Data instances
* *
************************************************************************
From the data type
data T a b = T1 a b | T2
we generate
$cT1 = mkDataCon $dT "T1" Prefix
$cT2 = mkDataCon $dT "T2" Prefix
$dT = mkDataType "Module.T" [] [$con_T1, $con_T2]
-- the [] is for field labels.
instance (Data a, Data b) => Data (T a b) where
gfoldl k z (T1 a b) = z T `k` a `k` b
gfoldl k z T2 = z T2
-- ToDo: add gmapT,Q,M, gfoldr
gunfold k z c = case conIndex c of
I# 1# -> k (k (z T1))
I# 2# -> z T2
toConstr (T1 _ _) = $cT1
toConstr T2 = $cT2
dataTypeOf _ = $dT
dataCast1 = gcast1 -- If T :: * -> *
dataCast2 = gcast2 -- if T :: * -> * -> *
-}
| 1,398
|
getPrecedence :: (Name -> Fixity) -> Name -> Integer
getPrecedence get_fixity nm
= case get_fixity nm of
Fixity x _assoc -> fromIntegral x
-- NB: the Report says that associativity is not taken
-- into account for either Read or Show; hence we
-- ignore associativity here
{-
************************************************************************
* *
Data instances
* *
************************************************************************
From the data type
data T a b = T1 a b | T2
we generate
$cT1 = mkDataCon $dT "T1" Prefix
$cT2 = mkDataCon $dT "T2" Prefix
$dT = mkDataType "Module.T" [] [$con_T1, $con_T2]
-- the [] is for field labels.
instance (Data a, Data b) => Data (T a b) where
gfoldl k z (T1 a b) = z T `k` a `k` b
gfoldl k z T2 = z T2
-- ToDo: add gmapT,Q,M, gfoldr
gunfold k z c = case conIndex c of
I# 1# -> k (k (z T1))
I# 2# -> z T2
toConstr (T1 _ _) = $cT1
toConstr T2 = $cT2
dataTypeOf _ = $dT
dataCast1 = gcast1 -- If T :: * -> *
dataCast2 = gcast2 -- if T :: * -> * -> *
-}
| 1,323
|
getPrecedence get_fixity nm
= case get_fixity nm of
Fixity x _assoc -> fromIntegral x
-- NB: the Report says that associativity is not taken
-- into account for either Read or Show; hence we
-- ignore associativity here
{-
************************************************************************
* *
Data instances
* *
************************************************************************
From the data type
data T a b = T1 a b | T2
we generate
$cT1 = mkDataCon $dT "T1" Prefix
$cT2 = mkDataCon $dT "T2" Prefix
$dT = mkDataType "Module.T" [] [$con_T1, $con_T2]
-- the [] is for field labels.
instance (Data a, Data b) => Data (T a b) where
gfoldl k z (T1 a b) = z T `k` a `k` b
gfoldl k z T2 = z T2
-- ToDo: add gmapT,Q,M, gfoldr
gunfold k z c = case conIndex c of
I# 1# -> k (k (z T1))
I# 2# -> z T2
toConstr (T1 _ _) = $cT1
toConstr T2 = $cT2
dataTypeOf _ = $dT
dataCast1 = gcast1 -- If T :: * -> *
dataCast2 = gcast2 -- if T :: * -> * -> *
-}
| 1,270
| true
| true
| 0
| 8
| 528
| 62
| 32
| 30
| null | null |
NorfairKing/the-notes
|
src/Macro/Sets/Macro.hs
|
gpl-2.0
|
--[ Set difference
setdiffsign :: Note
setdiffsign = comm0 "setminus"
| 69
|
setdiffsign :: Note
setdiffsign = comm0 "setminus"
| 50
|
setdiffsign = comm0 "setminus"
| 30
| true
| true
| 0
| 6
| 9
| 21
| 9
| 12
| null | null |
onponomarev/ganeti
|
src/Ganeti/Query/Query.hs
|
bsd-2-clause
|
nameField _ = "name"
| 20
|
nameField _ = "name"
| 20
|
nameField _ = "name"
| 20
| false
| false
| 0
| 5
| 3
| 9
| 4
| 5
| null | null |
nathanic/hive-hs
|
src/Hive/Server/App.hs
|
gpl-3.0
|
readerServer :: Config -> Server API
readerServer cfg = enter transmonadify server
where
transmonadify :: AppM :~> ExceptT ServantErr IO
transmonadify = Nat (`runReaderT` cfg)
| 185
|
readerServer :: Config -> Server API
readerServer cfg = enter transmonadify server
where
transmonadify :: AppM :~> ExceptT ServantErr IO
transmonadify = Nat (`runReaderT` cfg)
| 185
|
readerServer cfg = enter transmonadify server
where
transmonadify :: AppM :~> ExceptT ServantErr IO
transmonadify = Nat (`runReaderT` cfg)
| 148
| false
| true
| 0
| 6
| 34
| 57
| 29
| 28
| null | null |
Raveline/lambdacula
|
test/SpecAction.hs
|
gpl-3.0
|
look = Transitive Examine "look" [] ["with"] False
| 50
|
look = Transitive Examine "look" [] ["with"] False
| 50
|
look = Transitive Examine "look" [] ["with"] False
| 50
| false
| false
| 1
| 6
| 7
| 26
| 11
| 15
| null | null |
ksaveljev/hake-2
|
src/Client/KeyConstants.hs
|
bsd-3-clause
|
kF3 = 137 :: Int
| 26
|
kF3 = 137 :: Int
| 26
|
kF3 = 137 :: Int
| 26
| false
| false
| 0
| 4
| 14
| 9
| 5
| 4
| null | null |
mcschroeder/ghc
|
compiler/typecheck/TcType.hs
|
bsd-3-clause
|
tcSplitForAllTy_maybe (ForAllTy tv ty) = Just (tv, ty)
| 54
|
tcSplitForAllTy_maybe (ForAllTy tv ty) = Just (tv, ty)
| 54
|
tcSplitForAllTy_maybe (ForAllTy tv ty) = Just (tv, ty)
| 54
| false
| false
| 0
| 7
| 7
| 26
| 13
| 13
| null | null |
geophf/1HaskellADay
|
exercises/HAD/Y2017/M11/D29/Exercise.hs
|
mit
|
insertPubsStmt :: Query
insertPubsStmt =
[sql|INSERT INTO recommendation_publish (source_article_id,recommended_article_id,rank)
VALUES (?,?,?)|]
| 156
|
insertPubsStmt :: Query
insertPubsStmt =
[sql|INSERT INTO recommendation_publish (source_article_id,recommended_article_id,rank)
VALUES (?,?,?)|]
| 156
|
insertPubsStmt =
[sql|INSERT INTO recommendation_publish (source_article_id,recommended_article_id,rank)
VALUES (?,?,?)|]
| 132
| false
| true
| 0
| 4
| 21
| 15
| 10
| 5
| null | null |
susoDominguez/eNominalTerms-Alpha
|
UnificationX.hs
|
unlicense
|
unif as sb fc (E (AppTrm f s) (AppTrm g t):xs) | f==g
= unif as sb fc (E s t:xs)
| 83
|
unif as sb fc (E (AppTrm f s) (AppTrm g t):xs) | f==g
= unif as sb fc (E s t:xs)
| 83
|
unif as sb fc (E (AppTrm f s) (AppTrm g t):xs) | f==g
= unif as sb fc (E s t:xs)
| 83
| false
| false
| 0
| 9
| 23
| 81
| 35
| 46
| null | null |
mietek/formal-logic
|
src/Pi/Mp.hs
|
mit
|
case' :: Tm tc (a :|| b) -> (Tm tc a -> Tm tc c) -> (Tm tc b -> Tm tc c) -> Tm tc c
case' xy f g = Match xy (\x -> f (var x)) (\y -> g (var y))
| 143
|
case' :: Tm tc (a :|| b) -> (Tm tc a -> Tm tc c) -> (Tm tc b -> Tm tc c) -> Tm tc c
case' xy f g = Match xy (\x -> f (var x)) (\y -> g (var y))
| 143
|
case' xy f g = Match xy (\x -> f (var x)) (\y -> g (var y))
| 59
| false
| true
| 0
| 10
| 43
| 122
| 60
| 62
| null | null |
input-output-hk/pos-haskell-prototype
|
db/src/Pos/DB/GState/Common.hs
|
mit
|
isInitialized :: MonadDBRead m => m Bool
isInitialized = do
(x :: Maybe ()) <- gsGetBi initKey
pure $ isJust x
-- | Marks gstate as initialized
| 152
|
isInitialized :: MonadDBRead m => m Bool
isInitialized = do
(x :: Maybe ()) <- gsGetBi initKey
pure $ isJust x
-- | Marks gstate as initialized
| 152
|
isInitialized = do
(x :: Maybe ()) <- gsGetBi initKey
pure $ isJust x
-- | Marks gstate as initialized
| 111
| false
| true
| 0
| 11
| 35
| 54
| 25
| 29
| null | null |
roelvandijk/aeson
|
Data/Aeson/TH.hs
|
bsd-3-clause
|
-- | Returns True if a Type has kind *.
hasKindStar :: Type -> Bool
hasKindStar VarT{} = True
| 101
|
hasKindStar :: Type -> Bool
hasKindStar VarT{} = True
| 61
|
hasKindStar VarT{} = True
| 33
| true
| true
| 0
| 6
| 26
| 23
| 12
| 11
| null | null |
roman/Haskell-Reactive-Extensions
|
rx-logger/test/Rx/Logger/TestCore.hs
|
mit
|
assertLogMsg :: ToLogMsg a => a -> LogEntry -> IO ()
assertLogMsg msg =
assertEqual "should have same message" (toLogMsg msg) . toLogMsg . _logEntryMsg
| 153
|
assertLogMsg :: ToLogMsg a => a -> LogEntry -> IO ()
assertLogMsg msg =
assertEqual "should have same message" (toLogMsg msg) . toLogMsg . _logEntryMsg
| 153
|
assertLogMsg msg =
assertEqual "should have same message" (toLogMsg msg) . toLogMsg . _logEntryMsg
| 100
| false
| true
| 0
| 10
| 26
| 59
| 26
| 33
| null | null |
gnn/Hets
|
CSL/InteractiveTests.hs
|
gpl-2.0
|
depClosure :: [String] -> [Named CMD] -> IO [[String]]
depClosure l ncl = do
let (asss, _) = splitAS ncl
gm = fmap analyzeGuarded asss
dr = getDependencyRelation gm
return $ relLayer dr l
-- | mark final
| 220
|
depClosure :: [String] -> [Named CMD] -> IO [[String]]
depClosure l ncl = do
let (asss, _) = splitAS ncl
gm = fmap analyzeGuarded asss
dr = getDependencyRelation gm
return $ relLayer dr l
-- | mark final
| 220
|
depClosure l ncl = do
let (asss, _) = splitAS ncl
gm = fmap analyzeGuarded asss
dr = getDependencyRelation gm
return $ relLayer dr l
-- | mark final
| 165
| false
| true
| 0
| 10
| 54
| 92
| 46
| 46
| null | null |
gcampax/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
int16TyConKey = mkPreludeTyConUnique 17
| 65
|
int16TyConKey = mkPreludeTyConUnique 17
| 65
|
int16TyConKey = mkPreludeTyConUnique 17
| 65
| false
| false
| 0
| 5
| 29
| 9
| 4
| 5
| null | null |
tibbe/ghc
|
compiler/llvmGen/LlvmCodeGen/CodeGen.hs
|
bsd-3-clause
|
genCall t@(PrimTarget (MO_BSwap w)) dsts args =
genCallSimpleCast w t dsts args
| 83
|
genCall t@(PrimTarget (MO_BSwap w)) dsts args =
genCallSimpleCast w t dsts args
| 83
|
genCall t@(PrimTarget (MO_BSwap w)) dsts args =
genCallSimpleCast w t dsts args
| 83
| false
| false
| 0
| 9
| 15
| 44
| 18
| 26
| null | null |
DavidAlphaFox/ghc
|
libraries/transformers/Data/Functor/Classes.hs
|
bsd-3-clause
|
-- | @'readsUnary1' n c n'@ matches the name of a unary data constructor
-- and then parses its argument using 'readsPrec1'.
readsUnary1 :: (Read1 f, Read a) => String -> (f a -> t) -> String -> ReadS t
readsUnary1 name cons kw s =
[(cons x,t) | kw == name, (x,t) <- readsPrec1 11 s]
| 287
|
readsUnary1 :: (Read1 f, Read a) => String -> (f a -> t) -> String -> ReadS t
readsUnary1 name cons kw s =
[(cons x,t) | kw == name, (x,t) <- readsPrec1 11 s]
| 162
|
readsUnary1 name cons kw s =
[(cons x,t) | kw == name, (x,t) <- readsPrec1 11 s]
| 84
| true
| true
| 0
| 10
| 60
| 108
| 54
| 54
| null | null |
sgraf812/feed-gipeda
|
app/Main.hs
|
bsd-3-clause
|
cmd :: Parser Command
cmd =
flag'
Check
(long "check"
<> help "Verify that the given config file is well-formed and exit")
<|>
Build
<$> option
(WatchForChanges . fromIntegral <$> auto)
(long "watch"
<> metavar "SECONDS"
<> value Once
<> help "Don't quit when done, watch the config file for changes and refetch watched repositories every SECONDS seconds and benchmark new commits.")
<*> option
(fromIntegral <$> auto)
(long "timeout"
<> metavar "SECONDS"
<> value (fromIntegral (30*60))
<> help "Timeout for a benchmark run. A slave is canceled if it needs more than SECONDS seconds. Defaults to 30 minutes.")
| 750
|
cmd :: Parser Command
cmd =
flag'
Check
(long "check"
<> help "Verify that the given config file is well-formed and exit")
<|>
Build
<$> option
(WatchForChanges . fromIntegral <$> auto)
(long "watch"
<> metavar "SECONDS"
<> value Once
<> help "Don't quit when done, watch the config file for changes and refetch watched repositories every SECONDS seconds and benchmark new commits.")
<*> option
(fromIntegral <$> auto)
(long "timeout"
<> metavar "SECONDS"
<> value (fromIntegral (30*60))
<> help "Timeout for a benchmark run. A slave is canceled if it needs more than SECONDS seconds. Defaults to 30 minutes.")
| 750
|
cmd =
flag'
Check
(long "check"
<> help "Verify that the given config file is well-formed and exit")
<|>
Build
<$> option
(WatchForChanges . fromIntegral <$> auto)
(long "watch"
<> metavar "SECONDS"
<> value Once
<> help "Don't quit when done, watch the config file for changes and refetch watched repositories every SECONDS seconds and benchmark new commits.")
<*> option
(fromIntegral <$> auto)
(long "timeout"
<> metavar "SECONDS"
<> value (fromIntegral (30*60))
<> help "Timeout for a benchmark run. A slave is canceled if it needs more than SECONDS seconds. Defaults to 30 minutes.")
| 728
| false
| true
| 9
| 13
| 237
| 150
| 70
| 80
| null | null |
kumar0ed/euler
|
5.hs
|
gpl-2.0
|
main=print$ foldl1 lcm [1..20]
| 30
|
main=print$ foldl1 lcm [1..20]
| 30
|
main=print$ foldl1 lcm [1..20]
| 30
| false
| false
| 1
| 7
| 3
| 24
| 10
| 14
| null | null |
mfine/ghc
|
compiler/main/DynFlags.hs
|
bsd-3-clause
|
intSuffixM :: (Int -> DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffixM fn = IntSuffix (\n -> updM (fn n))
| 125
|
intSuffixM :: (Int -> DynFlags -> DynP DynFlags) -> OptKind (CmdLineP DynFlags)
intSuffixM fn = IntSuffix (\n -> updM (fn n))
| 125
|
intSuffixM fn = IntSuffix (\n -> updM (fn n))
| 45
| false
| true
| 0
| 10
| 20
| 65
| 31
| 34
| null | null |
purcell/adventofcode2016
|
src/Day21.hs
|
bsd-3-clause
|
apply s (Reverse x y)
| y >= x =
let (pre, rest) = S.splitAt x s
(middle, end) = S.splitAt (y - x + 1) rest
in pre <> S.reverse middle <> end
| 159
|
apply s (Reverse x y)
| y >= x =
let (pre, rest) = S.splitAt x s
(middle, end) = S.splitAt (y - x + 1) rest
in pre <> S.reverse middle <> end
| 159
|
apply s (Reverse x y)
| y >= x =
let (pre, rest) = S.splitAt x s
(middle, end) = S.splitAt (y - x + 1) rest
in pre <> S.reverse middle <> end
| 159
| false
| false
| 0
| 13
| 51
| 97
| 47
| 50
| null | null |
Deewiant/haschoo
|
Haschoo/Evaluator.hs
|
bsd-3-clause
|
-- Programs consist of three things:
-- expressions - valid anywhere
-- definitions - valid at toplevel or at the beginning of a <body>
-- syntax definitions - valid at toplevel
--
-- Where <body> is a body of one of:
-- lambda, let, let*, letrec, let-syntax, letrec-syntax,
-- or procedure definition
--
-- Hence we need three eval functions (the following, evalBody, and eval) and
-- hence definitions are handled separately in the former two instead of being
-- ordinary primitives.
--
-- "begin" needs special treatment as well, since it depends on the evaluation
-- level (R5RS 5.1, 5.2.2). We special-case it here and in evalBody, leaving
-- ordinary expression usage to the definition given in R5RS 7.3.
evalToplevel :: [IORef Context] -> ScmValue -> IO (ErrOr ScmValue)
evalToplevel ctx = runHaschoo ctx . f
where
f (ScmList (ScmIdentifier i : xs))
| i == "define-syntax" = do
scmDefineSyntax xs
return ScmVoid
| i == "begin" = fmap last $ mapM f xs
f d = evalBody [d]
| 1,045
|
evalToplevel :: [IORef Context] -> ScmValue -> IO (ErrOr ScmValue)
evalToplevel ctx = runHaschoo ctx . f
where
f (ScmList (ScmIdentifier i : xs))
| i == "define-syntax" = do
scmDefineSyntax xs
return ScmVoid
| i == "begin" = fmap last $ mapM f xs
f d = evalBody [d]
| 304
|
evalToplevel ctx = runHaschoo ctx . f
where
f (ScmList (ScmIdentifier i : xs))
| i == "define-syntax" = do
scmDefineSyntax xs
return ScmVoid
| i == "begin" = fmap last $ mapM f xs
f d = evalBody [d]
| 237
| true
| true
| 0
| 10
| 238
| 148
| 76
| 72
| null | null |
sol/pandoc
|
src/pandoc.hs
|
gpl-2.0
|
err :: Int -> String -> IO a
err exitCode msg = do
name <- getProgName
UTF8.hPutStrLn stderr $ name ++ ": " ++ msg
exitWith $ ExitFailure exitCode
return undefined
| 171
|
err :: Int -> String -> IO a
err exitCode msg = do
name <- getProgName
UTF8.hPutStrLn stderr $ name ++ ": " ++ msg
exitWith $ ExitFailure exitCode
return undefined
| 171
|
err exitCode msg = do
name <- getProgName
UTF8.hPutStrLn stderr $ name ++ ": " ++ msg
exitWith $ ExitFailure exitCode
return undefined
| 142
| false
| true
| 0
| 11
| 38
| 70
| 31
| 39
| null | null |
hsyl20/ViperVM
|
haskus-system/src/lib/Haskus/Arch/X86_64/ISA/Immediate.hs
|
bsd-3-clause
|
-- | Constant immediate
immFamConst :: OperandSize -> Word64 -> X86ImmFamP
immFamConst s v = ImmFam
{ immFamSize = Terminal s
, immFamSignExtended = Terminal Nothing
, immFamValue = Terminal (Just v)
, immFamType = Terminal Nothing
}
| 271
|
immFamConst :: OperandSize -> Word64 -> X86ImmFamP
immFamConst s v = ImmFam
{ immFamSize = Terminal s
, immFamSignExtended = Terminal Nothing
, immFamValue = Terminal (Just v)
, immFamType = Terminal Nothing
}
| 247
|
immFamConst s v = ImmFam
{ immFamSize = Terminal s
, immFamSignExtended = Terminal Nothing
, immFamValue = Terminal (Just v)
, immFamType = Terminal Nothing
}
| 196
| true
| true
| 0
| 10
| 75
| 73
| 38
| 35
| null | null |
sinelaw/lamdu
|
Lamdu/Sugar/Convert/List.hs
|
gpl-3.0
|
nil ::
(Typeable1 m, MonadA m, Monoid a) =>
Expr.Apply (ExprMM m a) ->
PayloadMM m a ->
MaybeT (SugarM m) (ExpressionU m a)
nil app@(Expr.Apply funcI _) exprPl = do
specialFunctions <-
lift $ (^. SugarM.scSpecialFunctions) <$> SugarM.readContext
let
mkListActions exprS =
ListActions
{ addFirstItem = mkListAddFirstItem specialFunctions exprS
, replaceNil = ExprIRef.exprGuid <$> DataOps.setToHole exprS
}
guard $
Lens.anyOf ExprLens.exprDefinitionRef
(== Anchors.sfNil specialFunctions) funcI
(lift . SugarExpr.make exprPl . BodyList)
List
{ lValues = []
, lMActions = mkListActions <$> exprPl ^. SugarInfer.plStored
, lNilGuid = exprPl ^. SugarInfer.plGuid
}
<&> rPayload . plData <>~ app ^. Lens.traversed . Lens.traversed . SugarInfer.plData
| 825
|
nil ::
(Typeable1 m, MonadA m, Monoid a) =>
Expr.Apply (ExprMM m a) ->
PayloadMM m a ->
MaybeT (SugarM m) (ExpressionU m a)
nil app@(Expr.Apply funcI _) exprPl = do
specialFunctions <-
lift $ (^. SugarM.scSpecialFunctions) <$> SugarM.readContext
let
mkListActions exprS =
ListActions
{ addFirstItem = mkListAddFirstItem specialFunctions exprS
, replaceNil = ExprIRef.exprGuid <$> DataOps.setToHole exprS
}
guard $
Lens.anyOf ExprLens.exprDefinitionRef
(== Anchors.sfNil specialFunctions) funcI
(lift . SugarExpr.make exprPl . BodyList)
List
{ lValues = []
, lMActions = mkListActions <$> exprPl ^. SugarInfer.plStored
, lNilGuid = exprPl ^. SugarInfer.plGuid
}
<&> rPayload . plData <>~ app ^. Lens.traversed . Lens.traversed . SugarInfer.plData
| 825
|
nil app@(Expr.Apply funcI _) exprPl = do
specialFunctions <-
lift $ (^. SugarM.scSpecialFunctions) <$> SugarM.readContext
let
mkListActions exprS =
ListActions
{ addFirstItem = mkListAddFirstItem specialFunctions exprS
, replaceNil = ExprIRef.exprGuid <$> DataOps.setToHole exprS
}
guard $
Lens.anyOf ExprLens.exprDefinitionRef
(== Anchors.sfNil specialFunctions) funcI
(lift . SugarExpr.make exprPl . BodyList)
List
{ lValues = []
, lMActions = mkListActions <$> exprPl ^. SugarInfer.plStored
, lNilGuid = exprPl ^. SugarInfer.plGuid
}
<&> rPayload . plData <>~ app ^. Lens.traversed . Lens.traversed . SugarInfer.plData
| 693
| false
| true
| 26
| 8
| 183
| 179
| 106
| 73
| null | null |
glguy/ssh-hans
|
src/Network/SSH/Ciphers.hs
|
bsd-3-clause
|
------------------------------------------------------------------------
-- | Implementation of the cipher-auth mode specified in PROTOCOL.chacha20poly1305
cipher_chacha20_poly1305 :: Named Cipher
cipher_chacha20_poly1305 = Named "chacha20-poly1305@openssh.com" $
let mkCipherState CipherKeys{ckEncKey} = (payloadKey, lenKey)
where
(payloadKey', lenKey') = fmap (L.take chachaKeySize)
(L.splitAt chachaKeySize ckEncKey)
payloadKey = L.toStrict payloadKey'
lenKey = L.toStrict lenKey'
rounds = 20 -- chacha rounds
chachaKeySize = 32 -- key size for chacha algorithm
polyKeySize = 32 -- key size for poly1305 algorithm
discardSize = 32 -- aligns ciphertext to block counter 1
lenLen = 4 -- length of packet_len
macLen = 16 -- length of poly1305 mac
mkNonce = runPut . putWord64be . fromIntegral
getLen (_,lenKey) seqNr input_text = fromIntegral n + macLen
where
st = C.initialize rounds lenKey (mkNonce seqNr)
Right n = runGet getWord32be
$ fst
$ C.combine st input_text
dec ::
(S.ByteString,S.ByteString) {- ^ payload key, length key -} ->
Word32 {- ^ sequence number -} ->
S.ByteString {- ^ len_ct || body_ct || mac -} ->
((S.ByteString,S.ByteString), S.ByteString) {- ^ dummy || body_pt -}
dec st@(payloadKey,_) seqNr input_text
| constEq computed_mac expected_mac = (st, dummy_body_pt)
| otherwise = error "bad poly1305 tag"
where
nonce = mkNonce seqNr
dummy_len = S.replicate lenLen 0
dummy_body_pt = dummy_len <> body_pt
len_body_len = S.length input_text - macLen
(len_body_ct, expected_mac) = S.splitAt len_body_len input_text
computed_mac = Poly.auth polyKey len_body_ct
body_ct = S.drop lenLen len_body_ct
st0 = C.initialize rounds payloadKey nonce
(polyKey, st1) = C.generate st0 polyKeySize :: (S.ByteString, C.State)
(_discard, st2) = C.generate st1 discardSize :: (S.ByteString, C.State)
(body_pt , _ ) = C.combine st2 body_ct :: (S.ByteString, C.State)
enc ::
(S.ByteString,S.ByteString) {- ^ payload key, length key -} ->
Word32 {- ^ sequence number -} ->
S.ByteString {- ^ len_pt || body_pt -} ->
((S.ByteString,S.ByteString), S.ByteString) {- ^ len_ct || body_ct || mac -}
enc st@(payloadKey,lenKey) seqNr input_pt = (st, len_body_ct <> convert mac)
where
nonce = mkNonce seqNr
(len_pt, body_pt) = S.splitAt lenLen input_pt
(len_ct, _ ) = C.combine (C.initialize rounds lenKey nonce) len_pt
len_body_ct = len_ct <> body_ct
mac = Poly.auth polyKey len_body_ct
st0 = C.initialize rounds payloadKey nonce
(polyKey, st1) = C.generate st0 polyKeySize :: (S.ByteString, C.State)
(_discard, st2) = C.generate st1 discardSize :: (S.ByteString, C.State)
(body_ct , _ ) = C.combine st2 body_pt :: (S.ByteString, C.State)
in Cipher
{ blockSize = lenLen -- bytes needed to decrypt length field
, randomizePadding = True
, aeadMode = True
, encrypt = enc
, decrypt = dec
, cipherState = mkCipherState
, paddingSize = roundUp 8 . subtract lenLen
, getLength = getLen
}
| 3,858
|
cipher_chacha20_poly1305 :: Named Cipher
cipher_chacha20_poly1305 = Named "chacha20-poly1305@openssh.com" $
let mkCipherState CipherKeys{ckEncKey} = (payloadKey, lenKey)
where
(payloadKey', lenKey') = fmap (L.take chachaKeySize)
(L.splitAt chachaKeySize ckEncKey)
payloadKey = L.toStrict payloadKey'
lenKey = L.toStrict lenKey'
rounds = 20 -- chacha rounds
chachaKeySize = 32 -- key size for chacha algorithm
polyKeySize = 32 -- key size for poly1305 algorithm
discardSize = 32 -- aligns ciphertext to block counter 1
lenLen = 4 -- length of packet_len
macLen = 16 -- length of poly1305 mac
mkNonce = runPut . putWord64be . fromIntegral
getLen (_,lenKey) seqNr input_text = fromIntegral n + macLen
where
st = C.initialize rounds lenKey (mkNonce seqNr)
Right n = runGet getWord32be
$ fst
$ C.combine st input_text
dec ::
(S.ByteString,S.ByteString) {- ^ payload key, length key -} ->
Word32 {- ^ sequence number -} ->
S.ByteString {- ^ len_ct || body_ct || mac -} ->
((S.ByteString,S.ByteString), S.ByteString) {- ^ dummy || body_pt -}
dec st@(payloadKey,_) seqNr input_text
| constEq computed_mac expected_mac = (st, dummy_body_pt)
| otherwise = error "bad poly1305 tag"
where
nonce = mkNonce seqNr
dummy_len = S.replicate lenLen 0
dummy_body_pt = dummy_len <> body_pt
len_body_len = S.length input_text - macLen
(len_body_ct, expected_mac) = S.splitAt len_body_len input_text
computed_mac = Poly.auth polyKey len_body_ct
body_ct = S.drop lenLen len_body_ct
st0 = C.initialize rounds payloadKey nonce
(polyKey, st1) = C.generate st0 polyKeySize :: (S.ByteString, C.State)
(_discard, st2) = C.generate st1 discardSize :: (S.ByteString, C.State)
(body_pt , _ ) = C.combine st2 body_ct :: (S.ByteString, C.State)
enc ::
(S.ByteString,S.ByteString) {- ^ payload key, length key -} ->
Word32 {- ^ sequence number -} ->
S.ByteString {- ^ len_pt || body_pt -} ->
((S.ByteString,S.ByteString), S.ByteString) {- ^ len_ct || body_ct || mac -}
enc st@(payloadKey,lenKey) seqNr input_pt = (st, len_body_ct <> convert mac)
where
nonce = mkNonce seqNr
(len_pt, body_pt) = S.splitAt lenLen input_pt
(len_ct, _ ) = C.combine (C.initialize rounds lenKey nonce) len_pt
len_body_ct = len_ct <> body_ct
mac = Poly.auth polyKey len_body_ct
st0 = C.initialize rounds payloadKey nonce
(polyKey, st1) = C.generate st0 polyKeySize :: (S.ByteString, C.State)
(_discard, st2) = C.generate st1 discardSize :: (S.ByteString, C.State)
(body_ct , _ ) = C.combine st2 body_pt :: (S.ByteString, C.State)
in Cipher
{ blockSize = lenLen -- bytes needed to decrypt length field
, randomizePadding = True
, aeadMode = True
, encrypt = enc
, decrypt = dec
, cipherState = mkCipherState
, paddingSize = roundUp 8 . subtract lenLen
, getLength = getLen
}
| 3,701
|
cipher_chacha20_poly1305 = Named "chacha20-poly1305@openssh.com" $
let mkCipherState CipherKeys{ckEncKey} = (payloadKey, lenKey)
where
(payloadKey', lenKey') = fmap (L.take chachaKeySize)
(L.splitAt chachaKeySize ckEncKey)
payloadKey = L.toStrict payloadKey'
lenKey = L.toStrict lenKey'
rounds = 20 -- chacha rounds
chachaKeySize = 32 -- key size for chacha algorithm
polyKeySize = 32 -- key size for poly1305 algorithm
discardSize = 32 -- aligns ciphertext to block counter 1
lenLen = 4 -- length of packet_len
macLen = 16 -- length of poly1305 mac
mkNonce = runPut . putWord64be . fromIntegral
getLen (_,lenKey) seqNr input_text = fromIntegral n + macLen
where
st = C.initialize rounds lenKey (mkNonce seqNr)
Right n = runGet getWord32be
$ fst
$ C.combine st input_text
dec ::
(S.ByteString,S.ByteString) {- ^ payload key, length key -} ->
Word32 {- ^ sequence number -} ->
S.ByteString {- ^ len_ct || body_ct || mac -} ->
((S.ByteString,S.ByteString), S.ByteString) {- ^ dummy || body_pt -}
dec st@(payloadKey,_) seqNr input_text
| constEq computed_mac expected_mac = (st, dummy_body_pt)
| otherwise = error "bad poly1305 tag"
where
nonce = mkNonce seqNr
dummy_len = S.replicate lenLen 0
dummy_body_pt = dummy_len <> body_pt
len_body_len = S.length input_text - macLen
(len_body_ct, expected_mac) = S.splitAt len_body_len input_text
computed_mac = Poly.auth polyKey len_body_ct
body_ct = S.drop lenLen len_body_ct
st0 = C.initialize rounds payloadKey nonce
(polyKey, st1) = C.generate st0 polyKeySize :: (S.ByteString, C.State)
(_discard, st2) = C.generate st1 discardSize :: (S.ByteString, C.State)
(body_pt , _ ) = C.combine st2 body_ct :: (S.ByteString, C.State)
enc ::
(S.ByteString,S.ByteString) {- ^ payload key, length key -} ->
Word32 {- ^ sequence number -} ->
S.ByteString {- ^ len_pt || body_pt -} ->
((S.ByteString,S.ByteString), S.ByteString) {- ^ len_ct || body_ct || mac -}
enc st@(payloadKey,lenKey) seqNr input_pt = (st, len_body_ct <> convert mac)
where
nonce = mkNonce seqNr
(len_pt, body_pt) = S.splitAt lenLen input_pt
(len_ct, _ ) = C.combine (C.initialize rounds lenKey nonce) len_pt
len_body_ct = len_ct <> body_ct
mac = Poly.auth polyKey len_body_ct
st0 = C.initialize rounds payloadKey nonce
(polyKey, st1) = C.generate st0 polyKeySize :: (S.ByteString, C.State)
(_discard, st2) = C.generate st1 discardSize :: (S.ByteString, C.State)
(body_ct , _ ) = C.combine st2 body_pt :: (S.ByteString, C.State)
in Cipher
{ blockSize = lenLen -- bytes needed to decrypt length field
, randomizePadding = True
, aeadMode = True
, encrypt = enc
, decrypt = dec
, cipherState = mkCipherState
, paddingSize = roundUp 8 . subtract lenLen
, getLength = getLen
}
| 3,660
| true
| true
| 0
| 15
| 1,399
| 865
| 474
| 391
| null | null |
slpopejoy/fadno-xml
|
src/Fadno/MusicXml/MusicXml20.hs
|
bsd-2-clause
|
-- | Smart constructor for 'NotationsSlide'
mkNotationsSlide :: Slide -> ChxNotations
mkNotationsSlide a = NotationsSlide a
| 123
|
mkNotationsSlide :: Slide -> ChxNotations
mkNotationsSlide a = NotationsSlide a
| 79
|
mkNotationsSlide a = NotationsSlide a
| 37
| true
| true
| 0
| 7
| 15
| 27
| 12
| 15
| null | null |
siddhanathan/yi
|
yi-mode-haskell/src/Yi/Syntax/Paren.hs
|
gpl-2.0
|
isNoise :: Token -> Bool
isNoise (Special c) = c `elem` (";,`" :: String)
| 73
|
isNoise :: Token -> Bool
isNoise (Special c) = c `elem` (";,`" :: String)
| 73
|
isNoise (Special c) = c `elem` (";,`" :: String)
| 48
| false
| true
| 0
| 6
| 13
| 40
| 21
| 19
| null | null |
tjakway/ghcjvm
|
compiler/vectorise/Vectorise/Monad/Global.hs
|
bsd-3-clause
|
defTyCon :: TyCon -> TyCon -> VM ()
defTyCon tc tc' = defTyConName tc (tyConName tc') tc'
| 89
|
defTyCon :: TyCon -> TyCon -> VM ()
defTyCon tc tc' = defTyConName tc (tyConName tc') tc'
| 89
|
defTyCon tc tc' = defTyConName tc (tyConName tc') tc'
| 53
| false
| true
| 0
| 8
| 16
| 46
| 21
| 25
| null | null |
EchoTeam/harlson
|
Query.hs
|
bsd-2-clause
|
readLimit :: Handle -> IO QLimit
readLimit h =
QLimit <$> readString h <*> readString h <*> readInt h
| 105
|
readLimit :: Handle -> IO QLimit
readLimit h =
QLimit <$> readString h <*> readString h <*> readInt h
| 105
|
readLimit h =
QLimit <$> readString h <*> readString h <*> readInt h
| 72
| false
| true
| 0
| 8
| 22
| 42
| 19
| 23
| null | null |
mariefarrell/Hets
|
LF/Morphism.hs
|
gpl-2.0
|
{- converts the morphism into its canonical form where the symbol map contains
no key/value pairs of the form (s, Const s) -}
canForm :: Morphism -> Morphism
canForm (Morphism b m n sig1 sig2 k map1) =
let map2 = Map.fromList $ filter (\ (s, e) -> Const s /= e) $ Map.toList map1
in Morphism b m n sig1 sig2 k map2
| 325
|
canForm :: Morphism -> Morphism
canForm (Morphism b m n sig1 sig2 k map1) =
let map2 = Map.fromList $ filter (\ (s, e) -> Const s /= e) $ Map.toList map1
in Morphism b m n sig1 sig2 k map2
| 196
|
canForm (Morphism b m n sig1 sig2 k map1) =
let map2 = Map.fromList $ filter (\ (s, e) -> Const s /= e) $ Map.toList map1
in Morphism b m n sig1 sig2 k map2
| 164
| true
| true
| 0
| 15
| 74
| 102
| 51
| 51
| null | null |
shlevy/ghc
|
compiler/utils/Util.hs
|
bsd-3-clause
|
isIn msg x ys
= elem100 0 x ys
where
elem100 :: Eq a => Int -> a -> [a] -> Bool
elem100 _ _ [] = False
elem100 i x (y:ys)
| i > 100 = WARN(True, text ("Over-long elem in " ++ msg)) (x `elem` (y:ys))
| otherwise = x == y || elem100 (i + 1) x ys
| 271
|
isIn msg x ys
= elem100 0 x ys
where
elem100 :: Eq a => Int -> a -> [a] -> Bool
elem100 _ _ [] = False
elem100 i x (y:ys)
| i > 100 = WARN(True, text ("Over-long elem in " ++ msg)) (x `elem` (y:ys))
| otherwise = x == y || elem100 (i + 1) x ys
| 271
|
isIn msg x ys
= elem100 0 x ys
where
elem100 :: Eq a => Int -> a -> [a] -> Bool
elem100 _ _ [] = False
elem100 i x (y:ys)
| i > 100 = WARN(True, text ("Over-long elem in " ++ msg)) (x `elem` (y:ys))
| otherwise = x == y || elem100 (i + 1) x ys
| 271
| false
| false
| 1
| 10
| 88
| 160
| 81
| 79
| null | null |
fmapfmapfmap/amazonka
|
amazonka-swf/gen/Network/AWS/SWF/Types/Product.hs
|
mpl-2.0
|
-- | /Optional./ If set, specifies the policy to use for the child workflow
-- executions if the workflow execution being started is terminated by
-- calling the TerminateWorkflowExecution action explicitly or due to an
-- expired timeout. This policy overrides the default child policy
-- specified when registering the workflow type using RegisterWorkflowType.
--
-- The supported child policies are:
--
-- - __TERMINATE:__ the child executions will be terminated.
-- - __REQUEST_CANCEL:__ a request to cancel will be attempted for each
-- child execution by recording a 'WorkflowExecutionCancelRequested'
-- event in its history. It is up to the decider to take appropriate
-- actions when it receives an execution history with this event.
-- - __ABANDON:__ no action will be taken. The child executions will
-- continue to run.
--
-- A child policy for this workflow execution must be specified either as a
-- default for the workflow type or through this parameter. If neither this
-- parameter is set nor a default child policy was specified at
-- registration time then a fault will be returned.
scwedaChildPolicy :: Lens' StartChildWorkflowExecutionDecisionAttributes (Maybe ChildPolicy)
scwedaChildPolicy = lens _scwedaChildPolicy (\ s a -> s{_scwedaChildPolicy = a})
| 1,298
|
scwedaChildPolicy :: Lens' StartChildWorkflowExecutionDecisionAttributes (Maybe ChildPolicy)
scwedaChildPolicy = lens _scwedaChildPolicy (\ s a -> s{_scwedaChildPolicy = a})
| 173
|
scwedaChildPolicy = lens _scwedaChildPolicy (\ s a -> s{_scwedaChildPolicy = a})
| 80
| true
| true
| 0
| 9
| 218
| 65
| 44
| 21
| null | null |
vyorkin-archive/assignment
|
api/src/Validations.hs
|
mit
|
isPhone :: Text -> Bool
isPhone _ = True
| 40
|
isPhone :: Text -> Bool
isPhone _ = True
| 40
|
isPhone _ = True
| 16
| false
| true
| 0
| 5
| 8
| 18
| 9
| 9
| null | null |
philopon/find-hackage
|
src/Update.hs
|
mit
|
updater :: (Functor m, MonadThrow m, MonadIO m) => Maybe HTTPDate -> Request -> Manager -> m [(D.PackageDescription, UTCTime)]
updater snc baseReq mgr = do
hackage <- parseUrl "http://hackage.haskell.org/packages/recent.rss"
rss <- flip httpLbs mgr $ case snc of
Nothing -> hackage
Just t -> hackage { requestHeaders = ("If-Modified-Since", formatHTTPDate t) : requestHeaders hackage
, checkStatus = checkStatusP (\c -> (200 <= c && c < 300) || c == 304)
}
if responseStatus rss == status304
then return []
else case parse def $ (L.toStrict $ responseBody rss) of
Right doc -> do
upds <- filterM (\r -> isNewer baseReq r mgr) $ parseRecents doc
pds <- catMaybes `liftM` mapM (\r -> fmap (,recentTime r) <$> fetchCabalFile hackage mgr r) upds
CL.sourceList pds $$ StorePackage.sinkStoreElasticsearch 100 False H.empty baseReq mgr
return pds
Left _ -> return []
| 1,058
|
updater :: (Functor m, MonadThrow m, MonadIO m) => Maybe HTTPDate -> Request -> Manager -> m [(D.PackageDescription, UTCTime)]
updater snc baseReq mgr = do
hackage <- parseUrl "http://hackage.haskell.org/packages/recent.rss"
rss <- flip httpLbs mgr $ case snc of
Nothing -> hackage
Just t -> hackage { requestHeaders = ("If-Modified-Since", formatHTTPDate t) : requestHeaders hackage
, checkStatus = checkStatusP (\c -> (200 <= c && c < 300) || c == 304)
}
if responseStatus rss == status304
then return []
else case parse def $ (L.toStrict $ responseBody rss) of
Right doc -> do
upds <- filterM (\r -> isNewer baseReq r mgr) $ parseRecents doc
pds <- catMaybes `liftM` mapM (\r -> fmap (,recentTime r) <$> fetchCabalFile hackage mgr r) upds
CL.sourceList pds $$ StorePackage.sinkStoreElasticsearch 100 False H.empty baseReq mgr
return pds
Left _ -> return []
| 1,058
|
updater snc baseReq mgr = do
hackage <- parseUrl "http://hackage.haskell.org/packages/recent.rss"
rss <- flip httpLbs mgr $ case snc of
Nothing -> hackage
Just t -> hackage { requestHeaders = ("If-Modified-Since", formatHTTPDate t) : requestHeaders hackage
, checkStatus = checkStatusP (\c -> (200 <= c && c < 300) || c == 304)
}
if responseStatus rss == status304
then return []
else case parse def $ (L.toStrict $ responseBody rss) of
Right doc -> do
upds <- filterM (\r -> isNewer baseReq r mgr) $ parseRecents doc
pds <- catMaybes `liftM` mapM (\r -> fmap (,recentTime r) <$> fetchCabalFile hackage mgr r) upds
CL.sourceList pds $$ StorePackage.sinkStoreElasticsearch 100 False H.empty baseReq mgr
return pds
Left _ -> return []
| 931
| false
| true
| 0
| 23
| 336
| 363
| 176
| 187
| null | null |
dsabel/stmshf
|
Control/Concurrent/SHFSTM.hs
|
bsd-3-clause
|
performSTM tlog act =
case act of
Return a -> do
commit tlog
return a
Retry -> do
#ifdef DEBUG
mid <- myThreadId
sPutStrLn ((show mid) ++ "USERDEFINED RETRY")
#endif
waitForExternalRetry -- forever until a retry-exception is received
NewTVar x cont -> do
tv <- newTVarWithLog tlog x
performSTM tlog (cont tv)
ReadTVar x cont -> do
res <- readTVarWithLog tlog x
performSTM tlog (cont res)
WriteTVar v x cont -> do
writeTVarWithLog tlog v x
performSTM tlog cont
OrElse act1 act2 cont -> do
orElseWithLog tlog -- adjust for left orElse
resl <- performOrElseLeft tlog act1
case resl of
Just a -> performSTM tlog (cont a)
Nothing -> do
orRetryWithLog tlog
performSTM tlog (act2 >>= cont)
| 1,197
|
performSTM tlog act =
case act of
Return a -> do
commit tlog
return a
Retry -> do
#ifdef DEBUG
mid <- myThreadId
sPutStrLn ((show mid) ++ "USERDEFINED RETRY")
#endif
waitForExternalRetry -- forever until a retry-exception is received
NewTVar x cont -> do
tv <- newTVarWithLog tlog x
performSTM tlog (cont tv)
ReadTVar x cont -> do
res <- readTVarWithLog tlog x
performSTM tlog (cont res)
WriteTVar v x cont -> do
writeTVarWithLog tlog v x
performSTM tlog cont
OrElse act1 act2 cont -> do
orElseWithLog tlog -- adjust for left orElse
resl <- performOrElseLeft tlog act1
case resl of
Just a -> performSTM tlog (cont a)
Nothing -> do
orRetryWithLog tlog
performSTM tlog (act2 >>= cont)
| 1,197
|
performSTM tlog act =
case act of
Return a -> do
commit tlog
return a
Retry -> do
#ifdef DEBUG
mid <- myThreadId
sPutStrLn ((show mid) ++ "USERDEFINED RETRY")
#endif
waitForExternalRetry -- forever until a retry-exception is received
NewTVar x cont -> do
tv <- newTVarWithLog tlog x
performSTM tlog (cont tv)
ReadTVar x cont -> do
res <- readTVarWithLog tlog x
performSTM tlog (cont res)
WriteTVar v x cont -> do
writeTVarWithLog tlog v x
performSTM tlog cont
OrElse act1 act2 cont -> do
orElseWithLog tlog -- adjust for left orElse
resl <- performOrElseLeft tlog act1
case resl of
Just a -> performSTM tlog (cont a)
Nothing -> do
orRetryWithLog tlog
performSTM tlog (act2 >>= cont)
| 1,197
| false
| false
| 0
| 17
| 631
| 266
| 117
| 149
| null | null |
vikraman/ghc
|
libraries/base/Data/Data.hs
|
bsd-3-clause
|
decidedUnpackConstr :: Constr
decidedUnpackConstr
= mkConstr decidedStrictnessDataType "DecidedUnpack" [] Prefix
| 114
|
decidedUnpackConstr :: Constr
decidedUnpackConstr
= mkConstr decidedStrictnessDataType "DecidedUnpack" [] Prefix
| 114
|
decidedUnpackConstr
= mkConstr decidedStrictnessDataType "DecidedUnpack" [] Prefix
| 84
| false
| true
| 0
| 6
| 11
| 26
| 11
| 15
| null | null |
danr/hipspec
|
examples/old-examples/quickspec/ZenoLists.hs
|
gpl-3.0
|
otherwise = True
| 16
|
otherwise = True
| 16
|
otherwise = True
| 16
| false
| false
| 0
| 4
| 2
| 6
| 3
| 3
| null | null |
DougBurke/swish
|
tests/RDFDatatypeXsdIntegerTest.hs
|
lgpl-2.1
|
testVarModifyPower07 = testVmod3 "testVarModifyPower07"
(getDTMod dmodXsdIntegerPower rdfDatatypeValXsdInteger)
[makeBVI [("b","-2"),("c","3")]]
[makeBVI [("a","-8"),("b","-2"),("c","3")]]
| 249
|
testVarModifyPower07 = testVmod3 "testVarModifyPower07"
(getDTMod dmodXsdIntegerPower rdfDatatypeValXsdInteger)
[makeBVI [("b","-2"),("c","3")]]
[makeBVI [("a","-8"),("b","-2"),("c","3")]]
| 249
|
testVarModifyPower07 = testVmod3 "testVarModifyPower07"
(getDTMod dmodXsdIntegerPower rdfDatatypeValXsdInteger)
[makeBVI [("b","-2"),("c","3")]]
[makeBVI [("a","-8"),("b","-2"),("c","3")]]
| 249
| false
| false
| 0
| 9
| 71
| 80
| 47
| 33
| null | null |
PIWEEK/halisp
|
src/Core.hs
|
gpl-3.0
|
isBoolean _ = Bool False
| 24
|
isBoolean _ = Bool False
| 24
|
isBoolean _ = Bool False
| 24
| false
| false
| 0
| 4
| 4
| 13
| 5
| 8
| null | null |
andreagenso/java2scala
|
src/J2s/Parser.hs
|
apache-2.0
|
-- pTypeParameters = AGS.sem_TypeParameters_TypeParameters <$ pOperator "<" <*> pTypeParameterList <* pOperator ">"
-- <|> pSucceed AGS.sem_TypeParameters_NilTypeParameters
pTypeParameters = (\pl f -> f pl) <$ pOperator "<" <*> pTypeParameterList <*> pTypeParameters'
<|> pSucceed AGS.sem_TypeParameters_NilTypeParameters
| 376
|
pTypeParameters = (\pl f -> f pl) <$ pOperator "<" <*> pTypeParameterList <*> pTypeParameters'
<|> pSucceed AGS.sem_TypeParameters_NilTypeParameters
| 176
|
pTypeParameters = (\pl f -> f pl) <$ pOperator "<" <*> pTypeParameterList <*> pTypeParameters'
<|> pSucceed AGS.sem_TypeParameters_NilTypeParameters
| 176
| true
| false
| 4
| 10
| 87
| 51
| 25
| 26
| null | null |
gorkinovich/Haskell
|
Modules/MathUtil.hs
|
mit
|
getSortedDivisorsFromFactors :: (Integral a) => [a] -> [a]
getSortedDivisorsFromFactors lst = List.sort victims
where victims = getDivisorsFromFactors lst
-- Gets the divisors of a number from a factors list.
| 213
|
getSortedDivisorsFromFactors :: (Integral a) => [a] -> [a]
getSortedDivisorsFromFactors lst = List.sort victims
where victims = getDivisorsFromFactors lst
-- Gets the divisors of a number from a factors list.
| 213
|
getSortedDivisorsFromFactors lst = List.sort victims
where victims = getDivisorsFromFactors lst
-- Gets the divisors of a number from a factors list.
| 154
| false
| true
| 0
| 7
| 33
| 50
| 26
| 24
| null | null |
coreyoconnor/bind-marshal
|
test/verify_desaction_static_loops.hs
|
bsd-3-clause
|
des_flv_header_1k = static_replicateM (undefined :: D1000) des_flv_header
| 73
|
des_flv_header_1k = static_replicateM (undefined :: D1000) des_flv_header
| 73
|
des_flv_header_1k = static_replicateM (undefined :: D1000) des_flv_header
| 73
| false
| false
| 0
| 6
| 6
| 17
| 9
| 8
| null | null |
AlexanderPankiv/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
uIntTyConName = tcQual gHC_GENERICS (fsLit "UInt") uIntTyConKey
| 68
|
uIntTyConName = tcQual gHC_GENERICS (fsLit "UInt") uIntTyConKey
| 68
|
uIntTyConName = tcQual gHC_GENERICS (fsLit "UInt") uIntTyConKey
| 68
| false
| false
| 0
| 7
| 11
| 19
| 9
| 10
| null | null |
spechub/Hets
|
LF/Parse.hs
|
gpl-2.0
|
basicSpec :: PrefixMap -> AParser st BASIC_SPEC
basicSpec _ =
fmap Basic_spec (trailingAnnosParser basicItem)
<|>
(oBraceT >> cBraceT >> return (Basic_spec []))
| 166
|
basicSpec :: PrefixMap -> AParser st BASIC_SPEC
basicSpec _ =
fmap Basic_spec (trailingAnnosParser basicItem)
<|>
(oBraceT >> cBraceT >> return (Basic_spec []))
| 166
|
basicSpec _ =
fmap Basic_spec (trailingAnnosParser basicItem)
<|>
(oBraceT >> cBraceT >> return (Basic_spec []))
| 118
| false
| true
| 3
| 11
| 27
| 64
| 31
| 33
| null | null |
schell/ghci-ng
|
ghc/GhciMonad.hs
|
bsd-3-clause
|
recordBreak :: BreakLocation -> GHCi (Bool{- was already present -}, Int)
recordBreak brkLoc = do
st <- getGHCiState
let oldActiveBreaks = breaks st
-- don't store the same break point twice
case [ nm | (nm, loc) <- oldActiveBreaks, loc == brkLoc ] of
(nm:_) -> return (True, nm)
[] -> do
let oldCounter = break_ctr st
newCounter = oldCounter + 1
setGHCiState $ st { break_ctr = newCounter,
breaks = (oldCounter, brkLoc) : oldActiveBreaks
}
return (False, oldCounter)
| 567
|
recordBreak :: BreakLocation -> GHCi (Bool{- was already present -}, Int)
recordBreak brkLoc = do
st <- getGHCiState
let oldActiveBreaks = breaks st
-- don't store the same break point twice
case [ nm | (nm, loc) <- oldActiveBreaks, loc == brkLoc ] of
(nm:_) -> return (True, nm)
[] -> do
let oldCounter = break_ctr st
newCounter = oldCounter + 1
setGHCiState $ st { break_ctr = newCounter,
breaks = (oldCounter, brkLoc) : oldActiveBreaks
}
return (False, oldCounter)
| 567
|
recordBreak brkLoc = do
st <- getGHCiState
let oldActiveBreaks = breaks st
-- don't store the same break point twice
case [ nm | (nm, loc) <- oldActiveBreaks, loc == brkLoc ] of
(nm:_) -> return (True, nm)
[] -> do
let oldCounter = break_ctr st
newCounter = oldCounter + 1
setGHCiState $ st { break_ctr = newCounter,
breaks = (oldCounter, brkLoc) : oldActiveBreaks
}
return (False, oldCounter)
| 493
| false
| true
| 0
| 18
| 178
| 180
| 92
| 88
| null | null |
kim/amazonka
|
amazonka-cognito-identity/gen/Network/AWS/CognitoIdentity/ListIdentities.hs
|
mpl-2.0
|
-- | A pagination token.
lirNextToken :: Lens' ListIdentitiesResponse (Maybe Text)
lirNextToken = lens _lirNextToken (\s a -> s { _lirNextToken = a })
| 150
|
lirNextToken :: Lens' ListIdentitiesResponse (Maybe Text)
lirNextToken = lens _lirNextToken (\s a -> s { _lirNextToken = a })
| 125
|
lirNextToken = lens _lirNextToken (\s a -> s { _lirNextToken = a })
| 67
| true
| true
| 0
| 9
| 23
| 46
| 25
| 21
| null | null |
lukexi/ghc-7.8-arm64
|
compiler/utils/ExtsCompat46.hs
|
bsd-3-clause
|
leFloat# :: Float# -> Float# -> Bool
leFloat# a b = isTrue# (a `E.leFloat#` b)
| 78
|
leFloat# :: Float# -> Float# -> Bool
leFloat# a b = isTrue# (a `E.leFloat#` b)
| 78
|
leFloat# a b = isTrue# (a `E.leFloat#` b)
| 41
| false
| true
| 0
| 8
| 14
| 43
| 21
| 22
| null | null |
olorin/amazonka
|
core/src/Network/AWS/Data/Body.hs
|
mpl-2.0
|
chunkedLength :: Lens' ChunkedBody Integer
chunkedLength = lens _chunkedLength (\s a -> s { _chunkedLength = a })
| 113
|
chunkedLength :: Lens' ChunkedBody Integer
chunkedLength = lens _chunkedLength (\s a -> s { _chunkedLength = a })
| 113
|
chunkedLength = lens _chunkedLength (\s a -> s { _chunkedLength = a })
| 70
| false
| true
| 0
| 9
| 17
| 39
| 21
| 18
| null | null |
ezyang/ghc
|
compiler/stgSyn/CoreToStg.hs
|
bsd-3-clause
|
coreTopBindToStg dflags this_mod env body_fvs (Rec pairs)
= ASSERT( not (null pairs) )
let
binders = map fst pairs
extra_env' = [ (b, LetBound TopLet $! manifestArity rhs)
| (b, rhs) <- pairs ]
env' = extendVarEnvList env extra_env'
(stg_rhss, fvs')
= initCts env' $ do
(stg_rhss, fvss') <- mapAndUnzipM (coreToTopStgRhs dflags this_mod body_fvs) pairs
let fvs' = unionFVInfos fvss'
return (stg_rhss, fvs')
bind = StgTopLifted $ StgRec (zip binders stg_rhss)
in
ASSERT2(consistentCafInfo (head binders) bind, ppr binders)
(env', fvs' `unionFVInfo` body_fvs, bind)
| 700
|
coreTopBindToStg dflags this_mod env body_fvs (Rec pairs)
= ASSERT( not (null pairs) )
let
binders = map fst pairs
extra_env' = [ (b, LetBound TopLet $! manifestArity rhs)
| (b, rhs) <- pairs ]
env' = extendVarEnvList env extra_env'
(stg_rhss, fvs')
= initCts env' $ do
(stg_rhss, fvss') <- mapAndUnzipM (coreToTopStgRhs dflags this_mod body_fvs) pairs
let fvs' = unionFVInfos fvss'
return (stg_rhss, fvs')
bind = StgTopLifted $ StgRec (zip binders stg_rhss)
in
ASSERT2(consistentCafInfo (head binders) bind, ppr binders)
(env', fvs' `unionFVInfo` body_fvs, bind)
| 700
|
coreTopBindToStg dflags this_mod env body_fvs (Rec pairs)
= ASSERT( not (null pairs) )
let
binders = map fst pairs
extra_env' = [ (b, LetBound TopLet $! manifestArity rhs)
| (b, rhs) <- pairs ]
env' = extendVarEnvList env extra_env'
(stg_rhss, fvs')
= initCts env' $ do
(stg_rhss, fvss') <- mapAndUnzipM (coreToTopStgRhs dflags this_mod body_fvs) pairs
let fvs' = unionFVInfos fvss'
return (stg_rhss, fvs')
bind = StgTopLifted $ StgRec (zip binders stg_rhss)
in
ASSERT2(consistentCafInfo (head binders) bind, ppr binders)
(env', fvs' `unionFVInfo` body_fvs, bind)
| 700
| false
| false
| 0
| 16
| 219
| 235
| 119
| 116
| null | null |
norm2782/uuagc
|
src-generated/PrintCode.hs
|
bsd-3-clause
|
sem_Decl_Bind :: T_Lhs -> T_Expr -> T_Decl
sem_Decl_Bind arg_left_ arg_rhs_ = T_Decl (return st20) where
{-# NOINLINE st20 #-}
!st20 = let
v19 :: T_Decl_v19
v19 = \ !(T_Decl_vIn19 _lhsIisDeclOfLet _lhsInested _lhsIoptions _lhsIoutputfile) -> ( let
_leftX32 = Control.Monad.Identity.runIdentity (attach_T_Lhs (arg_left_))
_rhsX26 = Control.Monad.Identity.runIdentity (attach_T_Expr (arg_rhs_))
(T_Lhs_vOut31 _leftIpp) = inv_Lhs_s32 _leftX32 (T_Lhs_vIn31 _leftOisDeclOfLet _leftOnested _leftOoptions _leftOoutputfile)
(T_Expr_vOut25 _rhsIpp) = inv_Expr_s26 _rhsX26 (T_Expr_vIn25 _rhsOnested _rhsOoptions _rhsOoutputfile)
_lhsOpp :: PP_Doc
_lhsOpp = rule101 _leftIpp _rhsIpp
_leftOisDeclOfLet = rule102 _lhsIisDeclOfLet
_leftOnested = rule103 _lhsInested
_leftOoptions = rule104 _lhsIoptions
_leftOoutputfile = rule105 _lhsIoutputfile
_rhsOnested = rule106 _lhsInested
_rhsOoptions = rule107 _lhsIoptions
_rhsOoutputfile = rule108 _lhsIoutputfile
!__result_ = T_Decl_vOut19 _lhsOpp
in __result_ )
in C_Decl_s20 v19
{-# INLINE rule101 #-}
{-# LINE 108 "./src-ag/PrintCode.ag" #-}
rule101 = \ ((_leftIpp) :: PP_Doc) ((_rhsIpp) :: PP_Doc) ->
{-# LINE 108 "./src-ag/PrintCode.ag" #-}
_leftIpp >#< "<-" >#< _rhsIpp
{-# LINE 1030 "dist/build/PrintCode.hs"#-}
{-# INLINE rule102 #-}
rule102 = \ ((_lhsIisDeclOfLet) :: Bool) ->
_lhsIisDeclOfLet
{-# INLINE rule103 #-}
rule103 = \ ((_lhsInested) :: Bool) ->
_lhsInested
{-# INLINE rule104 #-}
rule104 = \ ((_lhsIoptions) :: Options) ->
_lhsIoptions
{-# INLINE rule105 #-}
rule105 = \ ((_lhsIoutputfile) :: String) ->
_lhsIoutputfile
{-# INLINE rule106 #-}
rule106 = \ ((_lhsInested) :: Bool) ->
_lhsInested
{-# INLINE rule107 #-}
rule107 = \ ((_lhsIoptions) :: Options) ->
_lhsIoptions
{-# INLINE rule108 #-}
rule108 = \ ((_lhsIoutputfile) :: String) ->
_lhsIoutputfile
| 2,149
|
sem_Decl_Bind :: T_Lhs -> T_Expr -> T_Decl
sem_Decl_Bind arg_left_ arg_rhs_ = T_Decl (return st20) where
{-# NOINLINE st20 #-}
!st20 = let
v19 :: T_Decl_v19
v19 = \ !(T_Decl_vIn19 _lhsIisDeclOfLet _lhsInested _lhsIoptions _lhsIoutputfile) -> ( let
_leftX32 = Control.Monad.Identity.runIdentity (attach_T_Lhs (arg_left_))
_rhsX26 = Control.Monad.Identity.runIdentity (attach_T_Expr (arg_rhs_))
(T_Lhs_vOut31 _leftIpp) = inv_Lhs_s32 _leftX32 (T_Lhs_vIn31 _leftOisDeclOfLet _leftOnested _leftOoptions _leftOoutputfile)
(T_Expr_vOut25 _rhsIpp) = inv_Expr_s26 _rhsX26 (T_Expr_vIn25 _rhsOnested _rhsOoptions _rhsOoutputfile)
_lhsOpp :: PP_Doc
_lhsOpp = rule101 _leftIpp _rhsIpp
_leftOisDeclOfLet = rule102 _lhsIisDeclOfLet
_leftOnested = rule103 _lhsInested
_leftOoptions = rule104 _lhsIoptions
_leftOoutputfile = rule105 _lhsIoutputfile
_rhsOnested = rule106 _lhsInested
_rhsOoptions = rule107 _lhsIoptions
_rhsOoutputfile = rule108 _lhsIoutputfile
!__result_ = T_Decl_vOut19 _lhsOpp
in __result_ )
in C_Decl_s20 v19
{-# INLINE rule101 #-}
{-# LINE 108 "./src-ag/PrintCode.ag" #-}
rule101 = \ ((_leftIpp) :: PP_Doc) ((_rhsIpp) :: PP_Doc) ->
{-# LINE 108 "./src-ag/PrintCode.ag" #-}
_leftIpp >#< "<-" >#< _rhsIpp
{-# LINE 1030 "dist/build/PrintCode.hs"#-}
{-# INLINE rule102 #-}
rule102 = \ ((_lhsIisDeclOfLet) :: Bool) ->
_lhsIisDeclOfLet
{-# INLINE rule103 #-}
rule103 = \ ((_lhsInested) :: Bool) ->
_lhsInested
{-# INLINE rule104 #-}
rule104 = \ ((_lhsIoptions) :: Options) ->
_lhsIoptions
{-# INLINE rule105 #-}
rule105 = \ ((_lhsIoutputfile) :: String) ->
_lhsIoutputfile
{-# INLINE rule106 #-}
rule106 = \ ((_lhsInested) :: Bool) ->
_lhsInested
{-# INLINE rule107 #-}
rule107 = \ ((_lhsIoptions) :: Options) ->
_lhsIoptions
{-# INLINE rule108 #-}
rule108 = \ ((_lhsIoutputfile) :: String) ->
_lhsIoutputfile
| 2,148
|
sem_Decl_Bind arg_left_ arg_rhs_ = T_Decl (return st20) where
{-# NOINLINE st20 #-}
!st20 = let
v19 :: T_Decl_v19
v19 = \ !(T_Decl_vIn19 _lhsIisDeclOfLet _lhsInested _lhsIoptions _lhsIoutputfile) -> ( let
_leftX32 = Control.Monad.Identity.runIdentity (attach_T_Lhs (arg_left_))
_rhsX26 = Control.Monad.Identity.runIdentity (attach_T_Expr (arg_rhs_))
(T_Lhs_vOut31 _leftIpp) = inv_Lhs_s32 _leftX32 (T_Lhs_vIn31 _leftOisDeclOfLet _leftOnested _leftOoptions _leftOoutputfile)
(T_Expr_vOut25 _rhsIpp) = inv_Expr_s26 _rhsX26 (T_Expr_vIn25 _rhsOnested _rhsOoptions _rhsOoutputfile)
_lhsOpp :: PP_Doc
_lhsOpp = rule101 _leftIpp _rhsIpp
_leftOisDeclOfLet = rule102 _lhsIisDeclOfLet
_leftOnested = rule103 _lhsInested
_leftOoptions = rule104 _lhsIoptions
_leftOoutputfile = rule105 _lhsIoutputfile
_rhsOnested = rule106 _lhsInested
_rhsOoptions = rule107 _lhsIoptions
_rhsOoutputfile = rule108 _lhsIoutputfile
!__result_ = T_Decl_vOut19 _lhsOpp
in __result_ )
in C_Decl_s20 v19
{-# INLINE rule101 #-}
{-# LINE 108 "./src-ag/PrintCode.ag" #-}
rule101 = \ ((_leftIpp) :: PP_Doc) ((_rhsIpp) :: PP_Doc) ->
{-# LINE 108 "./src-ag/PrintCode.ag" #-}
_leftIpp >#< "<-" >#< _rhsIpp
{-# LINE 1030 "dist/build/PrintCode.hs"#-}
{-# INLINE rule102 #-}
rule102 = \ ((_lhsIisDeclOfLet) :: Bool) ->
_lhsIisDeclOfLet
{-# INLINE rule103 #-}
rule103 = \ ((_lhsInested) :: Bool) ->
_lhsInested
{-# INLINE rule104 #-}
rule104 = \ ((_lhsIoptions) :: Options) ->
_lhsIoptions
{-# INLINE rule105 #-}
rule105 = \ ((_lhsIoutputfile) :: String) ->
_lhsIoutputfile
{-# INLINE rule106 #-}
rule106 = \ ((_lhsInested) :: Bool) ->
_lhsInested
{-# INLINE rule107 #-}
rule107 = \ ((_lhsIoptions) :: Options) ->
_lhsIoptions
{-# INLINE rule108 #-}
rule108 = \ ((_lhsIoutputfile) :: String) ->
_lhsIoutputfile
| 2,103
| false
| true
| 0
| 20
| 569
| 459
| 252
| 207
| null | null |
kajigor/uKanren_transformations
|
test/resources/Program/LogicInterpreter.hs
|
bsd-3-clause
|
expr2Def :: Def
expr2Def = Def "expr2" ["q2"] (V "q2" === C "disj" [C "var" [C "z" []], C "i" []])
| 99
|
expr2Def :: Def
expr2Def = Def "expr2" ["q2"] (V "q2" === C "disj" [C "var" [C "z" []], C "i" []])
| 98
|
expr2Def = Def "expr2" ["q2"] (V "q2" === C "disj" [C "var" [C "z" []], C "i" []])
| 82
| false
| true
| 0
| 13
| 21
| 72
| 33
| 39
| null | null |
andreagenso/java2scala
|
src/J2s/Scanner.hs
|
apache-2.0
|
isHexaFloatingPointLiteral1 "" = False
| 50
|
isHexaFloatingPointLiteral1 "" = False
| 50
|
isHexaFloatingPointLiteral1 "" = False
| 50
| false
| false
| 0
| 4
| 15
| 10
| 4
| 6
| null | null |
mgrabmueller/harpy
|
Harpy/X86Assembler.hs
|
bsd-3-clause
|
stosl = ensureBufferSize x86_max_instruction_bytes >> x86_stosl
| 63
|
stosl = ensureBufferSize x86_max_instruction_bytes >> x86_stosl
| 63
|
stosl = ensureBufferSize x86_max_instruction_bytes >> x86_stosl
| 63
| false
| false
| 1
| 6
| 5
| 17
| 6
| 11
| null | null |
clnx/muesli
|
src/Database/Muesli/Query.hs
|
mit
|
pageK_ :: (MonadIO m, ToKey (Sortable b)) => (Int -> MasterState l -> [Int]) ->
Maybe (Sortable b) -> SortOrder -> Transaction l m [Reference a]
pageK_ f mst so = Transaction $ do
t <- S.get
dds <- withMasterLock (transHandle t) $ \m -> return $
concatMap (map (recDocumentKey . fst) . foldMap pure . findFirstDoc m t .
fromIntegral) $ f (ival so mst) m
S.put t { transReadList = dds ++ transReadList t }
return (Reference <$> dds)
| 458
|
pageK_ :: (MonadIO m, ToKey (Sortable b)) => (Int -> MasterState l -> [Int]) ->
Maybe (Sortable b) -> SortOrder -> Transaction l m [Reference a]
pageK_ f mst so = Transaction $ do
t <- S.get
dds <- withMasterLock (transHandle t) $ \m -> return $
concatMap (map (recDocumentKey . fst) . foldMap pure . findFirstDoc m t .
fromIntegral) $ f (ival so mst) m
S.put t { transReadList = dds ++ transReadList t }
return (Reference <$> dds)
| 458
|
pageK_ f mst so = Transaction $ do
t <- S.get
dds <- withMasterLock (transHandle t) $ \m -> return $
concatMap (map (recDocumentKey . fst) . foldMap pure . findFirstDoc m t .
fromIntegral) $ f (ival so mst) m
S.put t { transReadList = dds ++ transReadList t }
return (Reference <$> dds)
| 302
| false
| true
| 0
| 21
| 107
| 226
| 108
| 118
| null | null |
kgadek/SublimeHaskell
|
ModuleInspector.hs
|
mit
|
-- | Adds documentations to ModuleInfo
addDocs :: M.Map String String -> ModuleInfo -> ModuleInfo
addDocs docsMap info = info { _declarations = map (addDoc docsMap) (_declarations info) }
| 187
|
addDocs :: M.Map String String -> ModuleInfo -> ModuleInfo
addDocs docsMap info = info { _declarations = map (addDoc docsMap) (_declarations info) }
| 148
|
addDocs docsMap info = info { _declarations = map (addDoc docsMap) (_declarations info) }
| 89
| true
| true
| 0
| 9
| 28
| 57
| 29
| 28
| null | null |
rueshyna/gogol
|
gogol-android-publisher/gen/Network/Google/Resource/AndroidPublisher/Edits/Testers/Get.hs
|
mpl-2.0
|
-- | Unique identifier for this edit.
etgEditId :: Lens' EditsTestersGet Text
etgEditId
= lens _etgEditId (\ s a -> s{_etgEditId = a})
| 136
|
etgEditId :: Lens' EditsTestersGet Text
etgEditId
= lens _etgEditId (\ s a -> s{_etgEditId = a})
| 98
|
etgEditId
= lens _etgEditId (\ s a -> s{_etgEditId = a})
| 58
| true
| true
| 0
| 9
| 24
| 42
| 22
| 20
| null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.