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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
thomasjm/hrtree | Zora-1.1.18/Zora/List.hs | mit | powerpartition l@(x:xs) =
if length l == 1
then [[[x]]]
else concatMap (get_next_partitions x) . powerpartition $ xs
where
get_next_partitions :: a -> [[a]] -> [[[a]]]
get_next_partitions e l = ([e] : l) : (map f indices)
where
f i ... | 767 | powerpartition l@(x:xs) =
if length l == 1
then [[[x]]]
else concatMap (get_next_partitions x) . powerpartition $ xs
where
get_next_partitions :: a -> [[a]] -> [[[a]]]
get_next_partitions e l = ([e] : l) : (map f indices)
where
f i ... | 767 | powerpartition l@(x:xs) =
if length l == 1
then [[[x]]]
else concatMap (get_next_partitions x) . powerpartition $ xs
where
get_next_partitions :: a -> [[a]] -> [[[a]]]
get_next_partitions e l = ([e] : l) : (map f indices)
where
f i ... | 767 | false | false | 0 | 14 | 290 | 255 | 138 | 117 | null | null |
rob-b/pivotal | src/Pivotal/Lib.hs | bsd-3-clause | genericHandler :: L.ByteString -> IO T.Text
genericHandler = return . TL.toStrict . TL.decodeUtf8 | 97 | genericHandler :: L.ByteString -> IO T.Text
genericHandler = return . TL.toStrict . TL.decodeUtf8 | 97 | genericHandler = return . TL.toStrict . TL.decodeUtf8 | 53 | false | true | 0 | 7 | 12 | 34 | 17 | 17 | null | null |
johan--/postgrest | src/PostgREST/PgQuery.hs | mit | returningStarT :: StatementT
returningStarT s = s { B.stmtTemplate = B.stmtTemplate s <> " RETURNING *" } | 105 | returningStarT :: StatementT
returningStarT s = s { B.stmtTemplate = B.stmtTemplate s <> " RETURNING *" } | 105 | returningStarT s = s { B.stmtTemplate = B.stmtTemplate s <> " RETURNING *" } | 76 | false | true | 0 | 9 | 16 | 33 | 17 | 16 | null | null |
pdarragh/HaskQuest | src/HaskQuest/Game/Objects/Room.hs | mit | roomName :: Room -> String
roomName = roomID | 44 | roomName :: Room -> String
roomName = roomID | 44 | roomName = roomID | 17 | false | true | 0 | 7 | 7 | 22 | 9 | 13 | null | null |
anchor/haskell-opensrs | lib/Text/HTML/TagSoup/Manipulators.hs | bsd-3-clause | currentTag (TagBranch t a _) = head . flattenTree $ [TagBranch t a []] | 70 | currentTag (TagBranch t a _) = head . flattenTree $ [TagBranch t a []] | 70 | currentTag (TagBranch t a _) = head . flattenTree $ [TagBranch t a []] | 70 | false | false | 0 | 8 | 13 | 39 | 19 | 20 | null | null |
guoy34/ampersand | src/Database/Design/Ampersand/Input/ADL1/LexerMessage.hs | gpl-3.0 | showLexerErrorInfo :: LexerErrorInfo -- ^ The error information
-> [String] -- ^ The error messages
showLexerErrorInfo info =
case info of
UnterminatedComment -> [ Texts.lexerUnterminatedComment ]
UnterminatedPurpose -> [ Texts.lexerUnterminatedPurp... | 1,154 | showLexerErrorInfo :: LexerErrorInfo -- ^ The error information
-> [String]
showLexerErrorInfo info =
case info of
UnterminatedComment -> [ Texts.lexerUnterminatedComment ]
UnterminatedPurpose -> [ Texts.lexerUnterminatedPurpose ]
... | 1,130 | showLexerErrorInfo info =
case info of
UnterminatedComment -> [ Texts.lexerUnterminatedComment ]
UnterminatedPurpose -> [ Texts.lexerUnterminatedPurpose ]
UnterminatedAtom -> [ Texts.lexerUnterminatedAtom ]
Un... | 1,035 | true | true | 0 | 15 | 402 | 212 | 109 | 103 | null | null |
abhean/phffp-examples | test/Spec.hs | bsd-3-clause | divisor :: (Arbitrary a, Num a, Eq a) => Gen a
divisor = arbitrary `suchThat` (/=0) | 83 | divisor :: (Arbitrary a, Num a, Eq a) => Gen a
divisor = arbitrary `suchThat` (/=0) | 83 | divisor = arbitrary `suchThat` (/=0) | 36 | false | true | 0 | 7 | 15 | 51 | 26 | 25 | null | null |
Nathan-Fenner/New-Nickel | ParseAST.hs | mit | parseTypeHeader :: Parse (TypeHeader Parsed)
parseTypeHeader = do
checkAt LexSpecial "[" &&& (\_ -> do answer <- parseTypeHeaderBody; _ <- expect LexSpecial "]"; return answer, return $ TypeHeader [] []) | 205 | parseTypeHeader :: Parse (TypeHeader Parsed)
parseTypeHeader = do
checkAt LexSpecial "[" &&& (\_ -> do answer <- parseTypeHeaderBody; _ <- expect LexSpecial "]"; return answer, return $ TypeHeader [] []) | 205 | parseTypeHeader = do
checkAt LexSpecial "[" &&& (\_ -> do answer <- parseTypeHeaderBody; _ <- expect LexSpecial "]"; return answer, return $ TypeHeader [] []) | 160 | false | true | 0 | 13 | 31 | 83 | 40 | 43 | null | null |
aburnett88/HSat | tests-src/Test/Make/Common.hs | mit | genMkBounds :: (Arbitrary a, Bounded a, Ord a) => Int -> Gen (Bounds a, a, a)
genMkBounds _ = do
x <- arbitrary
y <- arbitrary
let x' = if x < y then x else y
y' = if y >= x then y else x
return (mkBounds x y, x', y') | 233 | genMkBounds :: (Arbitrary a, Bounded a, Ord a) => Int -> Gen (Bounds a, a, a)
genMkBounds _ = do
x <- arbitrary
y <- arbitrary
let x' = if x < y then x else y
y' = if y >= x then y else x
return (mkBounds x y, x', y') | 233 | genMkBounds _ = do
x <- arbitrary
y <- arbitrary
let x' = if x < y then x else y
y' = if y >= x then y else x
return (mkBounds x y, x', y') | 153 | false | true | 0 | 11 | 68 | 130 | 66 | 64 | null | null |
deadfoxygrandpa/Elm | compiler/Type/Solve.hs | bsd-3-clause | -- | Every variable has rank less than or equal to the maxRank of the pool.
-- This sorts variables into the young and old pools accordingly.
generalize :: TS.Pool -> StateT TS.SolverState IO ()
generalize youngPool = do
youngMark <- TS.uniqueMark
let youngRank = TS.maxRank youngPool
insert dict var = do
... | 2,076 | generalize :: TS.Pool -> StateT TS.SolverState IO ()
generalize youngPool = do
youngMark <- TS.uniqueMark
let youngRank = TS.maxRank youngPool
insert dict var = do
desc <- liftIO $ UF.descriptor var
liftIO $ UF.modifyDescriptor var (\desc -> desc { mark = youngMark })
return $ Map.ins... | 1,932 | generalize youngPool = do
youngMark <- TS.uniqueMark
let youngRank = TS.maxRank youngPool
insert dict var = do
desc <- liftIO $ UF.descriptor var
liftIO $ UF.modifyDescriptor var (\desc -> desc { mark = youngMark })
return $ Map.insertWith (++) (rank desc) [var] dict
-- Sort the yo... | 1,879 | true | true | 0 | 27 | 547 | 501 | 245 | 256 | null | null |
rfranek/duckling | Duckling/Time/RO/Rules.hs | bsd-3-clause | ruleChristmasEve :: Rule
ruleChristmasEve = Rule
{ name = "christmas eve"
, pattern =
[ regex "ajun(ul)? (de )?cr(a|\x0103)ciun"
]
, prod = \_ -> tt $ monthDay 12 24
} | 183 | ruleChristmasEve :: Rule
ruleChristmasEve = Rule
{ name = "christmas eve"
, pattern =
[ regex "ajun(ul)? (de )?cr(a|\x0103)ciun"
]
, prod = \_ -> tt $ monthDay 12 24
} | 183 | ruleChristmasEve = Rule
{ name = "christmas eve"
, pattern =
[ regex "ajun(ul)? (de )?cr(a|\x0103)ciun"
]
, prod = \_ -> tt $ monthDay 12 24
} | 158 | false | true | 0 | 10 | 46 | 55 | 30 | 25 | null | null |
cdepillabout/ssh | test/Test/Util.hs | bsd-3-clause | ---------------------------------------------------------------------
-- Helper functions for working with test data in @keys@ directory --
---------------------------------------------------------------------
-- | A directory map from filenames to 'Entry' for the @test/keys/@
-- directory.
keysDirectory :: Map String... | 381 | keysDirectory :: Map String Entry
keysDirectory = getDirectory $(embedTree "../../keys") | 88 | keysDirectory = getDirectory $(embedTree "../../keys") | 54 | true | true | 0 | 8 | 38 | 37 | 18 | 19 | null | null |
antalsz/hs-to-coq | examples/ghc/gen-files/Lexer.hs | mit | getInput :: P AlexInput
getInput = P $ \s@PState{ loc=l, buffer=b } -> POk s (AI l b) | 85 | getInput :: P AlexInput
getInput = P $ \s@PState{ loc=l, buffer=b } -> POk s (AI l b) | 85 | getInput = P $ \s@PState{ loc=l, buffer=b } -> POk s (AI l b) | 61 | false | true | 0 | 10 | 17 | 54 | 29 | 25 | null | null |
lukexi/haskell-opencv | test/test.hs | bsd-3-clause | testOrbDetectAndCompute :: HU.Assertion
testOrbDetectAndCompute = do
kikker <- loadImg ImreadUnchanged "kikker.jpg"
let (kpts, descs) = exceptError $ orbDetectAndCompute orb kikker Nothing
kptsRec = V.map keyPointAsRec kpts
kpts2 = V.map mkKeyPoint kptsRec
kptsRec2 = V.map keyPoin... | 664 | testOrbDetectAndCompute :: HU.Assertion
testOrbDetectAndCompute = do
kikker <- loadImg ImreadUnchanged "kikker.jpg"
let (kpts, descs) = exceptError $ orbDetectAndCompute orb kikker Nothing
kptsRec = V.map keyPointAsRec kpts
kpts2 = V.map mkKeyPoint kptsRec
kptsRec2 = V.map keyPoin... | 664 | testOrbDetectAndCompute = do
kikker <- loadImg ImreadUnchanged "kikker.jpg"
let (kpts, descs) = exceptError $ orbDetectAndCompute orb kikker Nothing
kptsRec = V.map keyPointAsRec kpts
kpts2 = V.map mkKeyPoint kptsRec
kptsRec2 = V.map keyPointAsRec kpts2
numDescs = head $ m... | 624 | false | true | 1 | 11 | 195 | 168 | 77 | 91 | null | null |
Helkafen/haddock | haddock-api/src/Haddock/Backends/LaTeX.hs | bsd-2-clause | declWithDoc :: LaTeX -> Maybe LaTeX -> LaTeX
declWithDoc decl doc =
text "\\begin{haddockdesc}" $$
text "\\item[\\begin{tabular}{@{}l}" $$
text (latexMonoFilter (show decl)) $$
text "\\end{tabular}]" <>
(if isNothing doc then empty else text "\\haddockbegindoc") $$
maybe empty id doc $$
text "\... | 338 | declWithDoc :: LaTeX -> Maybe LaTeX -> LaTeX
declWithDoc decl doc =
text "\\begin{haddockdesc}" $$
text "\\item[\\begin{tabular}{@{}l}" $$
text (latexMonoFilter (show decl)) $$
text "\\end{tabular}]" <>
(if isNothing doc then empty else text "\\haddockbegindoc") $$
maybe empty id doc $$
text "\... | 338 | declWithDoc decl doc =
text "\\begin{haddockdesc}" $$
text "\\item[\\begin{tabular}{@{}l}" $$
text (latexMonoFilter (show decl)) $$
text "\\end{tabular}]" <>
(if isNothing doc then empty else text "\\haddockbegindoc") $$
maybe empty id doc $$
text "\\end{haddockdesc}" | 293 | false | true | 0 | 14 | 66 | 102 | 48 | 54 | null | null |
gallais/potpourri | haskell/cyclic/CyclicList.hs | gpl-3.0 | isFinite :: List a -> Bool
isFinite = isJust . CyclicList.length | 64 | isFinite :: List a -> Bool
isFinite = isJust . CyclicList.length | 64 | isFinite = isJust . CyclicList.length | 37 | false | true | 0 | 6 | 10 | 24 | 12 | 12 | null | null |
tjakway/ghcjvm | compiler/types/Type.hs | bsd-3-clause | binderVisibility :: TyBinder -> VisibilityFlag
binderVisibility (Named _ vis) = vis | 83 | binderVisibility :: TyBinder -> VisibilityFlag
binderVisibility (Named _ vis) = vis | 83 | binderVisibility (Named _ vis) = vis | 36 | false | true | 0 | 6 | 10 | 30 | 14 | 16 | null | null |
zeckalpha/kyle.marek-spartz.org | site.hs | mit | sortIdentifiersByDate :: [Identifier] -> [Identifier]
sortIdentifiersByDate =
sortBy byDate
where
byDate id1 id2 =
let fn1 = takeFileName $ toFilePath id1
fn2 = takeFileName $ toFilePath id2
parseTime' fn = parseTimeM True defaultTimeLocale "%Y-%m-%d" $ intercalate "-" $ take 3 $ spl... | 498 | sortIdentifiersByDate :: [Identifier] -> [Identifier]
sortIdentifiersByDate =
sortBy byDate
where
byDate id1 id2 =
let fn1 = takeFileName $ toFilePath id1
fn2 = takeFileName $ toFilePath id2
parseTime' fn = parseTimeM True defaultTimeLocale "%Y-%m-%d" $ intercalate "-" $ take 3 $ spl... | 498 | sortIdentifiersByDate =
sortBy byDate
where
byDate id1 id2 =
let fn1 = takeFileName $ toFilePath id1
fn2 = takeFileName $ toFilePath id2
parseTime' fn = parseTimeM True defaultTimeLocale "%Y-%m-%d" $ intercalate "-" $ take 3 $ splitAll "-" fn
in compare (parseTime' fn1 :: Maybe... | 444 | false | true | 1 | 12 | 98 | 146 | 66 | 80 | null | null |
graninas/Haskell-Algorithms | Tests/ParseAndXmlTest.hs | gpl-3.0 | filterTextContent (_:rest) = filterTextContent rest | 51 | filterTextContent (_:rest) = filterTextContent rest | 51 | filterTextContent (_:rest) = filterTextContent rest | 51 | false | false | 0 | 7 | 4 | 19 | 9 | 10 | null | null |
Paow/encore | src/back/CodeGen/CCodeNames.hs | bsd-3-clause | tupleTypeRecName :: CCode Name
tupleTypeRecName = Nam "tuple_type" | 66 | tupleTypeRecName :: CCode Name
tupleTypeRecName = Nam "tuple_type" | 66 | tupleTypeRecName = Nam "tuple_type" | 35 | false | true | 0 | 5 | 7 | 17 | 8 | 9 | null | null |
rueshyna/gogol | gogol-compute/gen/Network/Google/Resource/Compute/Autoscalers/List.hs | mpl-2.0 | -- | Sorts list results by a certain order. By default, results are returned
-- in alphanumerical order based on the resource name. You can also sort
-- results in descending order based on the creation timestamp using
-- orderBy=\"creationTimestamp desc\". This sorts results based on the
-- creationTimestamp field in ... | 643 | aOrderBy :: Lens' AutoscalersList (Maybe Text)
aOrderBy = lens _aOrderBy (\ s a -> s{_aOrderBy = a}) | 100 | aOrderBy = lens _aOrderBy (\ s a -> s{_aOrderBy = a}) | 53 | true | true | 1 | 9 | 101 | 59 | 32 | 27 | null | null |
mcschroeder/ghc | compiler/ghci/ByteCodeGen.hs | bsd-3-clause | -- Instead of doing a PACK, which would allocate a fresh
-- copy of this constructor, use the single shared version.
mkConAppCode orig_d _ p con args_r_to_l
= ASSERT( dataConRepArity con == length args_r_to_l )
do_pushery orig_d (non_ptr_args ++ ptr_args)
where
-- The args are already in reverse... | 1,146 | mkConAppCode orig_d _ p con args_r_to_l
= ASSERT( dataConRepArity con == length args_r_to_l )
do_pushery orig_d (non_ptr_args ++ ptr_args)
where
-- The args are already in reverse order, which is the way PACK
-- expects them to be. We must push the non-ptrs after the ptrs.
(ptr_args, non_p... | 1,020 | mkConAppCode orig_d _ p con args_r_to_l
= ASSERT( dataConRepArity con == length args_r_to_l )
do_pushery orig_d (non_ptr_args ++ ptr_args)
where
-- The args are already in reverse order, which is the way PACK
-- expects them to be. We must push the non-ptrs after the ptrs.
(ptr_args, non_p... | 1,020 | true | false | 0 | 11 | 278 | 201 | 101 | 100 | null | null |
et4te/zero | src-shared/Zero/Account/Internal.hs | bsd-3-clause | defaultAccount :: Account
defaultAccount = Account
{ a_userId = "<uuid>"
, a_email = "example@email.com"
, a_verifier = "<srp-computed-verifier>"
, a_salt = "<salt>"
} | 177 | defaultAccount :: Account
defaultAccount = Account
{ a_userId = "<uuid>"
, a_email = "example@email.com"
, a_verifier = "<srp-computed-verifier>"
, a_salt = "<salt>"
} | 177 | defaultAccount = Account
{ a_userId = "<uuid>"
, a_email = "example@email.com"
, a_verifier = "<srp-computed-verifier>"
, a_salt = "<salt>"
} | 151 | false | true | 0 | 7 | 32 | 41 | 24 | 17 | null | null |
funfunStudy/algorithm | haskell/src/main/haskell/angryProfessor/Main.hs | mit | checkNum xs limit = let x = length $ filter (\ x -> x >= 0) xs in x > limit | 75 | checkNum xs limit = let x = length $ filter (\ x -> x >= 0) xs in x > limit | 75 | checkNum xs limit = let x = length $ filter (\ x -> x >= 0) xs in x > limit | 75 | false | false | 0 | 13 | 20 | 47 | 23 | 24 | null | null |
sdteffen/epanet-haskell | Epanet.hs | gpl-3.0 | getPatternLen :: Int -> Either Int Int
getPatternLen index = unsafePerformIO $
alloca $ \lenptr -> do
let errcode = c_ENgetpatternlen (fromIntegral index) lenptr
if 0 == errcode
then do
len <- peek lenptr
return $ Right (fromIntegral len)
else do
return $ Left (fromIntegral... | 329 | getPatternLen :: Int -> Either Int Int
getPatternLen index = unsafePerformIO $
alloca $ \lenptr -> do
let errcode = c_ENgetpatternlen (fromIntegral index) lenptr
if 0 == errcode
then do
len <- peek lenptr
return $ Right (fromIntegral len)
else do
return $ Left (fromIntegral... | 329 | getPatternLen index = unsafePerformIO $
alloca $ \lenptr -> do
let errcode = c_ENgetpatternlen (fromIntegral index) lenptr
if 0 == errcode
then do
len <- peek lenptr
return $ Right (fromIntegral len)
else do
return $ Left (fromIntegral errcode) | 290 | false | true | 0 | 15 | 91 | 113 | 53 | 60 | null | null |
DavidAlphaFox/bittorrent | examples/FS.hs | bsd-3-clause | fsReleaseDirectory :: Torrent -> FilePath -> Result'
fsReleaseDirectory _ _ = return eOK | 88 | fsReleaseDirectory :: Torrent -> FilePath -> Result'
fsReleaseDirectory _ _ = return eOK | 88 | fsReleaseDirectory _ _ = return eOK | 35 | false | true | 0 | 6 | 12 | 27 | 13 | 14 | null | null |
holzensp/ghc | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | getNonClobberedOperand :: CmmExpr -> NatM (Operand, InstrBlock)
getNonClobberedOperand (CmmLit lit) = do
use_sse2 <- sse2Enabled
if use_sse2 && isSuitableFloatingPointLit lit
then do
let CmmFloat _ w = lit
Amode addr code <- memConstant (widthInBytes w) lit
return (OpAddr addr, code)
else... | 549 | getNonClobberedOperand :: CmmExpr -> NatM (Operand, InstrBlock)
getNonClobberedOperand (CmmLit lit) = do
use_sse2 <- sse2Enabled
if use_sse2 && isSuitableFloatingPointLit lit
then do
let CmmFloat _ w = lit
Amode addr code <- memConstant (widthInBytes w) lit
return (OpAddr addr, code)
else... | 549 | getNonClobberedOperand (CmmLit lit) = do
use_sse2 <- sse2Enabled
if use_sse2 && isSuitableFloatingPointLit lit
then do
let CmmFloat _ w = lit
Amode addr code <- memConstant (widthInBytes w) lit
return (OpAddr addr, code)
else do
is32Bit <- is32BitPlatform
dflags <- getDynFlags
if i... | 485 | false | true | 0 | 17 | 113 | 194 | 90 | 104 | null | null |
mfine/wai | warp/Network/Wai/Handler/Warp.hs | mit | -- | Interface to bind to. Default value: HostIPv4
--
-- Since 2.1.0
setHost :: HostPreference -> Settings -> Settings
setHost x y = y { settingsHost = x } | 155 | setHost :: HostPreference -> Settings -> Settings
setHost x y = y { settingsHost = x } | 86 | setHost x y = y { settingsHost = x } | 36 | true | true | 0 | 6 | 29 | 35 | 20 | 15 | null | null |
holoed/Junior | src/Lib.hs | apache-2.0 | add :: Prim -> Prim -> Prim
add (IntVal x) (IntVal y) = IntVal (x + y) | 70 | add :: Prim -> Prim -> Prim
add (IntVal x) (IntVal y) = IntVal (x + y) | 70 | add (IntVal x) (IntVal y) = IntVal (x + y) | 42 | false | true | 0 | 10 | 16 | 51 | 24 | 27 | null | null |
diku-dk/futhark | src/Futhark/Compiler/Config.hs | isc | -- | The default compiler configuration.
newFutharkConfig :: FutharkConfig
newFutharkConfig =
FutharkConfig
{ futharkVerbose = (NotVerbose, Nothing),
futharkWarn = True,
futharkWerror = False,
futharkSafe = False,
futharkEntryPoints = [],
futharkTypeCheck = True
} | 304 | newFutharkConfig :: FutharkConfig
newFutharkConfig =
FutharkConfig
{ futharkVerbose = (NotVerbose, Nothing),
futharkWarn = True,
futharkWerror = False,
futharkSafe = False,
futharkEntryPoints = [],
futharkTypeCheck = True
} | 263 | newFutharkConfig =
FutharkConfig
{ futharkVerbose = (NotVerbose, Nothing),
futharkWarn = True,
futharkWerror = False,
futharkSafe = False,
futharkEntryPoints = [],
futharkTypeCheck = True
} | 229 | true | true | 0 | 8 | 72 | 62 | 38 | 24 | null | null |
vladimir-ipatov/ganeti | src/Ganeti/Objects.hs | gpl-2.0 | -- | Custom decoder for DiskLogicalId. This is manual for now, since
-- we don't have yet automation for separate-key style fields.
decodeDLId :: [(String, JSValue)] -> JSValue -> J.Result DiskLogicalId
decodeDLId obj lid = do
dtype <- fromObj obj devType
case dtype of
DTDrbd8 ->
case lid of
JSArr... | 2,279 | decodeDLId :: [(String, JSValue)] -> JSValue -> J.Result DiskLogicalId
decodeDLId obj lid = do
dtype <- fromObj obj devType
case dtype of
DTDrbd8 ->
case lid of
JSArray [nA, nB, p, mA, mB, k] -> do
nA' <- readJSON nA
nB' <- readJSON nB
p' <- readJSON p
mA' ... | 2,147 | decodeDLId obj lid = do
dtype <- fromObj obj devType
case dtype of
DTDrbd8 ->
case lid of
JSArray [nA, nB, p, mA, mB, k] -> do
nA' <- readJSON nA
nB' <- readJSON nB
p' <- readJSON p
mA' <- readJSON mA
mB' <- readJSON mB
k' <- readJSON k... | 2,076 | true | true | 0 | 16 | 782 | 594 | 276 | 318 | null | null |
Zankoku-Okuno/ammonite | Language/Ammonite/Syntax/Printer.hs | gpl-3.0 | showAST (Name x, _) = report x | 30 | showAST (Name x, _) = report x | 30 | showAST (Name x, _) = report x | 30 | false | false | 0 | 6 | 6 | 22 | 10 | 12 | null | null |
forsyde/forsyde-atom | src/ForSyDe/Atom/MoC/SDF/SDF.hs | bsd-3-clause | mealy44 ns od i = MoC.mealy44 (scen51 ns) (scen54 od) (signal i) | 64 | mealy44 ns od i = MoC.mealy44 (scen51 ns) (scen54 od) (signal i) | 64 | mealy44 ns od i = MoC.mealy44 (scen51 ns) (scen54 od) (signal i) | 64 | false | false | 1 | 7 | 11 | 45 | 19 | 26 | null | null |
purcell/adventofcodeteam | app/TwentyThree.hs | bsd-3-clause | getReg :: Reg -> State CPUState Int
getReg RegA = gets regA | 59 | getReg :: Reg -> State CPUState Int
getReg RegA = gets regA | 59 | getReg RegA = gets regA | 23 | false | true | 0 | 7 | 11 | 31 | 13 | 18 | null | null |
HackerFoo/peg | Search.hs | gpl-3.0 | testTreeT :: IO [(Int, Int)]
testTreeT = do
x <- runBFSAllI $ do
liftIO $ putStr "enter a number: "
c <- liftIO readLn
x <- choose [1..]
y <- choose [x..]
guard $ x * y == c
liftIO . putStrLn $ "a solution is " ++ show (x, y)
return (x, y)
return (take 4 x) | 289 | testTreeT :: IO [(Int, Int)]
testTreeT = do
x <- runBFSAllI $ do
liftIO $ putStr "enter a number: "
c <- liftIO readLn
x <- choose [1..]
y <- choose [x..]
guard $ x * y == c
liftIO . putStrLn $ "a solution is " ++ show (x, y)
return (x, y)
return (take 4 x) | 289 | testTreeT = do
x <- runBFSAllI $ do
liftIO $ putStr "enter a number: "
c <- liftIO readLn
x <- choose [1..]
y <- choose [x..]
guard $ x * y == c
liftIO . putStrLn $ "a solution is " ++ show (x, y)
return (x, y)
return (take 4 x) | 260 | false | true | 0 | 14 | 89 | 151 | 70 | 81 | null | null |
joanna-/2048Haskell | app/Main.hs | bsd-3-clause | main = do
startGame | 23 | main = do
startGame | 23 | main = do
startGame | 23 | false | false | 1 | 7 | 7 | 13 | 4 | 9 | null | null |
dylanmc/cryptol | src/Cryptol/TypeCheck/Monad.hs | bsd-3-clause | kSetKind :: QName -> Kind -> KindM ()
kSetKind v k = KM $ sets_ $ \s -> s{ typeParams = Map.insert v k (typeParams s)} | 118 | kSetKind :: QName -> Kind -> KindM ()
kSetKind v k = KM $ sets_ $ \s -> s{ typeParams = Map.insert v k (typeParams s)} | 118 | kSetKind v k = KM $ sets_ $ \s -> s{ typeParams = Map.insert v k (typeParams s)} | 80 | false | true | 2 | 12 | 25 | 71 | 34 | 37 | null | null |
ml9951/ghc | compiler/basicTypes/Module.hs | bsd-3-clause | extendModuleSet s m = Map.insert m () s | 39 | extendModuleSet s m = Map.insert m () s | 39 | extendModuleSet s m = Map.insert m () s | 39 | false | false | 0 | 6 | 7 | 22 | 10 | 12 | null | null |
andrewthad/vinyl-vectors | examples/sorting.hs | bsd-3-clause | -------------------------------------------------------------------------------
-- This is a simple example of what can be done with vinyl-vectors. If you have
-- already cloned the repository, you can run this example with:
--
-- stack build --flag vinyl-vectors:examples && stack exec sorting
--
-- In this example, ... | 635 | numberOfElements :: Int
numberOfElements = 20 | 45 | numberOfElements = 20 | 21 | true | true | 0 | 4 | 100 | 21 | 16 | 5 | null | null |
vikraman/ghc | compiler/basicTypes/Literal.hs | bsd-3-clause | int2WordLit dflags (MachInt i)
| i < 0 = MachWord (1 + tARGET_MAX_WORD dflags + i) -- (-1) ---> tARGET_MAX_WORD
| otherwise = MachWord i | 151 | int2WordLit dflags (MachInt i)
| i < 0 = MachWord (1 + tARGET_MAX_WORD dflags + i) -- (-1) ---> tARGET_MAX_WORD
| otherwise = MachWord i | 151 | int2WordLit dflags (MachInt i)
| i < 0 = MachWord (1 + tARGET_MAX_WORD dflags + i) -- (-1) ---> tARGET_MAX_WORD
| otherwise = MachWord i | 151 | false | false | 0 | 8 | 39 | 62 | 27 | 35 | null | null |
rebeccaskinner/advent_of_code_2016 | day1/solution.hs | apache-2.0 | main = do
contents <- (head <$> getArgs) >>= readFile
let moveResults = move (parseInstructions contents)
putStr "Ending Location: " >> (print $ absolutePostion <$> moveResults)
case firstDoubleVisit . locHist <$> moveResults of
Left s -> print s
Right (Just coords) -> putStr "first passed twice: " >> (... | 367 | main = do
contents <- (head <$> getArgs) >>= readFile
let moveResults = move (parseInstructions contents)
putStr "Ending Location: " >> (print $ absolutePostion <$> moveResults)
case firstDoubleVisit . locHist <$> moveResults of
Left s -> print s
Right (Just coords) -> putStr "first passed twice: " >> (... | 367 | main = do
contents <- (head <$> getArgs) >>= readFile
let moveResults = move (parseInstructions contents)
putStr "Ending Location: " >> (print $ absolutePostion <$> moveResults)
case firstDoubleVisit . locHist <$> moveResults of
Left s -> print s
Right (Just coords) -> putStr "first passed twice: " >> (... | 367 | false | false | 1 | 14 | 75 | 135 | 61 | 74 | null | null |
nevrenato/Hets_Fork | CASL/Sign.hs | gpl-2.0 | mkAxNameSingle :: String -> SORT -> String
mkAxNameSingle str s = "ga_" ++ str ++ "_" ++ show s | 95 | mkAxNameSingle :: String -> SORT -> String
mkAxNameSingle str s = "ga_" ++ str ++ "_" ++ show s | 95 | mkAxNameSingle str s = "ga_" ++ str ++ "_" ++ show s | 52 | false | true | 0 | 7 | 18 | 39 | 19 | 20 | null | null |
AlexanderPankiv/ghc | compiler/stgSyn/CoreToStg.hs | bsd-3-clause | topLevelBound (LetBound TopLet _) = True | 40 | topLevelBound (LetBound TopLet _) = True | 40 | topLevelBound (LetBound TopLet _) = True | 40 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
keithodulaigh/Hets | Common/ConvertLiteral.hs | gpl-2.0 | digitTest :: Id -> Bool
digitTest ii = case ii of
Id [t] [] _ -> case tokStr t of
[d] -> isDigit d
_ -> False
_ -> False | 228 | digitTest :: Id -> Bool
digitTest ii = case ii of
Id [t] [] _ -> case tokStr t of
[d] -> isDigit d
_ -> False
_ -> False | 228 | digitTest ii = case ii of
Id [t] [] _ -> case tokStr t of
[d] -> isDigit d
_ -> False
_ -> False | 204 | false | true | 0 | 11 | 137 | 71 | 35 | 36 | null | null |
tlunter/MacFinder | src/MacFinder/Service/Main.hs | mit | buildMac :: Either R.Reply [(B.ByteString, B.ByteString)] -> Maybe M.Mac
buildMac (Left _) = Nothing | 101 | buildMac :: Either R.Reply [(B.ByteString, B.ByteString)] -> Maybe M.Mac
buildMac (Left _) = Nothing | 101 | buildMac (Left _) = Nothing | 28 | false | true | 0 | 9 | 14 | 49 | 25 | 24 | null | null |
ppenzin/junta | src/test/haskell/TestAll.hs | bsd-2-clause | testGoalFail = testCase "Run goal and fail" $ runBuild (Goal (throw Foo)) `catch` (expectErrorMessage "Foo") | 108 | testGoalFail = testCase "Run goal and fail" $ runBuild (Goal (throw Foo)) `catch` (expectErrorMessage "Foo") | 108 | testGoalFail = testCase "Run goal and fail" $ runBuild (Goal (throw Foo)) `catch` (expectErrorMessage "Foo") | 108 | false | false | 0 | 11 | 14 | 40 | 20 | 20 | null | null |
shlevy/ghc | compiler/main/HscTypes.hs | bsd-3-clause | runHsc :: HscEnv -> Hsc a -> IO a
runHsc hsc_env (Hsc hsc) = do
(a, w) <- hsc hsc_env emptyBag
printOrThrowWarnings (hsc_dflags hsc_env) w
return a | 159 | runHsc :: HscEnv -> Hsc a -> IO a
runHsc hsc_env (Hsc hsc) = do
(a, w) <- hsc hsc_env emptyBag
printOrThrowWarnings (hsc_dflags hsc_env) w
return a | 159 | runHsc hsc_env (Hsc hsc) = do
(a, w) <- hsc hsc_env emptyBag
printOrThrowWarnings (hsc_dflags hsc_env) w
return a | 125 | false | true | 0 | 9 | 38 | 74 | 34 | 40 | null | null |
plow-technologies/keter-node | src/Keter/Node/Configuration.hs | bsd-3-clause | knUnSuffixFileName (Just ke@(KeterNodeExec e)) (Just kh@(KeterNodeHost h)) Nothing f = case (T.stripPrefix e f) >>= (T.stripPrefix h) of
(Just rest) -> (\r -> (ke,kh,KeterNodeId r)) <$> (rFcn rest)
... | 700 | knUnSuffixFileName (Just ke@(KeterNodeExec e)) (Just kh@(KeterNodeHost h)) Nothing f = case (T.stripPrefix e f) >>= (T.stripPrefix h) of
(Just rest) -> (\r -> (ke,kh,KeterNodeId r)) <$> (rFcn rest)
... | 700 | knUnSuffixFileName (Just ke@(KeterNodeExec e)) (Just kh@(KeterNodeHost h)) Nothing f = case (T.stripPrefix e f) >>= (T.stripPrefix h) of
(Just rest) -> (\r -> (ke,kh,KeterNodeId r)) <$> (rFcn rest)
... | 700 | false | false | 0 | 12 | 345 | 213 | 109 | 104 | null | null |
nuttycom/haskoin | Network/Haskoin/Transaction/Types.hs | unlicense | nosigTxHash :: Tx -> TxHash
nosigTxHash tx =
txHash tx{ txIn = map clearInput $ txIn tx}
where
clearInput ti = ti{ scriptInput = BS.empty }
-- | Computes the hash of a coinbase transaction. | 201 | nosigTxHash :: Tx -> TxHash
nosigTxHash tx =
txHash tx{ txIn = map clearInput $ txIn tx}
where
clearInput ti = ti{ scriptInput = BS.empty }
-- | Computes the hash of a coinbase transaction. | 201 | nosigTxHash tx =
txHash tx{ txIn = map clearInput $ txIn tx}
where
clearInput ti = ti{ scriptInput = BS.empty }
-- | Computes the hash of a coinbase transaction. | 173 | false | true | 1 | 8 | 46 | 78 | 34 | 44 | null | null |
kajigor/uKanren_transformations | test/resources/Program/Sort.hs | bsd-3-clause | smallesto :: [Def]
smallesto = smallestoDef : minmaxo | 53 | smallesto :: [Def]
smallesto = smallestoDef : minmaxo | 53 | smallesto = smallestoDef : minmaxo | 34 | false | true | 0 | 5 | 7 | 18 | 10 | 8 | null | null |
joelburget/haste-compiler | src/Haste/Environment.hs | bsd-3-clause | -- | Directory where user .jsmod files are stored.
jsmodUserDir :: FilePath
jsmodUserDir = hasteUserDir </> "jsmods" | 116 | jsmodUserDir :: FilePath
jsmodUserDir = hasteUserDir </> "jsmods" | 65 | jsmodUserDir = hasteUserDir </> "jsmods" | 40 | true | true | 0 | 5 | 16 | 16 | 9 | 7 | null | null |
atsukotakahashi/wi | src/library/Yi/Mode/Abella.hs | gpl-2.0 | abellaUndo :: YiM ()
abellaUndo = do
abellaSend "undo."
withCurrentBuffer $ do
moveB unitSentence Backward
join (assign . markPointA <$> getProofPointMark <*> pointB) | 178 | abellaUndo :: YiM ()
abellaUndo = do
abellaSend "undo."
withCurrentBuffer $ do
moveB unitSentence Backward
join (assign . markPointA <$> getProofPointMark <*> pointB) | 178 | abellaUndo = do
abellaSend "undo."
withCurrentBuffer $ do
moveB unitSentence Backward
join (assign . markPointA <$> getProofPointMark <*> pointB) | 157 | false | true | 0 | 14 | 34 | 58 | 26 | 32 | null | null |
ranjitjhala/hdevtools | src/CommandArgs.hs | mit | check :: Annotate Ann
check = record dummyCheck
[ socket := def += typFile += help "socket file to use"
, ghcOpts := def += typ "OPTION" += help "ghc options"
, cabalOpts := def += typ "OPTION" += help "cabal options"
, path := def += typFile += help "path to target file"
, file ... | 504 | check :: Annotate Ann
check = record dummyCheck
[ socket := def += typFile += help "socket file to use"
, ghcOpts := def += typ "OPTION" += help "ghc options"
, cabalOpts := def += typ "OPTION" += help "cabal options"
, path := def += typFile += help "path to target file"
, file ... | 504 | check = record dummyCheck
[ socket := def += typFile += help "socket file to use"
, ghcOpts := def += typ "OPTION" += help "ghc options"
, cabalOpts := def += typ "OPTION" += help "cabal options"
, path := def += typFile += help "path to target file"
, file := def += typFile ... | 482 | false | true | 3 | 9 | 162 | 149 | 70 | 79 | null | null |
asr/fotc | notes/FOT/FOTC/Program/Mirror/Mirror.hs | mit | -- 1
-- / / \ \
-- 2 3 4 5
-- / \
-- 6 7
tTree ∷ Tree Int
tTree = Tree 1 (Fcons (Tree 2
(Fcons (Tree 6 Fnil)
(Fcons (Tree 7 Fnil)
Fnil)))
(Fcons (Tree 3 Fnil)
(Fcons (Tree 4 Fnil)
(Fc... | 361 | tTree ∷ Tree Int
tTree = Tree 1 (Fcons (Tree 2
(Fcons (Tree 6 Fnil)
(Fcons (Tree 7 Fnil)
Fnil)))
(Fcons (Tree 3 Fnil)
(Fcons (Tree 4 Fnil)
(Fcons (Tree 5 Fnil)
Fnil)))) | 303 | tTree = Tree 1 (Fcons (Tree 2
(Fcons (Tree 6 Fnil)
(Fcons (Tree 7 Fnil)
Fnil)))
(Fcons (Tree 3 Fnil)
(Fcons (Tree 4 Fnil)
(Fcons (Tree 5 Fnil)
Fnil)))) | 286 | true | true | 0 | 15 | 202 | 120 | 62 | 58 | null | null |
Lainepress/easy | Text/RE/PCRE/RE.hs | bsd-3-clause | -- | the default 'REOptions' but with no RE macros defined
noPreludeREOptions :: REOptions
noPreludeREOptions = defaultREOptions { optionsMacs = emptyMacros } | 158 | noPreludeREOptions :: REOptions
noPreludeREOptions = defaultREOptions { optionsMacs = emptyMacros } | 99 | noPreludeREOptions = defaultREOptions { optionsMacs = emptyMacros } | 67 | true | true | 0 | 6 | 21 | 20 | 12 | 8 | null | null |
fredokun/piexplorer | src/Syntax.hs | gpl-3.0 | procInfo (Step _ i) = i | 23 | procInfo (Step _ i) = i | 23 | procInfo (Step _ i) = i | 23 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
thalerjonathan/phd | thesis/code/barter/haskell/src/Utils.hs | gpl-3.0 | replaceElem idx a as = as'
where
(front, back) = splitAt idx as
as' = front ++ [a] ++ tail back | 105 | replaceElem idx a as = as'
where
(front, back) = splitAt idx as
as' = front ++ [a] ++ tail back | 105 | replaceElem idx a as = as'
where
(front, back) = splitAt idx as
as' = front ++ [a] ++ tail back | 105 | false | false | 4 | 6 | 30 | 59 | 25 | 34 | null | null |
kim/amazonka | amazonka-swf/gen/Network/AWS/SWF/Types.hs | mpl-2.0 | -- | Provides details of the 'CompleteWorkflowExecution' decision. It is not set for
-- other decision types.
dCompleteWorkflowExecutionDecisionAttributes :: Lens' Decision (Maybe CompleteWorkflowExecutionDecisionAttributes)
dCompleteWorkflowExecutionDecisionAttributes =
lens _dCompleteWorkflowExecutionDecisionAttr... | 400 | dCompleteWorkflowExecutionDecisionAttributes :: Lens' Decision (Maybe CompleteWorkflowExecutionDecisionAttributes)
dCompleteWorkflowExecutionDecisionAttributes =
lens _dCompleteWorkflowExecutionDecisionAttributes
(\s a -> s { _dCompleteWorkflowExecutionDecisionAttributes = a }) | 290 | dCompleteWorkflowExecutionDecisionAttributes =
lens _dCompleteWorkflowExecutionDecisionAttributes
(\s a -> s { _dCompleteWorkflowExecutionDecisionAttributes = a }) | 175 | true | true | 0 | 9 | 47 | 47 | 26 | 21 | null | null |
mbakke/ganeti | src/Ganeti/HTools/Program/Hsqueeze.hs | bsd-2-clause | greedyOfflineNodes inst conf (nd:nds) =
let nds' = greedyOfflineNodes inst conf nds
in if canOffline inst conf (nd:nds') then nd:nds' else nds' | 147 | greedyOfflineNodes inst conf (nd:nds) =
let nds' = greedyOfflineNodes inst conf nds
in if canOffline inst conf (nd:nds') then nd:nds' else nds' | 147 | greedyOfflineNodes inst conf (nd:nds) =
let nds' = greedyOfflineNodes inst conf nds
in if canOffline inst conf (nd:nds') then nd:nds' else nds' | 147 | false | false | 0 | 10 | 25 | 64 | 32 | 32 | null | null |
ehlemur/HLearn | src/HLearn/Models/Distributions/Univariate/Exponential.hs | bsd-3-clause | e_lambda (Exponential dist) = (m0 dist)/(m1 dist) | 49 | e_lambda (Exponential dist) = (m0 dist)/(m1 dist) | 49 | e_lambda (Exponential dist) = (m0 dist)/(m1 dist) | 49 | false | false | 0 | 7 | 6 | 31 | 15 | 16 | null | null |
oldmanmike/ghc | compiler/nativeGen/PPC/CodeGen.hs | bsd-3-clause | condFltCode cond x y = do
(src1, code1) <- getSomeReg x
(src2, code2) <- getSomeReg y
let
code' = code1 `appOL` code2 `snocOL` FCMP src1 src2
code'' = case cond of -- twiddle CR to handle unordered case
GE -> code' `snocOL` CRNOR ltbit eqbit gtbit
LE ... | 1,117 | condFltCode cond x y = do
(src1, code1) <- getSomeReg x
(src2, code2) <- getSomeReg y
let
code' = code1 `appOL` code2 `snocOL` FCMP src1 src2
code'' = case cond of -- twiddle CR to handle unordered case
GE -> code' `snocOL` CRNOR ltbit eqbit gtbit
LE ... | 1,117 | condFltCode cond x y = do
(src1, code1) <- getSomeReg x
(src2, code2) <- getSomeReg y
let
code' = code1 `appOL` code2 `snocOL` FCMP src1 src2
code'' = case cond of -- twiddle CR to handle unordered case
GE -> code' `snocOL` CRNOR ltbit eqbit gtbit
LE ... | 1,117 | false | false | 0 | 14 | 302 | 170 | 94 | 76 | null | null |
dragosboca/xmobar | src/Plugins/EWMH.hs | bsd-3-clause | clientHandlers = [ ("_NET_WM_NAME", updateName)
, ("_NET_WM_DESKTOP", updateDesktop) ] | 103 | clientHandlers = [ ("_NET_WM_NAME", updateName)
, ("_NET_WM_DESKTOP", updateDesktop) ] | 103 | clientHandlers = [ ("_NET_WM_NAME", updateName)
, ("_NET_WM_DESKTOP", updateDesktop) ] | 103 | false | false | 0 | 6 | 25 | 24 | 15 | 9 | null | null |
leroux/HaskellKoans | test/Lists.hs | mit | koans :: Koan
koans = describe "Lists" $ do
koanDrop
koanTake
koanHead
koanTail
koanInit
koanLast
koanConcat
koanReplicate
koanRepeat
koanIterate | 185 | koans :: Koan
koans = describe "Lists" $ do
koanDrop
koanTake
koanHead
koanTail
koanInit
koanLast
koanConcat
koanReplicate
koanRepeat
koanIterate | 185 | koans = describe "Lists" $ do
koanDrop
koanTake
koanHead
koanTail
koanInit
koanLast
koanConcat
koanReplicate
koanRepeat
koanIterate | 171 | false | true | 2 | 7 | 58 | 56 | 20 | 36 | null | null |
jeffreyrosenbluth/Othello | src/Game.hs | bsd-3-clause | opposite :: Piece -> Piece
opposite Black = White | 49 | opposite :: Piece -> Piece
opposite Black = White | 49 | opposite Black = White | 22 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
ihc/futhark | src/Futhark/Optimise/Fusion/TryFusion.hs | isc | tryFusion :: MonadFreshNames m =>
TryFusion a -> Scope SOACS -> m (Maybe a)
tryFusion (TryFusion m) types = modifyNameSource $ \src ->
case runStateT (runReaderT m types) src of
Just (x, src') -> (Just x, src')
Nothing -> (Nothing, src) | 266 | tryFusion :: MonadFreshNames m =>
TryFusion a -> Scope SOACS -> m (Maybe a)
tryFusion (TryFusion m) types = modifyNameSource $ \src ->
case runStateT (runReaderT m types) src of
Just (x, src') -> (Just x, src')
Nothing -> (Nothing, src) | 266 | tryFusion (TryFusion m) types = modifyNameSource $ \src ->
case runStateT (runReaderT m types) src of
Just (x, src') -> (Just x, src')
Nothing -> (Nothing, src) | 177 | false | true | 0 | 11 | 70 | 119 | 58 | 61 | null | null |
shayan-najd/HsParser | U/Pretty.hs | gpl-3.0 | mkNest k p = nest_ k p | 38 | mkNest k p = nest_ k p | 38 | mkNest k p = nest_ k p | 38 | false | false | 0 | 5 | 22 | 16 | 7 | 9 | null | null |
TomMD/ghc | compiler/codeGen/StgCmmPrim.hs | bsd-3-clause | doCopyByteArrayOp :: CmmExpr -> CmmExpr -> CmmExpr -> CmmExpr -> CmmExpr
-> FCode ()
doCopyByteArrayOp = emitCopyByteArray copy
where
-- Copy data (we assume the arrays aren't overlapping since
-- they're of different types)
copy _src _dst dst_p src_p bytes =
emitMemcpyCall dst_p... | 607 | doCopyByteArrayOp :: CmmExpr -> CmmExpr -> CmmExpr -> CmmExpr -> CmmExpr
-> FCode ()
doCopyByteArrayOp = emitCopyByteArray copy
where
-- Copy data (we assume the arrays aren't overlapping since
-- they're of different types)
copy _src _dst dst_p src_p bytes =
emitMemcpyCall dst_p... | 607 | doCopyByteArrayOp = emitCopyByteArray copy
where
-- Copy data (we assume the arrays aren't overlapping since
-- they're of different types)
copy _src _dst dst_p src_p bytes =
emitMemcpyCall dst_p src_p bytes 1
-- | Takes a source 'MutableByteArray#', an offset in the source
-- array, a destinatio... | 504 | false | true | 0 | 12 | 133 | 84 | 40 | 44 | null | null |
kmate/HaRe | test/TestUtils.hs | bsd-3-clause | -- ---------------------------------------------------------------------
runTestGhc :: RefactGhc a -> IO (a, RefactState)
runTestGhc comp = do
runTestInternal comp initialState testOptions
-- --------------------------------------------------------------------- | 266 | runTestGhc :: RefactGhc a -> IO (a, RefactState)
runTestGhc comp = do
runTestInternal comp initialState testOptions
-- --------------------------------------------------------------------- | 192 | runTestGhc comp = do
runTestInternal comp initialState testOptions
-- --------------------------------------------------------------------- | 143 | true | true | 0 | 7 | 24 | 42 | 21 | 21 | null | null |
HIPERFIT/futhark | src/Futhark/Pass/ExtractMulticore.hs | isc | histToSegBinOp :: SOACS.HistOp SOACS -> ExtractM (Stms MC, MC.HistOp MC)
histToSegBinOp (SOACS.HistOp num_bins rf dests nes op) = do
((op', nes', shape), stms) <- runBuilder $ determineReduceOp op nes
op'' <- transformLambda op'
return (stms, MC.HistOp num_bins rf dests nes' shape op'') | 293 | histToSegBinOp :: SOACS.HistOp SOACS -> ExtractM (Stms MC, MC.HistOp MC)
histToSegBinOp (SOACS.HistOp num_bins rf dests nes op) = do
((op', nes', shape), stms) <- runBuilder $ determineReduceOp op nes
op'' <- transformLambda op'
return (stms, MC.HistOp num_bins rf dests nes' shape op'') | 293 | histToSegBinOp (SOACS.HistOp num_bins rf dests nes op) = do
((op', nes', shape), stms) <- runBuilder $ determineReduceOp op nes
op'' <- transformLambda op'
return (stms, MC.HistOp num_bins rf dests nes' shape op'') | 220 | false | true | 0 | 10 | 47 | 124 | 61 | 63 | null | null |
OpenXT/manager | xenmgr/Vm/React.hs | gpl-2.0 | notifyNetworkDaemonR = mkReact f where
f (VmStateChange Running)
= do uuid <- vmUuid
whenDomainID_ uuid $ \domid -> do
whenM (getVmProvidesNetworkBackend uuid) $ liftRpc $
comCitrixXenclientNetworkdaemonNdvmStatus "com.citrix.xenclient.networkdaemon" "/" (uuidStr uuid) (fromIntegr... | 620 | notifyNetworkDaemonR = mkReact f where
f (VmStateChange Running)
= do uuid <- vmUuid
whenDomainID_ uuid $ \domid -> do
whenM (getVmProvidesNetworkBackend uuid) $ liftRpc $
comCitrixXenclientNetworkdaemonNdvmStatus "com.citrix.xenclient.networkdaemon" "/" (uuidStr uuid) (fromIntegr... | 620 | notifyNetworkDaemonR = mkReact f where
f (VmStateChange Running)
= do uuid <- vmUuid
whenDomainID_ uuid $ \domid -> do
whenM (getVmProvidesNetworkBackend uuid) $ liftRpc $
comCitrixXenclientNetworkdaemonNdvmStatus "com.citrix.xenclient.networkdaemon" "/" (uuidStr uuid) (fromIntegr... | 620 | false | false | 1 | 15 | 127 | 174 | 78 | 96 | null | null |
unisonweb/platform | parser-typechecker/src/Unison/TermPrinter.hs | mit | toDocEmbedTermLink :: Ord v => PrettyPrintEnv -> Term3 v PrintAnnotation -> Maybe Referent
toDocEmbedTermLink ppe (App' (Ref' r) (Delay' (Referent' tm)))
| nameEndsWith ppe ".docEmbedTermLink" r = Just tm | 206 | toDocEmbedTermLink :: Ord v => PrettyPrintEnv -> Term3 v PrintAnnotation -> Maybe Referent
toDocEmbedTermLink ppe (App' (Ref' r) (Delay' (Referent' tm)))
| nameEndsWith ppe ".docEmbedTermLink" r = Just tm | 206 | toDocEmbedTermLink ppe (App' (Ref' r) (Delay' (Referent' tm)))
| nameEndsWith ppe ".docEmbedTermLink" r = Just tm | 115 | false | true | 0 | 10 | 30 | 86 | 38 | 48 | null | null |
adamwespiser/wespiser.com | my-site/drafts/IxMonad.hs | gpl-3.0 | return :: (CM.Monad m) => a -> IxMonadT s s m a
return a = IxMonadT $ \s -> CM.return (a, s) | 92 | return :: (CM.Monad m) => a -> IxMonadT s s m a
return a = IxMonadT $ \s -> CM.return (a, s) | 92 | return a = IxMonadT $ \s -> CM.return (a, s) | 44 | false | true | 0 | 8 | 21 | 58 | 30 | 28 | null | null |
kazu-yamamoto/dns | internal/Network/DNS/Decode/Parsers.hs | bsd-3-clause | getRData A _ = RD_A . toIPv4 <$> getNBytes 4 | 48 | getRData A _ = RD_A . toIPv4 <$> getNBytes 4 | 48 | getRData A _ = RD_A . toIPv4 <$> getNBytes 4 | 48 | false | false | 0 | 6 | 13 | 24 | 10 | 14 | null | null |
tim-m89/hclr | Foreign/HCLR/Binding/Mono.hs | bsd-3-clause | splitOn :: Eq a => a -> [a] -> [[a]]
splitOn _ [] = [] | 54 | splitOn :: Eq a => a -> [a] -> [[a]]
splitOn _ [] = [] | 54 | splitOn _ [] = [] | 17 | false | true | 0 | 9 | 14 | 44 | 23 | 21 | null | null |
phaazon/Idris-dev | src/IRTS/CodegenJavaScript.hs | bsd-3-clause | translateConstant (Ch c) = JSString $ translateChar c | 71 | translateConstant (Ch c) = JSString $ translateChar c | 71 | translateConstant (Ch c) = JSString $ translateChar c | 71 | false | false | 0 | 7 | 25 | 22 | 10 | 12 | null | null |
573/leksah | src/IDE/Command.hs | gpl-2.0 | --TODO add here
getActionsFor' :: [Text] -> IDEM[Action]
getActionsFor' l = do
r <- mapM getActionFor l
return (catMaybes r)
where
getActionFor string = do
uiManager' <- getUiManager
actionGroups <- liftIO $ uiManagerGetActionGroups uiManager'
res <- liftIO $ act... | 507 | getActionsFor' :: [Text] -> IDEM[Action]
getActionsFor' l = do
r <- mapM getActionFor l
return (catMaybes r)
where
getActionFor string = do
uiManager' <- getUiManager
actionGroups <- liftIO $ uiManagerGetActionGroups uiManager'
res <- liftIO $ actionGroupGetAction... | 490 | getActionsFor' l = do
r <- mapM getActionFor l
return (catMaybes r)
where
getActionFor string = do
uiManager' <- getUiManager
actionGroups <- liftIO $ uiManagerGetActionGroups uiManager'
res <- liftIO $ actionGroupGetAction (head actionGroups) string
w... | 449 | true | true | 0 | 13 | 142 | 165 | 74 | 91 | null | null |
mrakgr/futhark | src/Futhark/Analysis/SymbolTable.hs | bsd-3-clause | lookupRange :: VName -> SymbolTable lore -> ScalExpRange
lookupRange name vtable =
maybe (Nothing, Nothing) valueRange $ lookup name vtable | 141 | lookupRange :: VName -> SymbolTable lore -> ScalExpRange
lookupRange name vtable =
maybe (Nothing, Nothing) valueRange $ lookup name vtable | 141 | lookupRange name vtable =
maybe (Nothing, Nothing) valueRange $ lookup name vtable | 84 | false | true | 0 | 8 | 21 | 53 | 24 | 29 | null | null |
rfranek/duckling | Duckling/Time/HE/Rules.hs | bsd-3-clause | ruleNamedmonth3 :: Rule
ruleNamedmonth3 = Rule
{ name = "named-month"
, pattern =
[ regex "\x05de\x05e8\x05e5"
]
, prod = \_ -> tt $ month 3
} | 158 | ruleNamedmonth3 :: Rule
ruleNamedmonth3 = Rule
{ name = "named-month"
, pattern =
[ regex "\x05de\x05e8\x05e5"
]
, prod = \_ -> tt $ month 3
} | 158 | ruleNamedmonth3 = Rule
{ name = "named-month"
, pattern =
[ regex "\x05de\x05e8\x05e5"
]
, prod = \_ -> tt $ month 3
} | 134 | false | true | 0 | 10 | 42 | 53 | 29 | 24 | null | null |
jesserobertson/xmonad-conf | xmonad.hs | mit | -- color of inactive workspace
myUrgentWSColor = "#C2465F" | 59 | myUrgentWSColor = "#C2465F" | 28 | myUrgentWSColor = "#C2465F" | 28 | true | false | 0 | 4 | 8 | 7 | 4 | 3 | null | null |
zaxtax/hakaru | haskell/Examples/SlamEmbed.hs | bsd-3-clause | muZInts :: (Base repr) => repr H.Real
muZInts = 40 | 50 | muZInts :: (Base repr) => repr H.Real
muZInts = 40 | 50 | muZInts = 40 | 12 | false | true | 0 | 7 | 9 | 25 | 13 | 12 | null | null |
beni55/cryptol | src/Cryptol/TypeCheck/Solver/Numeric/Simplify1.hs | bsd-3-clause | pKnownInf :: (Eq a, HasVars a) => Name -> I a -> I a
pKnownInf x prop = fromMaybe prop (apSubst (Map.singleton x (K Inf)) prop) | 127 | pKnownInf :: (Eq a, HasVars a) => Name -> I a -> I a
pKnownInf x prop = fromMaybe prop (apSubst (Map.singleton x (K Inf)) prop) | 127 | pKnownInf x prop = fromMaybe prop (apSubst (Map.singleton x (K Inf)) prop) | 74 | false | true | 0 | 11 | 25 | 78 | 37 | 41 | null | null |
rueshyna/gogol | gogol-android-publisher/gen/Network/Google/Resource/AndroidPublisher/Edits/Images/List.hs | mpl-2.0 | eilImageType :: Lens' EditsImagesList EditsImagesListImageType
eilImageType
= lens _eilImageType (\ s a -> s{_eilImageType = a}) | 130 | eilImageType :: Lens' EditsImagesList EditsImagesListImageType
eilImageType
= lens _eilImageType (\ s a -> s{_eilImageType = a}) | 130 | eilImageType
= lens _eilImageType (\ s a -> s{_eilImageType = a}) | 67 | false | true | 1 | 9 | 17 | 44 | 21 | 23 | null | null |
ardfard/bleague | server/BLeague/Models/User.hs | bsd-3-clause | usernameIndexName = "username" | 30 | usernameIndexName = "username" | 30 | usernameIndexName = "username" | 30 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
brendanhay/gogol | gogol-youtube/gen/Network/Google/YouTube/Types/Product.hs | mpl-2.0 | -- | Identifies what kind of resource this is. Value: the fixed string
-- \"youtube#liveChatMessageListResponse\".
lcmlrKind :: Lens' LiveChatMessageListResponse Text
lcmlrKind
= lens _lcmlrKind (\ s a -> s{_lcmlrKind = a}) | 225 | lcmlrKind :: Lens' LiveChatMessageListResponse Text
lcmlrKind
= lens _lcmlrKind (\ s a -> s{_lcmlrKind = a}) | 110 | lcmlrKind
= lens _lcmlrKind (\ s a -> s{_lcmlrKind = a}) | 58 | true | true | 0 | 9 | 32 | 43 | 23 | 20 | null | null |
romanb/amazonka | amazonka-opsworks/gen/Network/AWS/OpsWorks/Types.hs | mpl-2.0 | -- | An array of custom recipe names to be run following a 'setup' event.
rSetup :: Lens' Recipes [Text]
rSetup = lens _rSetup (\s a -> s { _rSetup = a }) . _List | 162 | rSetup :: Lens' Recipes [Text]
rSetup = lens _rSetup (\s a -> s { _rSetup = a }) . _List | 88 | rSetup = lens _rSetup (\s a -> s { _rSetup = a }) . _List | 57 | true | true | 0 | 10 | 34 | 47 | 26 | 21 | null | null |
tjakway/ghcjvm | compiler/ghci/ByteCodeInstr.hs | bsd-3-clause | bciStackUse PUSH_APPLY_PPPP{} = 1 | 37 | bciStackUse PUSH_APPLY_PPPP{} = 1 | 37 | bciStackUse PUSH_APPLY_PPPP{} = 1 | 37 | false | false | 0 | 6 | 7 | 13 | 6 | 7 | null | null |
sfultong/stand-in-language | src/SIL/RunTime.hs | apache-2.0 | debugEval :: (IExpr -> DataType -> Bool) -> IExpr -> IO ()
debugEval typeCheck iexpr = if typeCheck iexpr ZeroType
then tEval iexpr >>= (print . PrettyIExpr)
else putStrLn "failed typecheck" | 194 | debugEval :: (IExpr -> DataType -> Bool) -> IExpr -> IO ()
debugEval typeCheck iexpr = if typeCheck iexpr ZeroType
then tEval iexpr >>= (print . PrettyIExpr)
else putStrLn "failed typecheck" | 194 | debugEval typeCheck iexpr = if typeCheck iexpr ZeroType
then tEval iexpr >>= (print . PrettyIExpr)
else putStrLn "failed typecheck" | 135 | false | true | 0 | 8 | 34 | 75 | 36 | 39 | null | null |
mpickering/hackage-server | Distribution/Server/Features/ReverseDependencies/State.hs | bsd-3-clause | updatePackageReverse :: VersionIndex -> PackageName -> [PackageName] -> RevDeps -> Map PackageName ReverseDisplay -> Map PackageName ReverseDisplay
updatePackageReverse indexFunc updated deps revs nameMap =
foldl' (\revd pkg -> Map.alter (alterRevDisplay pkg . fromMaybe Map.empty) pkg revd) nameMap deps
where
... | 704 | updatePackageReverse :: VersionIndex -> PackageName -> [PackageName] -> RevDeps -> Map PackageName ReverseDisplay -> Map PackageName ReverseDisplay
updatePackageReverse indexFunc updated deps revs nameMap =
foldl' (\revd pkg -> Map.alter (alterRevDisplay pkg . fromMaybe Map.empty) pkg revd) nameMap deps
where
... | 704 | updatePackageReverse indexFunc updated deps revs nameMap =
foldl' (\revd pkg -> Map.alter (alterRevDisplay pkg . fromMaybe Map.empty) pkg revd) nameMap deps
where
lookupVersions :: PackageName -> Set Version
lookupVersions pkgname = maybe Set.empty (Set.unions . map (Map.findWithDefault Set.empty $ update... | 556 | false | true | 0 | 15 | 106 | 218 | 106 | 112 | null | null |
Lythimus/lptv | sites/all/modules/jgm-pandoc-8be6cc2/src/Text/Pandoc/Writers/MediaWiki.hs | gpl-2.0 | isSimpleListItem :: [Block] -> Bool
isSimpleListItem [] = True | 63 | isSimpleListItem :: [Block] -> Bool
isSimpleListItem [] = True | 63 | isSimpleListItem [] = True | 27 | false | true | 0 | 6 | 9 | 23 | 12 | 11 | null | null |
Mokosha/Lambency | lib/Lambency/Loaders/OBJLoader.hs | mit | addCommand (Group _) = return [] | 32 | addCommand (Group _) = return [] | 32 | addCommand (Group _) = return [] | 32 | false | false | 0 | 7 | 5 | 20 | 9 | 11 | null | null |
Jon0/status | src/Package.hs | gpl-3.0 | pkgAppendMimeTypes :: [String] -> [PackageFile] -> [String]
pkgAppendMimeTypes ts [] = ts | 89 | pkgAppendMimeTypes :: [String] -> [PackageFile] -> [String]
pkgAppendMimeTypes ts [] = ts | 89 | pkgAppendMimeTypes ts [] = ts | 29 | false | true | 0 | 9 | 11 | 41 | 20 | 21 | null | null |
tpsinnem/Idris-dev | src/Idris/Parser/Helpers.hs | bsd-3-clause | charLiteral :: (MonadicParsing m, HasLastTokenSpan m) => m (Char, FC)
charLiteral = do ch <- Tok.charLiteral
fc <- getLastTokenSpan
return (ch, fromMaybe NoFC fc)
-- | Parses a natural number | 226 | charLiteral :: (MonadicParsing m, HasLastTokenSpan m) => m (Char, FC)
charLiteral = do ch <- Tok.charLiteral
fc <- getLastTokenSpan
return (ch, fromMaybe NoFC fc)
-- | Parses a natural number | 226 | charLiteral = do ch <- Tok.charLiteral
fc <- getLastTokenSpan
return (ch, fromMaybe NoFC fc)
-- | Parses a natural number | 156 | false | true | 0 | 9 | 64 | 69 | 35 | 34 | null | null |
djoyner/zigbee-znet25 | src/Network/Protocol/ZigBee/ZNet25/Frame.hs | bsd-3-clause | getNodeIdentificationIndicator :: Get Frame
getNodeIdentificationIndicator =
NodeIdentificationIndicator <$>
get <*>
get <*>
get <*>
get <*>
get <*>
getNullTerminatedString <*>
get <*>
get <*>
get <*>
get <*>
get | 258 | getNodeIdentificationIndicator :: Get Frame
getNodeIdentificationIndicator =
NodeIdentificationIndicator <$>
get <*>
get <*>
get <*>
get <*>
get <*>
getNullTerminatedString <*>
get <*>
get <*>
get <*>
get <*>
get | 258 | getNodeIdentificationIndicator =
NodeIdentificationIndicator <$>
get <*>
get <*>
get <*>
get <*>
get <*>
getNullTerminatedString <*>
get <*>
get <*>
get <*>
get <*>
get | 214 | false | true | 0 | 15 | 74 | 58 | 29 | 29 | null | null |
Jonplussed/midi-free | src/Sound/MIDI/Values/Note.hs | gpl-3.0 | g7 = Note 91 | 18 | g7 = Note 91 | 18 | g7 = Note 91 | 18 | false | false | 0 | 5 | 9 | 9 | 4 | 5 | null | null |
tolysz/prepare-ghcjs | spec-lts8/cabal/Cabal/Distribution/Make.hs | bsd-3-clause | configureAction :: ConfigFlags -> [String] -> IO ()
configureAction flags args = do
noExtraFlags args
let verbosity = fromFlag (configVerbosity flags)
rawSystemExit verbosity "sh" $
"configure"
: configureArgs backwardsCompatHack flags
where backwardsCompatHack = True | 284 | configureAction :: ConfigFlags -> [String] -> IO ()
configureAction flags args = do
noExtraFlags args
let verbosity = fromFlag (configVerbosity flags)
rawSystemExit verbosity "sh" $
"configure"
: configureArgs backwardsCompatHack flags
where backwardsCompatHack = True | 284 | configureAction flags args = do
noExtraFlags args
let verbosity = fromFlag (configVerbosity flags)
rawSystemExit verbosity "sh" $
"configure"
: configureArgs backwardsCompatHack flags
where backwardsCompatHack = True | 232 | false | true | 0 | 12 | 49 | 85 | 39 | 46 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F32.hs | bsd-3-clause | -- glViewportPositionWScaleNV --------------------------------------------------
glViewportPositionWScaleNV
:: MonadIO m
=> GLuint -- ^ @index@.
-> GLfloat -- ^ @xcoeff@.
-> GLfloat -- ^ @ycoeff@.
-> m ()
glViewportPositionWScaleNV v1 v2 v3 = liftIO $ dyn229 ptr_glViewportPositionWScaleNV v1 v2 v3 | 309 | glViewportPositionWScaleNV
:: MonadIO m
=> GLuint -- ^ @index@.
-> GLfloat -- ^ @xcoeff@.
-> GLfloat -- ^ @ycoeff@.
-> m ()
glViewportPositionWScaleNV v1 v2 v3 = liftIO $ dyn229 ptr_glViewportPositionWScaleNV v1 v2 v3 | 227 | glViewportPositionWScaleNV v1 v2 v3 = liftIO $ dyn229 ptr_glViewportPositionWScaleNV v1 v2 v3 | 93 | true | true | 0 | 11 | 47 | 63 | 31 | 32 | null | null |
sleexyz/untyped | src/Lib.hs | bsd-3-clause | insertBound :: Name -> Value -> Context -> Context
insertBound name expr (Context global bound free) = Context global bound' free'
where
bound' = Map.insert name expr bound
free' = Set.delete name free | 211 | insertBound :: Name -> Value -> Context -> Context
insertBound name expr (Context global bound free) = Context global bound' free'
where
bound' = Map.insert name expr bound
free' = Set.delete name free | 211 | insertBound name expr (Context global bound free) = Context global bound' free'
where
bound' = Map.insert name expr bound
free' = Set.delete name free | 160 | false | true | 0 | 7 | 42 | 76 | 37 | 39 | null | null |
olsner/ghc | compiler/main/GhcMake.hs | bsd-3-clause | -- | Compile a single module. Always produce a Linkable for it if
-- successful. If no compilation happened, return the old Linkable.
upsweep_mod :: HscEnv
-> Maybe Messager
-> HomePackageTable
-> ([ModuleName],[ModuleName])
-> ModSummary
-> Int -- index of... | 8,682 | upsweep_mod :: HscEnv
-> Maybe Messager
-> HomePackageTable
-> ([ModuleName],[ModuleName])
-> ModSummary
-> Int -- index of module
-> Int -- total number of modules
-> IO HomeModInfo
upsweep_mod hsc_env mHscMessage old_hpt (stable_obj... | 8,546 | upsweep_mod hsc_env mHscMessage old_hpt (stable_obj, stable_bco) summary mod_index nmods
= let
this_mod_name = ms_mod_name summary
this_mod = ms_mod summary
mb_obj_date = ms_obj_date summary
mb_if_date = ms_iface_date summary
obj_fn = ml_obj_fil... | 8,277 | true | true | 0 | 23 | 3,349 | 1,280 | 628 | 652 | null | null |
brendanhay/gogol | gogol-videointelligence/gen/Network/Google/VideoIntelligence/Types/Product.hs | mpl-2.0 | -- | Annotation results for all videos specified in \`AnnotateVideoRequest\`.
gcvvavrAnnotationResults :: Lens' GoogleCloudVideointelligenceV1beta2_AnnotateVideoResponse [GoogleCloudVideointelligenceV1beta2_VideoAnnotationResults]
gcvvavrAnnotationResults
= lens _gcvvavrAnnotationResults
(\ s a -> s{_gcvvavrAnn... | 373 | gcvvavrAnnotationResults :: Lens' GoogleCloudVideointelligenceV1beta2_AnnotateVideoResponse [GoogleCloudVideointelligenceV1beta2_VideoAnnotationResults]
gcvvavrAnnotationResults
= lens _gcvvavrAnnotationResults
(\ s a -> s{_gcvvavrAnnotationResults = a})
. _Default
. _Coerce | 295 | gcvvavrAnnotationResults
= lens _gcvvavrAnnotationResults
(\ s a -> s{_gcvvavrAnnotationResults = a})
. _Default
. _Coerce | 142 | true | true | 0 | 11 | 49 | 53 | 28 | 25 | null | null |
Flogistix/aws-commander | src/Commander.hs | mit | runAWSWithEnv :: Env -> AWS a -> IO a
runAWSWithEnv env = runResourceT . runAWS env | 83 | runAWSWithEnv :: Env -> AWS a -> IO a
runAWSWithEnv env = runResourceT . runAWS env | 83 | runAWSWithEnv env = runResourceT . runAWS env | 45 | false | true | 0 | 7 | 15 | 35 | 16 | 19 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.