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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
literate-unitb/literate-unitb | src/Interactive/Pipeline.hs | mit | dump :: Shared -> IO (IO b)
dump (Shared { .. }) = do
tok <- newEmptyMVar
observe dump_cmd tok
return $ forever $ do
takeMVar tok
pat <- read_obs dump_cmd
case pat of
Just pat -> do
pos <- read_obs pr_obl
dump_z3 pat fname pos
write_obs dump_cmd Nothing
Nothing -> return () | 384 | dump :: Shared -> IO (IO b)
dump (Shared { .. }) = do
tok <- newEmptyMVar
observe dump_cmd tok
return $ forever $ do
takeMVar tok
pat <- read_obs dump_cmd
case pat of
Just pat -> do
pos <- read_obs pr_obl
dump_z3 pat fname pos
write_obs dump_cmd Nothing
Nothing -> return () | 384 | dump (Shared { .. }) = do
tok <- newEmptyMVar
observe dump_cmd tok
return $ forever $ do
takeMVar tok
pat <- read_obs dump_cmd
case pat of
Just pat -> do
pos <- read_obs pr_obl
dump_z3 pat fname pos
write_obs dump_cmd Nothing
Nothing -> return () | 356 | false | true | 0 | 16 | 162 | 133 | 58 | 75 | null | null |
brendanhay/gogol | gogol-dfareporting/gen/Network/Google/DFAReporting/Types/Product.hs | mpl-2.0 | -- | Country code.
cCountryCode :: Lens' Country (Maybe Text)
cCountryCode
= lens _cCountryCode (\ s a -> s{_cCountryCode = a}) | 129 | cCountryCode :: Lens' Country (Maybe Text)
cCountryCode
= lens _cCountryCode (\ s a -> s{_cCountryCode = a}) | 110 | cCountryCode
= lens _cCountryCode (\ s a -> s{_cCountryCode = a}) | 67 | true | true | 1 | 9 | 22 | 52 | 25 | 27 | null | null |
erikstenlund/lisp-parser | lisp.hs | mit | symbol = oneOf "!@#$%^&*-_+/:<=>?~" | 35 | symbol = oneOf "!@#$%^&*-_+/:<=>?~" | 35 | symbol = oneOf "!@#$%^&*-_+/:<=>?~" | 35 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
kazu-yamamoto/http2 | bench-hpack/Main.hs | bsd-3-clause | linear = EncodeStrategy {compressionAlgo = Linear, useHuffman = False} | 71 | linear = EncodeStrategy {compressionAlgo = Linear, useHuffman = False} | 71 | linear = EncodeStrategy {compressionAlgo = Linear, useHuffman = False} | 71 | false | false | 1 | 7 | 9 | 27 | 13 | 14 | null | null |
aelve/guide | back/src/Guide/Database/Connection.hs | bsd-3-clause | -- | Database password
dbPass :: ByteString
dbPass = "3" | 56 | dbPass :: ByteString
dbPass = "3" | 33 | dbPass = "3" | 12 | true | true | 0 | 4 | 9 | 12 | 7 | 5 | null | null |
bkoropoff/Idris-dev | src/Idris/Prover.hs | bsd-3-clause | receiveInput :: Handle -> ElabState EState -> Idris (Maybe String)
receiveInput h e =
do i <- getIState
let inh = if h == stdout then stdin else h
len' <- runIO $ IdeMode.getLen inh
len <- case len' of
Left err -> ierror err
Right n -> return n
l <- runIO $ IdeMode.getNChar inh len ""
(sexp, id) <- case IdeMode.parseMessage l of
Left err -> ierror err
Right (sexp, id) -> return (sexp, id)
putIState $ i { idris_outputmode = (IdeMode id h) }
case IdeMode.sexpToCommand sexp of
Just (IdeMode.REPLCompletions prefix) ->
do (unused, compls) <- proverCompletion (assumptionNames e) (reverse prefix, "")
let good = IdeMode.SexpList [IdeMode.SymbolAtom "ok", IdeMode.toSExp (map replacement compls, reverse unused)]
idemodePutSExp "return" good
receiveInput h e
Just (IdeMode.Interpret cmd) -> return (Just cmd)
Just (IdeMode.TypeOf str) -> return (Just (":t " ++ str))
Just (IdeMode.DocsFor str _) -> return (Just (":doc " ++ str))
_ -> return Nothing | 1,122 | receiveInput :: Handle -> ElabState EState -> Idris (Maybe String)
receiveInput h e =
do i <- getIState
let inh = if h == stdout then stdin else h
len' <- runIO $ IdeMode.getLen inh
len <- case len' of
Left err -> ierror err
Right n -> return n
l <- runIO $ IdeMode.getNChar inh len ""
(sexp, id) <- case IdeMode.parseMessage l of
Left err -> ierror err
Right (sexp, id) -> return (sexp, id)
putIState $ i { idris_outputmode = (IdeMode id h) }
case IdeMode.sexpToCommand sexp of
Just (IdeMode.REPLCompletions prefix) ->
do (unused, compls) <- proverCompletion (assumptionNames e) (reverse prefix, "")
let good = IdeMode.SexpList [IdeMode.SymbolAtom "ok", IdeMode.toSExp (map replacement compls, reverse unused)]
idemodePutSExp "return" good
receiveInput h e
Just (IdeMode.Interpret cmd) -> return (Just cmd)
Just (IdeMode.TypeOf str) -> return (Just (":t " ++ str))
Just (IdeMode.DocsFor str _) -> return (Just (":doc " ++ str))
_ -> return Nothing | 1,122 | receiveInput h e =
do i <- getIState
let inh = if h == stdout then stdin else h
len' <- runIO $ IdeMode.getLen inh
len <- case len' of
Left err -> ierror err
Right n -> return n
l <- runIO $ IdeMode.getNChar inh len ""
(sexp, id) <- case IdeMode.parseMessage l of
Left err -> ierror err
Right (sexp, id) -> return (sexp, id)
putIState $ i { idris_outputmode = (IdeMode id h) }
case IdeMode.sexpToCommand sexp of
Just (IdeMode.REPLCompletions prefix) ->
do (unused, compls) <- proverCompletion (assumptionNames e) (reverse prefix, "")
let good = IdeMode.SexpList [IdeMode.SymbolAtom "ok", IdeMode.toSExp (map replacement compls, reverse unused)]
idemodePutSExp "return" good
receiveInput h e
Just (IdeMode.Interpret cmd) -> return (Just cmd)
Just (IdeMode.TypeOf str) -> return (Just (":t " ++ str))
Just (IdeMode.DocsFor str _) -> return (Just (":doc " ++ str))
_ -> return Nothing | 1,055 | false | true | 0 | 19 | 328 | 441 | 209 | 232 | null | null |
b1g3ar5/Spreadsheet | Cell.hs | mit | fcadd :: Fix Cell -> Fix Cell -> Fix Cell
fcadd c1 c2 = fixup $ vadd (runId $ eval c1) (runId $ eval c2)
where
fixup (N z) = nval0 z
fixup (_) = err0
-- | Evaluate and print the cellFns here is the LOEB!
--recalcSheet :: Sheet CellFn -> Sheet String
--recalcSheet fs = fmap (show.runId.eval) $ loeb fs
--recalcSheet = recalc
-- | We need to get the refs from a CellFn before the loeb because loeb calcs the
-- references. I wonder if we could get a function similar to loeb to calculate
-- the circular references?
-- | Create an initial sheet - with numbers in it | 590 | fcadd :: Fix Cell -> Fix Cell -> Fix Cell
fcadd c1 c2 = fixup $ vadd (runId $ eval c1) (runId $ eval c2)
where
fixup (N z) = nval0 z
fixup (_) = err0
-- | Evaluate and print the cellFns here is the LOEB!
--recalcSheet :: Sheet CellFn -> Sheet String
--recalcSheet fs = fmap (show.runId.eval) $ loeb fs
--recalcSheet = recalc
-- | We need to get the refs from a CellFn before the loeb because loeb calcs the
-- references. I wonder if we could get a function similar to loeb to calculate
-- the circular references?
-- | Create an initial sheet - with numbers in it | 590 | fcadd c1 c2 = fixup $ vadd (runId $ eval c1) (runId $ eval c2)
where
fixup (N z) = nval0 z
fixup (_) = err0
-- | Evaluate and print the cellFns here is the LOEB!
--recalcSheet :: Sheet CellFn -> Sheet String
--recalcSheet fs = fmap (show.runId.eval) $ loeb fs
--recalcSheet = recalc
-- | We need to get the refs from a CellFn before the loeb because loeb calcs the
-- references. I wonder if we could get a function similar to loeb to calculate
-- the circular references?
-- | Create an initial sheet - with numbers in it | 548 | false | true | 2 | 8 | 138 | 110 | 53 | 57 | null | null |
mxswd/language-objc-edsl | src/UIKit.hs | bsd-2-clause | -- "pure", but really a pre-req to the code generator
contentView :: Bind Global TTrue NSView
contentView = Bind "contentView" FNSView | 134 | contentView :: Bind Global TTrue NSView
contentView = Bind "contentView" FNSView | 80 | contentView = Bind "contentView" FNSView | 40 | true | true | 0 | 5 | 20 | 24 | 12 | 12 | null | null |
SAdams601/ParRegexSearch | test/fst-0.9.0.1/FST/MinimalBrzozowski.hs | mit | minimize :: Ord a => Automaton a -> Automaton a
minimize = determinize.reversal.determinize.reversal | 100 | minimize :: Ord a => Automaton a -> Automaton a
minimize = determinize.reversal.determinize.reversal | 100 | minimize = determinize.reversal.determinize.reversal | 52 | false | true | 2 | 8 | 12 | 48 | 19 | 29 | null | null |
tdidriksen/copatterns | src/findus/typechecker.hs | mit | getTypeAnno (TEFold t _ ) = t | 38 | getTypeAnno (TEFold t _ ) = t | 38 | getTypeAnno (TEFold t _ ) = t | 38 | false | false | 0 | 6 | 15 | 18 | 8 | 10 | null | null |
jeroenk/iTRSsVisualised | DrawReduction.hs | agpl-3.0 | getColor' :: (Signature s, Variables v)
=> Symbol s v -> [SymbolColor s v] -> StdGen
-> (Color4 GLfloat, Color4 GLfloat, [SymbolColor s v], StdGen)
getColor' f [] gen
= (new_col_b, new_col_w, [(f, new_col_b, new_col_w)], new_gen)
where (new_col_b, new_col_w, new_gen) = newColor gen | 301 | getColor' :: (Signature s, Variables v)
=> Symbol s v -> [SymbolColor s v] -> StdGen
-> (Color4 GLfloat, Color4 GLfloat, [SymbolColor s v], StdGen)
getColor' f [] gen
= (new_col_b, new_col_w, [(f, new_col_b, new_col_w)], new_gen)
where (new_col_b, new_col_w, new_gen) = newColor gen | 301 | getColor' f [] gen
= (new_col_b, new_col_w, [(f, new_col_b, new_col_w)], new_gen)
where (new_col_b, new_col_w, new_gen) = newColor gen | 142 | false | true | 0 | 11 | 61 | 130 | 71 | 59 | null | null |
keithodulaigh/Hets | OWL2/AS.hs | gpl-2.0 | -- | show QName as abbreviated iri
showQU :: QName -> String
showQU (QN pre local _ _ _) =
if null pre then local else pre ++ ":" ++ local | 142 | showQU :: QName -> String
showQU (QN pre local _ _ _) =
if null pre then local else pre ++ ":" ++ local | 107 | showQU (QN pre local _ _ _) =
if null pre then local else pre ++ ":" ++ local | 81 | true | true | 2 | 9 | 34 | 58 | 28 | 30 | null | null |
weissi/diplomarbeit | test/TestF2Pow256.hs | gpl-3.0 | prop_readParsesShow :: Element -> Bool
prop_readParsesShow e = e == (f2Pow256FromString (show e)) | 97 | prop_readParsesShow :: Element -> Bool
prop_readParsesShow e = e == (f2Pow256FromString (show e)) | 97 | prop_readParsesShow e = e == (f2Pow256FromString (show e)) | 58 | false | true | 0 | 9 | 12 | 34 | 17 | 17 | null | null |
olorin/amazonka | amazonka-devicefarm/gen/Network/AWS/DeviceFarm/ScheduleRun.hs | mpl-2.0 | -- | The ARN of the project for the run to be scheduled.
srProjectARN :: Lens' ScheduleRun Text
srProjectARN = lens _srProjectARN (\ s a -> s{_srProjectARN = a}) | 161 | srProjectARN :: Lens' ScheduleRun Text
srProjectARN = lens _srProjectARN (\ s a -> s{_srProjectARN = a}) | 104 | srProjectARN = lens _srProjectARN (\ s a -> s{_srProjectARN = a}) | 65 | true | true | 1 | 9 | 28 | 45 | 22 | 23 | null | null |
brendanhay/numbersd | src/Numbers/Http.hs | mpl-2.0 | getFormat :: Request -> Format
getFormat req = case maybeParams format req of
Just (x:_) -> x
_ -> Raw
where
format ("format", Just "raw") = Just Raw
format ("format", Just "json") = Just Json
format _ = Nothing | 265 | getFormat :: Request -> Format
getFormat req = case maybeParams format req of
Just (x:_) -> x
_ -> Raw
where
format ("format", Just "raw") = Just Raw
format ("format", Just "json") = Just Json
format _ = Nothing | 265 | getFormat req = case maybeParams format req of
Just (x:_) -> x
_ -> Raw
where
format ("format", Just "raw") = Just Raw
format ("format", Just "json") = Just Json
format _ = Nothing | 234 | false | true | 2 | 7 | 92 | 99 | 49 | 50 | null | null |
shlevy/ghc | compiler/deSugar/DsArrows.hs | bsd-3-clause | add_ev_bndr :: EvBind -> [Id] -> [Id]
add_ev_bndr (EvBind { eb_lhs = b }) bs | isId b = b:bs
| otherwise = bs | 151 | add_ev_bndr :: EvBind -> [Id] -> [Id]
add_ev_bndr (EvBind { eb_lhs = b }) bs | isId b = b:bs
| otherwise = bs | 151 | add_ev_bndr (EvBind { eb_lhs = b }) bs | isId b = b:bs
| otherwise = bs | 113 | false | true | 0 | 9 | 65 | 64 | 32 | 32 | null | null |
urbanslug/ghc | testsuite/tests/perf/compiler/T783.hs | bsd-3-clause | foo x | x == 373 = 373 | 22 | foo x | x == 373 = 373 | 22 | foo x | x == 373 = 373 | 22 | false | false | 0 | 8 | 7 | 23 | 9 | 14 | null | null |
rfranek/duckling | Duckling/Dimensions.hs | bsd-3-clause | langDimensions CS = CSDimensions.allDimensions | 46 | langDimensions CS = CSDimensions.allDimensions | 46 | langDimensions CS = CSDimensions.allDimensions | 46 | false | false | 0 | 5 | 3 | 11 | 5 | 6 | null | null |
ahushh/Monaba | monaba/src/Utils/YobaMarkup.hs | mit | tagWakaba :: ([Expr] -> Expr) -> String -> Parsec Text () Expr
tagWakaba f name = do
void $ string name
content <- many expr
void $ string name
return $ f content | 171 | tagWakaba :: ([Expr] -> Expr) -> String -> Parsec Text () Expr
tagWakaba f name = do
void $ string name
content <- many expr
void $ string name
return $ f content | 171 | tagWakaba f name = do
void $ string name
content <- many expr
void $ string name
return $ f content | 108 | false | true | 0 | 9 | 41 | 88 | 39 | 49 | null | null |
diku-dk/futhark | src/Futhark/Util.hs | isc | -- | The system-level @tgammaf()@ function.
tgammaf :: Float -> Float
tgammaf = c_tgammaf | 89 | tgammaf :: Float -> Float
tgammaf = c_tgammaf | 45 | tgammaf = c_tgammaf | 19 | true | true | 0 | 5 | 13 | 16 | 9 | 7 | null | null |
dirkz/google-code-jam-haskell | practice/src/AlienLanguage.hs | mpl-2.0 | eol :: GenParser Char st ()
eol = char '\n' >> return () | 56 | eol :: GenParser Char st ()
eol = char '\n' >> return () | 56 | eol = char '\n' >> return () | 28 | false | true | 0 | 7 | 12 | 32 | 15 | 17 | null | null |
GaloisInc/galua | galua-rts/src/Galua/Util/SizedVector.hs | mit | popN :: SizedVector a -> Int -> IO (SmallVec a)
popN (SizedVector ref) len0 =
do SizedVector' { .. } <- readIORef ref
let len = max 0 (min len0 svCount)
from = svCount - len
v <- SMV.freeze (IOVector.unsafeSlice from len svArray)
for_ [ from .. svCount - 1] $ \i ->
IOVector.unsafeWrite svArray i (error "uninitialized")
writeIORef ref $! SizedVector' { svCount = svCount - len, .. }
return v | 436 | popN :: SizedVector a -> Int -> IO (SmallVec a)
popN (SizedVector ref) len0 =
do SizedVector' { .. } <- readIORef ref
let len = max 0 (min len0 svCount)
from = svCount - len
v <- SMV.freeze (IOVector.unsafeSlice from len svArray)
for_ [ from .. svCount - 1] $ \i ->
IOVector.unsafeWrite svArray i (error "uninitialized")
writeIORef ref $! SizedVector' { svCount = svCount - len, .. }
return v | 436 | popN (SizedVector ref) len0 =
do SizedVector' { .. } <- readIORef ref
let len = max 0 (min len0 svCount)
from = svCount - len
v <- SMV.freeze (IOVector.unsafeSlice from len svArray)
for_ [ from .. svCount - 1] $ \i ->
IOVector.unsafeWrite svArray i (error "uninitialized")
writeIORef ref $! SizedVector' { svCount = svCount - len, .. }
return v | 388 | false | true | 0 | 13 | 115 | 189 | 89 | 100 | null | null |
rueshyna/gogol | gogol-maps-coordinate/gen/Network/Google/Resource/Coordinate/Schedule/Update.hs | mpl-2.0 | -- | Whether the job is scheduled for the whole day. Time of day in
-- start\/end times is ignored if this is true.
suAllDay :: Lens' ScheduleUpdate (Maybe Bool)
suAllDay = lens _suAllDay (\ s a -> s{_suAllDay = a}) | 215 | suAllDay :: Lens' ScheduleUpdate (Maybe Bool)
suAllDay = lens _suAllDay (\ s a -> s{_suAllDay = a}) | 99 | suAllDay = lens _suAllDay (\ s a -> s{_suAllDay = a}) | 53 | true | true | 0 | 9 | 40 | 47 | 26 | 21 | null | null |
brendanhay/gogol | gogol-androidmanagement/gen/Network/Google/AndroidManagement/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'EnrollmentToken' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'etPolicyName'
--
-- * 'etValue'
--
-- * 'etQrCode'
--
-- * 'etAdditionalData'
--
-- * 'etUser'
--
-- * 'etAllowPersonalUsage'
--
-- * 'etName'
--
-- * 'etOneTimeOnly'
--
-- * 'etExpirationTimestamp'
--
-- * 'etDuration'
enrollmentToken
:: EnrollmentToken
enrollmentToken =
EnrollmentToken'
{ _etPolicyName = Nothing
, _etValue = Nothing
, _etQrCode = Nothing
, _etAdditionalData = Nothing
, _etUser = Nothing
, _etAllowPersonalUsage = Nothing
, _etName = Nothing
, _etOneTimeOnly = Nothing
, _etExpirationTimestamp = Nothing
, _etDuration = Nothing
} | 776 | enrollmentToken
:: EnrollmentToken
enrollmentToken =
EnrollmentToken'
{ _etPolicyName = Nothing
, _etValue = Nothing
, _etQrCode = Nothing
, _etAdditionalData = Nothing
, _etUser = Nothing
, _etAllowPersonalUsage = Nothing
, _etName = Nothing
, _etOneTimeOnly = Nothing
, _etExpirationTimestamp = Nothing
, _etDuration = Nothing
} | 380 | enrollmentToken =
EnrollmentToken'
{ _etPolicyName = Nothing
, _etValue = Nothing
, _etQrCode = Nothing
, _etAdditionalData = Nothing
, _etUser = Nothing
, _etAllowPersonalUsage = Nothing
, _etName = Nothing
, _etOneTimeOnly = Nothing
, _etExpirationTimestamp = Nothing
, _etDuration = Nothing
} | 341 | true | true | 0 | 7 | 166 | 106 | 72 | 34 | null | null |
rahulmutt/ghcvm | compiler/Eta/Prelude/PrimOp.hs | bsd-3-clause | primOpOutOfLine RaiseIOOp = True | 32 | primOpOutOfLine RaiseIOOp = True | 32 | primOpOutOfLine RaiseIOOp = True | 32 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
banacorn/agda-language-server | src/Agda/Convert.hs | mit | prettyResponseContext ::
-- | Context of this meta-variable.
InteractionId ->
ResponseContextEntry ->
TCM [(String, Doc)]
prettyResponseContext ii (ResponseContextEntry n x (Arg ai expr) letv nis) = withInteractionId ii $ do
modality <- asksTC getModality
do
let prettyCtxName :: String
prettyCtxName
| n == x = prettyShow x
| isInScope n == InScope = prettyShow n ++ " = " ++ prettyShow x
| otherwise = prettyShow x
-- Some attributes are useful to report whenever they are not
-- in the default state.
attribute :: String
attribute = c ++ if null c then "" else " "
where
c = prettyShow (getCohesion ai)
extras :: [Doc]
extras =
concat
[ ["not in scope" | isInScope nis == C.NotInScope],
-- Print erased if hypothesis is erased by goal is non-erased.
["erased" | not $ getQuantity ai `moreQuantity` getQuantity modality],
-- Print irrelevant if hypothesis is strictly less relevant than goal.
["irrelevant" | not $ getRelevance ai `moreRelevant` getRelevance modality],
-- Print instance if variable is considered by instance search
["instance" | isInstance ai]
]
ty <- prettyATop expr
letv' <- case letv of
Nothing -> return []
Just val -> do
val' <- prettyATop val
return [(prettyShow x, "=" <+> val')]
return $
(attribute ++ prettyCtxName, ":" <+> ty <+> parenSep extras) : letv'
where
parenSep :: [Doc] -> Doc
parenSep docs
| null docs = empty
| otherwise = (" " <+>) $ parens $ fsep $ punctuate comma docs
-- | Render the context of the given meta-variable. | 1,779 | prettyResponseContext ::
-- | Context of this meta-variable.
InteractionId ->
ResponseContextEntry ->
TCM [(String, Doc)]
prettyResponseContext ii (ResponseContextEntry n x (Arg ai expr) letv nis) = withInteractionId ii $ do
modality <- asksTC getModality
do
let prettyCtxName :: String
prettyCtxName
| n == x = prettyShow x
| isInScope n == InScope = prettyShow n ++ " = " ++ prettyShow x
| otherwise = prettyShow x
-- Some attributes are useful to report whenever they are not
-- in the default state.
attribute :: String
attribute = c ++ if null c then "" else " "
where
c = prettyShow (getCohesion ai)
extras :: [Doc]
extras =
concat
[ ["not in scope" | isInScope nis == C.NotInScope],
-- Print erased if hypothesis is erased by goal is non-erased.
["erased" | not $ getQuantity ai `moreQuantity` getQuantity modality],
-- Print irrelevant if hypothesis is strictly less relevant than goal.
["irrelevant" | not $ getRelevance ai `moreRelevant` getRelevance modality],
-- Print instance if variable is considered by instance search
["instance" | isInstance ai]
]
ty <- prettyATop expr
letv' <- case letv of
Nothing -> return []
Just val -> do
val' <- prettyATop val
return [(prettyShow x, "=" <+> val')]
return $
(attribute ++ prettyCtxName, ":" <+> ty <+> parenSep extras) : letv'
where
parenSep :: [Doc] -> Doc
parenSep docs
| null docs = empty
| otherwise = (" " <+>) $ parens $ fsep $ punctuate comma docs
-- | Render the context of the given meta-variable. | 1,779 | prettyResponseContext ii (ResponseContextEntry n x (Arg ai expr) letv nis) = withInteractionId ii $ do
modality <- asksTC getModality
do
let prettyCtxName :: String
prettyCtxName
| n == x = prettyShow x
| isInScope n == InScope = prettyShow n ++ " = " ++ prettyShow x
| otherwise = prettyShow x
-- Some attributes are useful to report whenever they are not
-- in the default state.
attribute :: String
attribute = c ++ if null c then "" else " "
where
c = prettyShow (getCohesion ai)
extras :: [Doc]
extras =
concat
[ ["not in scope" | isInScope nis == C.NotInScope],
-- Print erased if hypothesis is erased by goal is non-erased.
["erased" | not $ getQuantity ai `moreQuantity` getQuantity modality],
-- Print irrelevant if hypothesis is strictly less relevant than goal.
["irrelevant" | not $ getRelevance ai `moreRelevant` getRelevance modality],
-- Print instance if variable is considered by instance search
["instance" | isInstance ai]
]
ty <- prettyATop expr
letv' <- case letv of
Nothing -> return []
Just val -> do
val' <- prettyATop val
return [(prettyShow x, "=" <+> val')]
return $
(attribute ++ prettyCtxName, ":" <+> ty <+> parenSep extras) : letv'
where
parenSep :: [Doc] -> Doc
parenSep docs
| null docs = empty
| otherwise = (" " <+>) $ parens $ fsep $ punctuate comma docs
-- | Render the context of the given meta-variable. | 1,649 | false | true | 2 | 19 | 564 | 474 | 233 | 241 | null | null |
ihc/futhark | src/Futhark/Representation/Primitive.hs | isc | primValueType (FloatValue v) = FloatType $ floatValueType v | 59 | primValueType (FloatValue v) = FloatType $ floatValueType v | 59 | primValueType (FloatValue v) = FloatType $ floatValueType v | 59 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
nomeata/ghc | compiler/main/DriverPhases.hs | bsd-3-clause | isDynLibSuffix s = s `elem` dynlib_suffixes | 51 | isDynLibSuffix s = s `elem` dynlib_suffixes | 51 | isDynLibSuffix s = s `elem` dynlib_suffixes | 51 | false | false | 0 | 5 | 13 | 15 | 8 | 7 | null | null |
aburnett88/HSat | tests-src/TestUtils.hs | mit | testList a (x:xs) = checkBounds x a .&&. testList a xs | 54 | testList a (x:xs) = checkBounds x a .&&. testList a xs | 54 | testList a (x:xs) = checkBounds x a .&&. testList a xs | 54 | false | false | 0 | 6 | 10 | 34 | 15 | 19 | null | null |
shlevy/ghc | compiler/nativeGen/SPARC/CodeGen.hs | bsd-3-clause | -- -----------------------------------------------------------------------------
-- Conditional jumps
{-
Conditional jumps are always to local labels, so we can use branch
instructions. We peek at the arguments to decide what kind of
comparison to do.
SPARC: First, we have to ensure that the condition codes are set
according to the supplied comparison operation. We generate slightly
different code for floating point comparisons, because a floating
point operation cannot directly precede a @BF@. We assume the worst
and fill that slot with a @NOP@.
SPARC: Do not fill the delay slots here; you will confuse the register
allocator.
-}
genCondJump
:: BlockId -- the branch target
-> CmmExpr -- the condition on which to branch
-> NatM InstrBlock
genCondJump bid bool = do
CondCode is_float cond code <- getCondCode bool
return (
code `appOL`
toOL (
if is_float
then [NOP, BF cond False bid, NOP]
else [BI cond False bid, NOP]
)
)
-- -----------------------------------------------------------------------------
-- Generating a table-branch | 1,136 | genCondJump
:: BlockId -- the branch target
-> CmmExpr -- the condition on which to branch
-> NatM InstrBlock
genCondJump bid bool = do
CondCode is_float cond code <- getCondCode bool
return (
code `appOL`
toOL (
if is_float
then [NOP, BF cond False bid, NOP]
else [BI cond False bid, NOP]
)
)
-- -----------------------------------------------------------------------------
-- Generating a table-branch | 486 | genCondJump bid bool = do
CondCode is_float cond code <- getCondCode bool
return (
code `appOL`
toOL (
if is_float
then [NOP, BF cond False bid, NOP]
else [BI cond False bid, NOP]
)
)
-- -----------------------------------------------------------------------------
-- Generating a table-branch | 354 | true | true | 0 | 15 | 249 | 114 | 60 | 54 | null | null |
rekka/stack | src/main/Main.hs | bsd-3-clause | uninstallCmd :: [String] -> GlobalOpts -> IO ()
uninstallCmd _ go = withConfigAndLock go $ do
$logError "stack does not manage installations in global locations"
$logError "The only global mutation stack performs is executable copying"
$logError "For the default executable destination, please run 'stack path --local-bin-path'"
-- | Unpack packages to the filesystem | 380 | uninstallCmd :: [String] -> GlobalOpts -> IO ()
uninstallCmd _ go = withConfigAndLock go $ do
$logError "stack does not manage installations in global locations"
$logError "The only global mutation stack performs is executable copying"
$logError "For the default executable destination, please run 'stack path --local-bin-path'"
-- | Unpack packages to the filesystem | 380 | uninstallCmd _ go = withConfigAndLock go $ do
$logError "stack does not manage installations in global locations"
$logError "The only global mutation stack performs is executable copying"
$logError "For the default executable destination, please run 'stack path --local-bin-path'"
-- | Unpack packages to the filesystem | 332 | false | true | 0 | 9 | 65 | 61 | 26 | 35 | null | null |
erithion/duo-memo | ParserTest.hs | mit | tempEscape '\r' = "_" | 21 | tempEscape '\r' = "_" | 21 | tempEscape '\r' = "_" | 21 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
visood/bioalgo | src/lib/Util/Util.hs | bsd-3-clause | hamdist [] ys = length ys | 25 | hamdist [] ys = length ys | 25 | hamdist [] ys = length ys | 25 | false | false | 1 | 5 | 5 | 21 | 7 | 14 | null | null |
bb010g/aura | aura/lib/Aura/Install.hs | gpl-3.0 | reportListOfDeps :: [Prebuilt] -> [NonEmpty Buildable] -> IO ()
reportListOfDeps rps bps = f (map pName rps) *> f (map bName $ foldMap NEL.toList bps)
where
f :: [PkgName] -> IO ()
f = traverse_ putTextLn . L.sort . map pnName | 236 | reportListOfDeps :: [Prebuilt] -> [NonEmpty Buildable] -> IO ()
reportListOfDeps rps bps = f (map pName rps) *> f (map bName $ foldMap NEL.toList bps)
where
f :: [PkgName] -> IO ()
f = traverse_ putTextLn . L.sort . map pnName | 236 | reportListOfDeps rps bps = f (map pName rps) *> f (map bName $ foldMap NEL.toList bps)
where
f :: [PkgName] -> IO ()
f = traverse_ putTextLn . L.sort . map pnName | 172 | false | true | 2 | 10 | 50 | 114 | 55 | 59 | null | null |
ihc/futhark | src/Futhark/Representation/Primitive.hs | isc | -- | True if signed. Only makes a difference for integer types.
prettySigned :: Bool -> PrimType -> String
prettySigned True (IntType it) = 'u' : drop 1 (pretty it) | 165 | prettySigned :: Bool -> PrimType -> String
prettySigned True (IntType it) = 'u' : drop 1 (pretty it) | 100 | prettySigned True (IntType it) = 'u' : drop 1 (pretty it) | 57 | true | true | 0 | 8 | 30 | 46 | 23 | 23 | null | null |
michaelmelanson/cminus-compiler | Compiler/Parser.hs | bsd-2-clause | -- |The top parser. This parses an entire C-Minus source file
program = do { whiteSpace
; syms <- many1 toplevel_decl
; return $ Program syms
} | 198 | program = do { whiteSpace
; syms <- many1 toplevel_decl
; return $ Program syms
} | 132 | program = do { whiteSpace
; syms <- many1 toplevel_decl
; return $ Program syms
} | 132 | true | false | 1 | 9 | 81 | 38 | 17 | 21 | null | null |
edsko/cabal | cabal-install/Distribution/Client/GlobalFlags.hs | bsd-3-clause | initSecureRepo :: Verbosity
-> Sec.HTTP.HttpLib
-> RemoteRepo -- ^ Secure repo ('remoteRepoSecure' assumed)
-> Sec.Path Sec.Absolute -- ^ Cache dir
-> (SecureRepo -> IO a) -- ^ Callback
-> IO a
initSecureRepo verbosity httpLib RemoteRepo{..} cachePath = \callback -> do
withRepo $ \r -> do
requiresBootstrap <- Sec.requiresBootstrap r
when requiresBootstrap $ Sec.uncheckClientErrors $
Sec.bootstrap r
(map Sec.KeyId remoteRepoRootKeys)
(Sec.KeyThreshold (fromIntegral remoteRepoKeyThreshold))
callback $ SecureRepo r
where
-- Initialize local or remote repo depending on the URI
withRepo :: (forall down. Sec.Repository down -> IO a) -> IO a
withRepo callback | uriScheme remoteRepoURI == "file:" = do
dir <- Sec.makeAbsolute $ Sec.fromFilePath (uriPath remoteRepoURI)
Sec.Local.withRepository dir
cache
Sec.hackageRepoLayout
Sec.hackageIndexLayout
logTUF
callback
withRepo callback =
Sec.Remote.withRepository httpLib
[remoteRepoURI]
Sec.Remote.defaultRepoOpts
cache
Sec.hackageRepoLayout
Sec.hackageIndexLayout
logTUF
callback
cache :: Sec.Cache
cache = Sec.Cache {
cacheRoot = cachePath
, cacheLayout = Sec.cabalCacheLayout
}
-- We display any TUF progress only in verbose mode, including any transient
-- verification errors. If verification fails, then the final exception that
-- is thrown will of course be shown.
logTUF :: Sec.LogMessage -> IO ()
logTUF = info verbosity . Sec.pretty | 1,989 | initSecureRepo :: Verbosity
-> Sec.HTTP.HttpLib
-> RemoteRepo -- ^ Secure repo ('remoteRepoSecure' assumed)
-> Sec.Path Sec.Absolute -- ^ Cache dir
-> (SecureRepo -> IO a) -- ^ Callback
-> IO a
initSecureRepo verbosity httpLib RemoteRepo{..} cachePath = \callback -> do
withRepo $ \r -> do
requiresBootstrap <- Sec.requiresBootstrap r
when requiresBootstrap $ Sec.uncheckClientErrors $
Sec.bootstrap r
(map Sec.KeyId remoteRepoRootKeys)
(Sec.KeyThreshold (fromIntegral remoteRepoKeyThreshold))
callback $ SecureRepo r
where
-- Initialize local or remote repo depending on the URI
withRepo :: (forall down. Sec.Repository down -> IO a) -> IO a
withRepo callback | uriScheme remoteRepoURI == "file:" = do
dir <- Sec.makeAbsolute $ Sec.fromFilePath (uriPath remoteRepoURI)
Sec.Local.withRepository dir
cache
Sec.hackageRepoLayout
Sec.hackageIndexLayout
logTUF
callback
withRepo callback =
Sec.Remote.withRepository httpLib
[remoteRepoURI]
Sec.Remote.defaultRepoOpts
cache
Sec.hackageRepoLayout
Sec.hackageIndexLayout
logTUF
callback
cache :: Sec.Cache
cache = Sec.Cache {
cacheRoot = cachePath
, cacheLayout = Sec.cabalCacheLayout
}
-- We display any TUF progress only in verbose mode, including any transient
-- verification errors. If verification fails, then the final exception that
-- is thrown will of course be shown.
logTUF :: Sec.LogMessage -> IO ()
logTUF = info verbosity . Sec.pretty | 1,989 | initSecureRepo verbosity httpLib RemoteRepo{..} cachePath = \callback -> do
withRepo $ \r -> do
requiresBootstrap <- Sec.requiresBootstrap r
when requiresBootstrap $ Sec.uncheckClientErrors $
Sec.bootstrap r
(map Sec.KeyId remoteRepoRootKeys)
(Sec.KeyThreshold (fromIntegral remoteRepoKeyThreshold))
callback $ SecureRepo r
where
-- Initialize local or remote repo depending on the URI
withRepo :: (forall down. Sec.Repository down -> IO a) -> IO a
withRepo callback | uriScheme remoteRepoURI == "file:" = do
dir <- Sec.makeAbsolute $ Sec.fromFilePath (uriPath remoteRepoURI)
Sec.Local.withRepository dir
cache
Sec.hackageRepoLayout
Sec.hackageIndexLayout
logTUF
callback
withRepo callback =
Sec.Remote.withRepository httpLib
[remoteRepoURI]
Sec.Remote.defaultRepoOpts
cache
Sec.hackageRepoLayout
Sec.hackageIndexLayout
logTUF
callback
cache :: Sec.Cache
cache = Sec.Cache {
cacheRoot = cachePath
, cacheLayout = Sec.cabalCacheLayout
}
-- We display any TUF progress only in verbose mode, including any transient
-- verification errors. If verification fails, then the final exception that
-- is thrown will of course be shown.
logTUF :: Sec.LogMessage -> IO ()
logTUF = info verbosity . Sec.pretty | 1,718 | false | true | 0 | 17 | 779 | 365 | 183 | 182 | null | null |
bitemyapp/ghc | compiler/deSugar/DsArrows.hs | bsd-3-clause | coreCaseTuple :: UniqSupply -> Id -> [Id] -> CoreExpr -> CoreExpr
coreCaseTuple uniqs scrut_var vars body
= mkTupleCase uniqs vars body scrut_var (Var scrut_var) | 163 | coreCaseTuple :: UniqSupply -> Id -> [Id] -> CoreExpr -> CoreExpr
coreCaseTuple uniqs scrut_var vars body
= mkTupleCase uniqs vars body scrut_var (Var scrut_var) | 163 | coreCaseTuple uniqs scrut_var vars body
= mkTupleCase uniqs vars body scrut_var (Var scrut_var) | 97 | false | true | 0 | 8 | 25 | 56 | 28 | 28 | null | null |
seppeljordan/hichachoe | Input.hs | gpl-3.0 | charToInt '1' = return 1 | 24 | charToInt '1' = return 1 | 24 | charToInt '1' = return 1 | 24 | false | false | 1 | 5 | 4 | 16 | 5 | 11 | null | null |
nevrenato/Hets_Fork | HasCASL/Sublogic.hs | gpl-2.0 | sl_datatypeDecl :: DatatypeDecl -> Sublogic
sl_datatypeDecl (DatatypeDecl t k l c _) = comp_list $
[ if null c then bottom else simpleTypeClasses
, sl_typePattern t
, sl_kind k ] ++ map (sl_alternative . item) l | 223 | sl_datatypeDecl :: DatatypeDecl -> Sublogic
sl_datatypeDecl (DatatypeDecl t k l c _) = comp_list $
[ if null c then bottom else simpleTypeClasses
, sl_typePattern t
, sl_kind k ] ++ map (sl_alternative . item) l | 223 | sl_datatypeDecl (DatatypeDecl t k l c _) = comp_list $
[ if null c then bottom else simpleTypeClasses
, sl_typePattern t
, sl_kind k ] ++ map (sl_alternative . item) l | 179 | false | true | 2 | 8 | 47 | 84 | 41 | 43 | null | null |
romanb/amazonka | amazonka-elastictranscoder/gen/Network/AWS/ElasticTranscoder/ListPipelines.hs | mpl-2.0 | -- | An array of 'Pipeline' objects.
lprPipelines :: Lens' ListPipelinesResponse [Pipeline]
lprPipelines = lens _lprPipelines (\s a -> s { _lprPipelines = a }) . _List | 167 | lprPipelines :: Lens' ListPipelinesResponse [Pipeline]
lprPipelines = lens _lprPipelines (\s a -> s { _lprPipelines = a }) . _List | 130 | lprPipelines = lens _lprPipelines (\s a -> s { _lprPipelines = a }) . _List | 75 | true | true | 1 | 10 | 26 | 51 | 26 | 25 | null | null |
NorfairKing/sus-depot | shared/shared/xmonad/dvorak.lenovo/xmonad.hs | gpl-2.0 | main :: IO()
main =
xmonad $ withUrgencyHook NoUrgencyHook $ azertyConfig {
focusedBorderColor = colorMain
, normalBorderColor = colorSecondary
, borderWidth = myBorderWidth
, terminal = myTerminal
, workspaces = myWorkspaces
, modMask = mod
, keys = myKeys
, mouseBindings = myMouse
, handleEventHook = fullscreenEventHook
, startupHook = myStartupHook
, manageHook = myManageHook
, layoutHook = myLayoutHook
, focusFollowsMouse = False
} | 471 | main :: IO()
main =
xmonad $ withUrgencyHook NoUrgencyHook $ azertyConfig {
focusedBorderColor = colorMain
, normalBorderColor = colorSecondary
, borderWidth = myBorderWidth
, terminal = myTerminal
, workspaces = myWorkspaces
, modMask = mod
, keys = myKeys
, mouseBindings = myMouse
, handleEventHook = fullscreenEventHook
, startupHook = myStartupHook
, manageHook = myManageHook
, layoutHook = myLayoutHook
, focusFollowsMouse = False
} | 471 | main =
xmonad $ withUrgencyHook NoUrgencyHook $ azertyConfig {
focusedBorderColor = colorMain
, normalBorderColor = colorSecondary
, borderWidth = myBorderWidth
, terminal = myTerminal
, workspaces = myWorkspaces
, modMask = mod
, keys = myKeys
, mouseBindings = myMouse
, handleEventHook = fullscreenEventHook
, startupHook = myStartupHook
, manageHook = myManageHook
, layoutHook = myLayoutHook
, focusFollowsMouse = False
} | 458 | false | true | 0 | 7 | 95 | 107 | 66 | 41 | null | null |
ssaavedra/liquidhaskell | benchmarks/llrbtree-0.1.1/Data/Set/RBTree0.hs | bsd-3-clause | turnB' (Node _ h l x r) = Node B h l x r | 40 | turnB' (Node _ h l x r) = Node B h l x r | 40 | turnB' (Node _ h l x r) = Node B h l x r | 40 | false | false | 0 | 7 | 13 | 34 | 16 | 18 | null | null |
antalsz/hs-to-coq | examples/graph/graph/Data/Graph/Inductive/NodeMap.hs | mit | mkEdgeM :: (Ord a) => (a, a, b) -> NodeMapM a b g (Maybe (LEdge b))
mkEdgeM = liftN2' mkEdge | 92 | mkEdgeM :: (Ord a) => (a, a, b) -> NodeMapM a b g (Maybe (LEdge b))
mkEdgeM = liftN2' mkEdge | 92 | mkEdgeM = liftN2' mkEdge | 24 | false | true | 0 | 11 | 19 | 57 | 30 | 27 | null | null |
antalsz/hs-to-coq | src/lib/HsToCoq/ConvertHaskell/Monad.hs | mit | genqid :: LocalConvMonad r m => Text -> m Qualid
genqid name = Bare <$> gensym name | 83 | genqid :: LocalConvMonad r m => Text -> m Qualid
genqid name = Bare <$> gensym name | 83 | genqid name = Bare <$> gensym name | 34 | false | true | 0 | 8 | 16 | 41 | 18 | 23 | null | null |
Noeda/adeonbot | terminal-emulator/src/Terminal/Pty.hs | mit | closePHandle :: PHandle -> IO ()
closePHandle (PHandle mvar) = mask_ $ modifyMVar_ mvar $ \case
Nothing -> return Nothing
Just pid -> do
signalProcessGroup sigKILL pid
void $ getProcessStatus True False pid
return Nothing | 237 | closePHandle :: PHandle -> IO ()
closePHandle (PHandle mvar) = mask_ $ modifyMVar_ mvar $ \case
Nothing -> return Nothing
Just pid -> do
signalProcessGroup sigKILL pid
void $ getProcessStatus True False pid
return Nothing | 237 | closePHandle (PHandle mvar) = mask_ $ modifyMVar_ mvar $ \case
Nothing -> return Nothing
Just pid -> do
signalProcessGroup sigKILL pid
void $ getProcessStatus True False pid
return Nothing | 204 | false | true | 0 | 13 | 50 | 93 | 40 | 53 | null | null |
cameronbwhite/RelationalAlgebra | src/RAExpr/RASet.hs | mit | -- | Project the column names on to a set.
-- >>> project (Set.singleton "a") (fromList ["a", "b"] [Row.singleton "a" "x", Row.singleton "b" "y"])
-- fromList ["a"] [fromList [("a","x")]]
project:: (Ord names, Ord values) => Names names -> RASet names values -> RASet names values
project attributes (RASet _ rows) = fromSet attributes rows | 340 | project:: (Ord names, Ord values) => Names names -> RASet names values -> RASet names values
project attributes (RASet _ rows) = fromSet attributes rows | 152 | project attributes (RASet _ rows) = fromSet attributes rows | 59 | true | true | 0 | 8 | 53 | 74 | 35 | 39 | null | null |
jeffreyrosenbluth/flourine | src/Fluorine/HTML/Attributes.hs | bsd-3-clause | charset :: String -> Attr i
charset = attr $ attributeName "charset" | 68 | charset :: String -> Attr i
charset = attr $ attributeName "charset" | 68 | charset = attr $ attributeName "charset" | 40 | false | true | 2 | 7 | 11 | 32 | 13 | 19 | null | null |
seereason/HJScript | src/HJScript/Utils.hs | bsd-3-clause | --------------------------------------------------------------------------------
-- Pure functions
--------------------------------------------------------------------------------
elemById :: IsJString e => e -> Exp ElementNode
elemById id = document # getElementById (toJString id) | 282 | elemById :: IsJString e => e -> Exp ElementNode
elemById id = document # getElementById (toJString id) | 102 | elemById id = document # getElementById (toJString id) | 54 | true | true | 0 | 8 | 21 | 44 | 22 | 22 | null | null |
phischu/fragnix | builtins/ghc-prim/GHC.Prim.hs | bsd-3-clause | -- | Add two vectors element-wise.
plusInt16X16# :: Int16X16# -> Int16X16# -> Int16X16#
plusInt16X16# = plusInt16X16# | 119 | plusInt16X16# :: Int16X16# -> Int16X16# -> Int16X16#
plusInt16X16# = plusInt16X16# | 82 | plusInt16X16# = plusInt16X16# | 29 | true | true | 0 | 8 | 17 | 27 | 12 | 15 | null | null |
nkaretnikov/hhammer | Hammer.hs | gpl-2.0 | int8 :: Ptr C'HParser
int8 = unsafeLocalState h_int8 | 52 | int8 :: Ptr C'HParser
int8 = unsafeLocalState h_int8 | 52 | int8 = unsafeLocalState h_int8 | 30 | false | true | 0 | 6 | 7 | 23 | 9 | 14 | null | null |
Rotsor/factorio-module-selector | factorio-module-selector.hs | unlicense | (!!!) :: (Ord k, HasCallStack) => Map k v -> k -> v
(!!!) m x = m Map.! x | 73 | (!!!) :: (Ord k, HasCallStack) => Map k v -> k -> v
(!!!) m x = m Map.! x | 73 | (!!!) m x = m Map.! x | 21 | false | true | 0 | 7 | 19 | 52 | 28 | 24 | null | null |
jsnajder/hofm | src/MorphGrammar/Hofm/Language/Croatian/Derivation.hs | bsd-3-clause | -- primjer kada je ok da imamo pravila u "trokutu", ako se
-- inzistira na atestiranju riječi u korpusu (jer možda ne postoji ta
-- riječ u jeziku, pa nam treba trokut):
-- vikati->viknuti->*vikavati
-- *navikati->naviknuti->navikavti
-- Dgdp: deminutivni i pejorativni glagoli
dV02 = [
dPattern "gdp01"
-- govoriti -> govorkati, šetati -> šetkati
(sfx "kati") tiVerbs tiVerbs,
dPattern "gdp02"
-- pjevati -> pjevuckati
(sfx "uckati") tiVerbs tiVerbs,
dPattern "gdp03"
-- piti -> pijuckati
(sfx "juckati") tiVerbs tiVerbs,
dPattern "gdp04"
-- pjevati -> pjevušiti
(sfx "ušiti") tiVerbs tiVerbs,
dPattern "gdp05"
-- pisati -> piskarati
(sfx "karati") tiVerbs tiVerbs,
dPattern "gdp06"
-- smijati -> smijuljiti
(sfx "uljiti") tiVerbs tiVerbs] | 803 | dV02 = [
dPattern "gdp01"
-- govoriti -> govorkati, šetati -> šetkati
(sfx "kati") tiVerbs tiVerbs,
dPattern "gdp02"
-- pjevati -> pjevuckati
(sfx "uckati") tiVerbs tiVerbs,
dPattern "gdp03"
-- piti -> pijuckati
(sfx "juckati") tiVerbs tiVerbs,
dPattern "gdp04"
-- pjevati -> pjevušiti
(sfx "ušiti") tiVerbs tiVerbs,
dPattern "gdp05"
-- pisati -> piskarati
(sfx "karati") tiVerbs tiVerbs,
dPattern "gdp06"
-- smijati -> smijuljiti
(sfx "uljiti") tiVerbs tiVerbs] | 522 | dV02 = [
dPattern "gdp01"
-- govoriti -> govorkati, šetati -> šetkati
(sfx "kati") tiVerbs tiVerbs,
dPattern "gdp02"
-- pjevati -> pjevuckati
(sfx "uckati") tiVerbs tiVerbs,
dPattern "gdp03"
-- piti -> pijuckati
(sfx "juckati") tiVerbs tiVerbs,
dPattern "gdp04"
-- pjevati -> pjevušiti
(sfx "ušiti") tiVerbs tiVerbs,
dPattern "gdp05"
-- pisati -> piskarati
(sfx "karati") tiVerbs tiVerbs,
dPattern "gdp06"
-- smijati -> smijuljiti
(sfx "uljiti") tiVerbs tiVerbs] | 522 | true | false | 1 | 9 | 170 | 130 | 69 | 61 | null | null |
danr/hipspec | examples/old-examples/hip/ZenoLists.hs | gpl-3.0 | elem n (x:xs) =
case n == x of
True -> True
False -> elem n xs | 72 | elem n (x:xs) =
case n == x of
True -> True
False -> elem n xs | 72 | elem n (x:xs) =
case n == x of
True -> True
False -> elem n xs | 72 | false | false | 0 | 8 | 26 | 45 | 21 | 24 | null | null |
ezyang/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | -- Overloaded record fields
hasFieldClassNameKey :: Unique
hasFieldClassNameKey = mkPreludeClassUnique 49 | 105 | hasFieldClassNameKey :: Unique
hasFieldClassNameKey = mkPreludeClassUnique 49 | 77 | hasFieldClassNameKey = mkPreludeClassUnique 49 | 46 | true | true | 0 | 6 | 10 | 21 | 9 | 12 | null | null |
henvic/plc | src/IntroducaoAProgramacaoFuncionalEHaskell.hs | cc0-1.0 | soma (nota : l) = nota + soma l | 31 | soma (nota : l) = nota + soma l | 31 | soma (nota : l) = nota + soma l | 31 | false | false | 0 | 7 | 8 | 23 | 11 | 12 | null | null |
athanclark/lucid-foundation | src/Lucid/Foundation/Callouts/Reveal.hs | bsd-3-clause | data_reveal_id_ :: T.Text -> Attribute
data_reveal_id_ = data_ "reveal-id" | 74 | data_reveal_id_ :: T.Text -> Attribute
data_reveal_id_ = data_ "reveal-id" | 74 | data_reveal_id_ = data_ "reveal-id" | 35 | false | true | 0 | 6 | 8 | 20 | 10 | 10 | null | null |
isomorphism/hackage2 | Data/StringTable.hs | bsd-3-clause | prop :: [String] -> Bool
prop strs =
all lookupIndex (enumStrings tbl)
&& all indexLookup (enumIds tbl)
where
tbl :: StringTable Int
tbl = construct strs
lookupIndex str = index tbl ident == str
where Just ident = lookup tbl str
indexLookup ident = lookup tbl str == Just ident
where str = index tbl ident | 359 | prop :: [String] -> Bool
prop strs =
all lookupIndex (enumStrings tbl)
&& all indexLookup (enumIds tbl)
where
tbl :: StringTable Int
tbl = construct strs
lookupIndex str = index tbl ident == str
where Just ident = lookup tbl str
indexLookup ident = lookup tbl str == Just ident
where str = index tbl ident | 359 | prop strs =
all lookupIndex (enumStrings tbl)
&& all indexLookup (enumIds tbl)
where
tbl :: StringTable Int
tbl = construct strs
lookupIndex str = index tbl ident == str
where Just ident = lookup tbl str
indexLookup ident = lookup tbl str == Just ident
where str = index tbl ident | 334 | false | true | 2 | 7 | 109 | 135 | 63 | 72 | null | null |
dimara/ganeti | src/Ganeti/OpParams.hs | bsd-2-clause | pZeroFreeSpace :: Field
pZeroFreeSpace =
withDoc "Whether to zero the free space on the disks of the instance" $
defaultFalse "zero_free_space" | 147 | pZeroFreeSpace :: Field
pZeroFreeSpace =
withDoc "Whether to zero the free space on the disks of the instance" $
defaultFalse "zero_free_space" | 147 | pZeroFreeSpace =
withDoc "Whether to zero the free space on the disks of the instance" $
defaultFalse "zero_free_space" | 123 | false | true | 0 | 6 | 24 | 21 | 10 | 11 | null | null |
benkolera/phb | hs/Phb/Dates.hs | mit | isWeekDayOfWeek :: DayOfWeek -> Bool
isWeekDayOfWeek Saturday = False | 69 | isWeekDayOfWeek :: DayOfWeek -> Bool
isWeekDayOfWeek Saturday = False | 69 | isWeekDayOfWeek Saturday = False | 32 | false | true | 0 | 7 | 8 | 24 | 10 | 14 | null | null |
TomMD/ghc | compiler/main/DynFlags.hs | bsd-3-clause | targetRetainsAllBindings HscNothing = True | 46 | targetRetainsAllBindings HscNothing = True | 46 | targetRetainsAllBindings HscNothing = True | 46 | false | false | 1 | 5 | 7 | 13 | 4 | 9 | null | null |
nikita-volkov/refined | src/Refined.hs | mit | refineTH_ :: forall p x. (Predicate p x, TH.Lift x)
=> x
-> TH.Code TH.Q x
refineTH_ =
refineTH @p @x
.> TH.examineCode
.> fmap unsafeUnrefineTExp
.> TH.liftCode | 173 | refineTH_ :: forall p x. (Predicate p x, TH.Lift x)
=> x
-> TH.Code TH.Q x
refineTH_ =
refineTH @p @x
.> TH.examineCode
.> fmap unsafeUnrefineTExp
.> TH.liftCode | 173 | refineTH_ =
refineTH @p @x
.> TH.examineCode
.> fmap unsafeUnrefineTExp
.> TH.liftCode | 94 | false | true | 6 | 10 | 39 | 90 | 43 | 47 | null | null |
nushio3/ghc | compiler/types/OptCoercion.hs | bsd-3-clause | isCohRight_maybe _ = Nothing | 56 | isCohRight_maybe _ = Nothing | 56 | isCohRight_maybe _ = Nothing | 56 | false | false | 0 | 5 | 31 | 9 | 4 | 5 | null | null |
tsahyt/lmrbot | src/Commands/Markov.hs | agpl-3.0 | markov :: MonadRandom m
=> ByteString -> MarkovMap String -> [[String]] -> Response m
markov cmd chain starts = simpleCmd cmd $ \_ chan -> do
s <- (starts !!) <$> getRandomR (0, pred $ length starts)
n <- getRandomR (1,2)
ret <- render . takeUntilN (== ".") n <$> runChain 80 s chain
return $ privmsg (fromMaybe "" chan) (pack ret) | 355 | markov :: MonadRandom m
=> ByteString -> MarkovMap String -> [[String]] -> Response m
markov cmd chain starts = simpleCmd cmd $ \_ chan -> do
s <- (starts !!) <$> getRandomR (0, pred $ length starts)
n <- getRandomR (1,2)
ret <- render . takeUntilN (== ".") n <$> runChain 80 s chain
return $ privmsg (fromMaybe "" chan) (pack ret) | 355 | markov cmd chain starts = simpleCmd cmd $ \_ chan -> do
s <- (starts !!) <$> getRandomR (0, pred $ length starts)
n <- getRandomR (1,2)
ret <- render . takeUntilN (== ".") n <$> runChain 80 s chain
return $ privmsg (fromMaybe "" chan) (pack ret) | 261 | false | true | 0 | 14 | 85 | 167 | 82 | 85 | null | null |
daewon/til | haskell/haskell_by_example/read_file.hs | mpl-2.0 | readAtLeast :: Handle -> Integer -> IO String
readAtLeast handle n
| n <= 0 = return ""
| otherwise = do
eof <- hIsEOF handle
if eof
then return ""
else do
c <- hGetChar handle
str <- readAtLeast handle (n-1)
return (c:str) | 313 | readAtLeast :: Handle -> Integer -> IO String
readAtLeast handle n
| n <= 0 = return ""
| otherwise = do
eof <- hIsEOF handle
if eof
then return ""
else do
c <- hGetChar handle
str <- readAtLeast handle (n-1)
return (c:str) | 313 | readAtLeast handle n
| n <= 0 = return ""
| otherwise = do
eof <- hIsEOF handle
if eof
then return ""
else do
c <- hGetChar handle
str <- readAtLeast handle (n-1)
return (c:str) | 267 | false | true | 1 | 14 | 133 | 114 | 52 | 62 | null | null |
DNoved1/distill | src/Distill/Expr/Representation.hs | mit | fullstop = char '.' | 26 | fullstop = char '.' | 26 | fullstop = char '.' | 26 | false | false | 0 | 5 | 10 | 9 | 4 | 5 | null | null |
swift-nav/ecstatic | Development/Ecstatic/StackUsage.hs | bsd-2-clause | doStackUsage :: GlobalDecls -> CStat -> IO ()
doStackUsage g s = do
setSGR [SetColor Foreground Dull Blue]
putStrLn "Stack Usage:"
print $ pretty $ stackUsage g s
setSGR [Reset] | 185 | doStackUsage :: GlobalDecls -> CStat -> IO ()
doStackUsage g s = do
setSGR [SetColor Foreground Dull Blue]
putStrLn "Stack Usage:"
print $ pretty $ stackUsage g s
setSGR [Reset] | 185 | doStackUsage g s = do
setSGR [SetColor Foreground Dull Blue]
putStrLn "Stack Usage:"
print $ pretty $ stackUsage g s
setSGR [Reset] | 139 | false | true | 0 | 9 | 37 | 76 | 34 | 42 | null | null |
sgillespie/lambda-calculus | src/Language/SystemF/TypeCheck.hs | mit | sub name ty (TyAbs ty' e) = TyAbs ty' (sub name ty e) | 53 | sub name ty (TyAbs ty' e) = TyAbs ty' (sub name ty e) | 53 | sub name ty (TyAbs ty' e) = TyAbs ty' (sub name ty e) | 53 | false | false | 0 | 7 | 12 | 37 | 17 | 20 | null | null |
tjakway/ghcjvm | compiler/typecheck/FamInst.hs | bsd-3-clause | -- | Build injecivity error herald common to all injectivity errors.
injectivityErrorHerald :: Bool -> SDoc
injectivityErrorHerald isSingular =
text "Type family equation" <> s isSingular <+> text "violate" <>
s (not isSingular) <+> text "injectivity annotation" <>
if isSingular then dot else colon
-- Above is an ugly hack. We want this: "sentence. herald:" (note the dot and
-- colon). But if herald is empty we want "sentence:" (note the colon). We
-- can't test herald for emptiness so we rely on the fact that herald is empty
-- only when isSingular is False. If herald is non empty it must end with a
-- colon.
where
s False = text "s"
s True = empty
-- | Build error message for a pair of equations violating an injectivity
-- annotation. | 784 | injectivityErrorHerald :: Bool -> SDoc
injectivityErrorHerald isSingular =
text "Type family equation" <> s isSingular <+> text "violate" <>
s (not isSingular) <+> text "injectivity annotation" <>
if isSingular then dot else colon
-- Above is an ugly hack. We want this: "sentence. herald:" (note the dot and
-- colon). But if herald is empty we want "sentence:" (note the colon). We
-- can't test herald for emptiness so we rely on the fact that herald is empty
-- only when isSingular is False. If herald is non empty it must end with a
-- colon.
where
s False = text "s"
s True = empty
-- | Build error message for a pair of equations violating an injectivity
-- annotation. | 715 | injectivityErrorHerald isSingular =
text "Type family equation" <> s isSingular <+> text "violate" <>
s (not isSingular) <+> text "injectivity annotation" <>
if isSingular then dot else colon
-- Above is an ugly hack. We want this: "sentence. herald:" (note the dot and
-- colon). But if herald is empty we want "sentence:" (note the colon). We
-- can't test herald for emptiness so we rely on the fact that herald is empty
-- only when isSingular is False. If herald is non empty it must end with a
-- colon.
where
s False = text "s"
s True = empty
-- | Build error message for a pair of equations violating an injectivity
-- annotation. | 676 | true | true | 1 | 8 | 169 | 96 | 50 | 46 | null | null |
sgillespie/ghc | compiler/typecheck/TcGenDeriv.hs | bsd-3-clause | leInt_RDR = varQual_RDR gHC_PRIM (fsLit "<=#") | 52 | leInt_RDR = varQual_RDR gHC_PRIM (fsLit "<=#") | 52 | leInt_RDR = varQual_RDR gHC_PRIM (fsLit "<=#") | 52 | false | false | 0 | 7 | 11 | 17 | 8 | 9 | null | null |
kurnevsky/xmonad-compton | src/XMonad/Compton.hs | gpl-3.0 | invert :: Display -> Window -> Bool -> X ()
invert dpy w status =
let mc = (methodCall "/" "com.github.chjj.compton" "win_set")
{ methodCallDestination = Just $ busName_ $ "com.github.chjj.compton." ++ dpyName dpy
, methodCallBody = [ toVariant (fromIntegral w :: Word32)
, toVariant ("invert_color_force" :: String)
, toVariant ((if status then 1 else 0) :: Word16)
]
}
in io $ do client <- connectSession
callNoReply client mc
disconnect client | 611 | invert :: Display -> Window -> Bool -> X ()
invert dpy w status =
let mc = (methodCall "/" "com.github.chjj.compton" "win_set")
{ methodCallDestination = Just $ busName_ $ "com.github.chjj.compton." ++ dpyName dpy
, methodCallBody = [ toVariant (fromIntegral w :: Word32)
, toVariant ("invert_color_force" :: String)
, toVariant ((if status then 1 else 0) :: Word16)
]
}
in io $ do client <- connectSession
callNoReply client mc
disconnect client | 611 | invert dpy w status =
let mc = (methodCall "/" "com.github.chjj.compton" "win_set")
{ methodCallDestination = Just $ busName_ $ "com.github.chjj.compton." ++ dpyName dpy
, methodCallBody = [ toVariant (fromIntegral w :: Word32)
, toVariant ("invert_color_force" :: String)
, toVariant ((if status then 1 else 0) :: Word16)
]
}
in io $ do client <- connectSession
callNoReply client mc
disconnect client | 567 | false | true | 0 | 15 | 235 | 160 | 82 | 78 | null | null |
mightymoose/liquidhaskell | src/Language/Haskell/Liquid/Bare/Existential.hs | bsd-3-clause | expToBindT (RAllS s t)
= liftM (RAllS s) (expToBindT t) | 57 | expToBindT (RAllS s t)
= liftM (RAllS s) (expToBindT t) | 57 | expToBindT (RAllS s t)
= liftM (RAllS s) (expToBindT t) | 57 | false | false | 0 | 7 | 11 | 36 | 16 | 20 | null | null |
rueshyna/gogol | gogol-adexchange-buyer/gen/Network/Google/AdExchangeBuyer/Types/Product.hs | mpl-2.0 | -- | The original contracted quantity (# impressions) for this deal. To
-- ensure delivery, sometimes the publisher will book the deal with a
-- impression buffer, such that guaranteed_looks is greater than the
-- contracted quantity. However clients are billed using the original
-- contracted quantity.
dtgfptbiOriginalContractedQuantity :: Lens' DealTermsGuaranteedFixedPriceTermsBillingInfo (Maybe Int64)
dtgfptbiOriginalContractedQuantity
= lens _dtgfptbiOriginalContractedQuantity
(\ s a -> s{_dtgfptbiOriginalContractedQuantity = a})
. mapping _Coerce | 572 | dtgfptbiOriginalContractedQuantity :: Lens' DealTermsGuaranteedFixedPriceTermsBillingInfo (Maybe Int64)
dtgfptbiOriginalContractedQuantity
= lens _dtgfptbiOriginalContractedQuantity
(\ s a -> s{_dtgfptbiOriginalContractedQuantity = a})
. mapping _Coerce | 267 | dtgfptbiOriginalContractedQuantity
= lens _dtgfptbiOriginalContractedQuantity
(\ s a -> s{_dtgfptbiOriginalContractedQuantity = a})
. mapping _Coerce | 163 | true | true | 1 | 8 | 80 | 62 | 32 | 30 | null | null |
unisonweb/platform | unison-core/src/Unison/Reference.hs | mit | idFromText :: Text -> Maybe Id
idFromText s = case fromText s of
Left _ -> Nothing
Right (Builtin _) -> Nothing
Right (DerivedId id) -> pure id | 149 | idFromText :: Text -> Maybe Id
idFromText s = case fromText s of
Left _ -> Nothing
Right (Builtin _) -> Nothing
Right (DerivedId id) -> pure id | 149 | idFromText s = case fromText s of
Left _ -> Nothing
Right (Builtin _) -> Nothing
Right (DerivedId id) -> pure id | 118 | false | true | 0 | 10 | 33 | 70 | 32 | 38 | null | null |
jaapweel/piffle | src/IrPiffle.hs | gpl-2.0 | getVar :: Ident -> Env -> Compiler Type
getVar v (Env venv _) =
maybe wrong return (M.lookup v venv)
where wrong =
die ("variable " ++ show v ++ " not in scope") | 186 | getVar :: Ident -> Env -> Compiler Type
getVar v (Env venv _) =
maybe wrong return (M.lookup v venv)
where wrong =
die ("variable " ++ show v ++ " not in scope") | 186 | getVar v (Env venv _) =
maybe wrong return (M.lookup v venv)
where wrong =
die ("variable " ++ show v ++ " not in scope") | 146 | false | true | 0 | 9 | 58 | 83 | 38 | 45 | null | null |
brendanhay/gogol | gogol-healthcare/gen/Network/Google/Healthcare/Types/Product.hs | mpl-2.0 | -- | Optional. String indicating the location of the expression for error
-- reporting, e.g. a file name and a position in the file.
eLocation :: Lens' Expr (Maybe Text)
eLocation
= lens _eLocation (\ s a -> s{_eLocation = a}) | 228 | eLocation :: Lens' Expr (Maybe Text)
eLocation
= lens _eLocation (\ s a -> s{_eLocation = a}) | 95 | eLocation
= lens _eLocation (\ s a -> s{_eLocation = a}) | 58 | true | true | 2 | 9 | 42 | 56 | 26 | 30 | null | null |
ghc-android/ghc | libraries/template-haskell/Language/Haskell/TH/Lib.hs | bsd-3-clause | noBindS :: ExpQ -> StmtQ
noBindS e = do { e1 <- e; return (NoBindS e1) } | 72 | noBindS :: ExpQ -> StmtQ
noBindS e = do { e1 <- e; return (NoBindS e1) } | 72 | noBindS e = do { e1 <- e; return (NoBindS e1) } | 47 | false | true | 0 | 10 | 16 | 46 | 21 | 25 | null | null |
graninas/Haskell-Algorithms | Tests/ArrowsAndFrees/ArrEff.hs | gpl-3.0 | runArrEffList :: Monad m => [c] -> ArrEff m b c -> [b] -> m [c]
runArrEffList cs (ArrEff f) [] = return cs | 110 | runArrEffList :: Monad m => [c] -> ArrEff m b c -> [b] -> m [c]
runArrEffList cs (ArrEff f) [] = return cs | 110 | runArrEffList cs (ArrEff f) [] = return cs | 46 | false | true | 0 | 12 | 27 | 71 | 34 | 37 | null | null |
romanb/amazonka | amazonka-ec2/gen/Network/AWS/EC2/Types.hs | mpl-2.0 | -- | 'ReservedInstancesModificationResult' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'rimrReservedInstancesId' @::@ 'Maybe' 'Text'
--
-- * 'rimrTargetConfiguration' @::@ 'Maybe' 'ReservedInstancesConfiguration'
--
reservedInstancesModificationResult :: ReservedInstancesModificationResult
reservedInstancesModificationResult = ReservedInstancesModificationResult
{ _rimrReservedInstancesId = Nothing
, _rimrTargetConfiguration = Nothing
} | 491 | reservedInstancesModificationResult :: ReservedInstancesModificationResult
reservedInstancesModificationResult = ReservedInstancesModificationResult
{ _rimrReservedInstancesId = Nothing
, _rimrTargetConfiguration = Nothing
} | 236 | reservedInstancesModificationResult = ReservedInstancesModificationResult
{ _rimrReservedInstancesId = Nothing
, _rimrTargetConfiguration = Nothing
} | 161 | true | true | 0 | 7 | 54 | 37 | 24 | 13 | null | null |
ml9951/ghc | compiler/llvmGen/LlvmCodeGen/CodeGen.hs | bsd-3-clause | genLit opt (CmmVec ls)
= do llvmLits <- mapM toLlvmLit ls
return (LMLitVar $ LMVectorLit llvmLits, nilOL, [])
where
toLlvmLit :: CmmLit -> LlvmM LlvmLit
toLlvmLit lit = do
(llvmLitVar, _, _) <- genLit opt lit
case llvmLitVar of
LMLitVar llvmLit -> return llvmLit
_ -> panic "genLit" | 337 | genLit opt (CmmVec ls)
= do llvmLits <- mapM toLlvmLit ls
return (LMLitVar $ LMVectorLit llvmLits, nilOL, [])
where
toLlvmLit :: CmmLit -> LlvmM LlvmLit
toLlvmLit lit = do
(llvmLitVar, _, _) <- genLit opt lit
case llvmLitVar of
LMLitVar llvmLit -> return llvmLit
_ -> panic "genLit" | 337 | genLit opt (CmmVec ls)
= do llvmLits <- mapM toLlvmLit ls
return (LMLitVar $ LMVectorLit llvmLits, nilOL, [])
where
toLlvmLit :: CmmLit -> LlvmM LlvmLit
toLlvmLit lit = do
(llvmLitVar, _, _) <- genLit opt lit
case llvmLitVar of
LMLitVar llvmLit -> return llvmLit
_ -> panic "genLit" | 337 | false | false | 0 | 10 | 102 | 126 | 59 | 67 | null | null |
BurntSushi/150fp-practice | QC/Q.hs | unlicense | rest (Q (a:as) bs) = Q as bs | 28 | rest (Q (a:as) bs) = Q as bs | 28 | rest (Q (a:as) bs) = Q as bs | 28 | false | false | 0 | 9 | 7 | 29 | 14 | 15 | null | null |
ezyang/ghc | compiler/hsSyn/HsExpr.hs | bsd-3-clause | pprSpliceDecl :: (SourceTextX p, OutputableBndrId p)
=> HsSplice p -> SpliceExplicitFlag -> SDoc
pprSpliceDecl e@HsQuasiQuote{} _ = pprSplice e | 154 | pprSpliceDecl :: (SourceTextX p, OutputableBndrId p)
=> HsSplice p -> SpliceExplicitFlag -> SDoc
pprSpliceDecl e@HsQuasiQuote{} _ = pprSplice e | 154 | pprSpliceDecl e@HsQuasiQuote{} _ = pprSplice e | 46 | false | true | 0 | 7 | 29 | 52 | 26 | 26 | null | null |
ekmett/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSTIPPLE :: Int
wxSTIPPLE = 110 | 32 | wxSTIPPLE :: Int
wxSTIPPLE = 110 | 32 | wxSTIPPLE = 110 | 15 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
z0isch/lambda-hive | src/LambdaHive/AI.hs | bsd-3-clause | pieceWeight :: PieceType -> Int
pieceWeight Spider = 1 | 54 | pieceWeight :: PieceType -> Int
pieceWeight Spider = 1 | 54 | pieceWeight Spider = 1 | 22 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
wjt/bustle | Bustle/UI.hs | lgpl-2.1 | logTitle (SingleLog filepath) = dropExtension $ takeFileName filepath | 71 | logTitle (SingleLog filepath) = dropExtension $ takeFileName filepath | 71 | logTitle (SingleLog filepath) = dropExtension $ takeFileName filepath | 71 | false | false | 0 | 6 | 9 | 23 | 10 | 13 | null | null |
mydaum/cabal | Cabal/Distribution/Parsec/Types/Field.hs | bsd-3-clause | getName :: Name ann -> ByteString
getName (Name _ bs) = bs | 58 | getName :: Name ann -> ByteString
getName (Name _ bs) = bs | 58 | getName (Name _ bs) = bs | 24 | false | true | 0 | 9 | 11 | 35 | 15 | 20 | null | null |
eb-gh-cr/XMonadContrib1 | XMonad/Prompt/Shell.hs | bsd-3-clause | escape :: String -> String
escape [] = "" | 47 | escape :: String -> String
escape [] = "" | 47 | escape [] = "" | 20 | false | true | 0 | 6 | 14 | 20 | 10 | 10 | null | null |
niteria/haddock | haddock-library/src/Documentation/Haddock/Parser/Monad.hs | bsd-2-clause | notChar :: Char -> Parser Char
notChar = lift . Attoparsec.notChar | 66 | notChar :: Char -> Parser Char
notChar = lift . Attoparsec.notChar | 66 | notChar = lift . Attoparsec.notChar | 35 | false | true | 0 | 6 | 10 | 24 | 12 | 12 | null | null |
Hodapp87/ivory | ivory-backend-c/src/Ivory/Compile/C/Modules.hs | bsd-3-clause | --------------------------------------------------------------------------------
showModule :: CompileUnits -> String
showModule m = unlines $ map unlines $
[ mk (lbl "Source") (sources m)
, mk (lbl "Header") (headers m)
]
where
lbl l = "// module " ++ unitName m ++ " " ++ l ++ ":\n"
mk _ (_,[]) = []
mk str (incls,units) = str : pp (map includeDef (S.toList incls) ++ units)
pp = map (pretty width . ppr)
-------------------------------------------------------------------------------- | 516 | showModule :: CompileUnits -> String
showModule m = unlines $ map unlines $
[ mk (lbl "Source") (sources m)
, mk (lbl "Header") (headers m)
]
where
lbl l = "// module " ++ unitName m ++ " " ++ l ++ ":\n"
mk _ (_,[]) = []
mk str (incls,units) = str : pp (map includeDef (S.toList incls) ++ units)
pp = map (pretty width . ppr)
-------------------------------------------------------------------------------- | 434 | showModule m = unlines $ map unlines $
[ mk (lbl "Source") (sources m)
, mk (lbl "Header") (headers m)
]
where
lbl l = "// module " ++ unitName m ++ " " ++ l ++ ":\n"
mk _ (_,[]) = []
mk str (incls,units) = str : pp (map includeDef (S.toList incls) ++ units)
pp = map (pretty width . ppr)
-------------------------------------------------------------------------------- | 397 | true | true | 0 | 12 | 98 | 182 | 92 | 90 | null | null |
AlexanderPankiv/ghc | compiler/typecheck/TcEvidence.hs | bsd-3-clause | mkTcNthCo :: Int -> TcCoercion -> TcCoercion
mkTcNthCo n (TcRefl r ty) = TcRefl r (tyConAppArgN n ty) | 101 | mkTcNthCo :: Int -> TcCoercion -> TcCoercion
mkTcNthCo n (TcRefl r ty) = TcRefl r (tyConAppArgN n ty) | 101 | mkTcNthCo n (TcRefl r ty) = TcRefl r (tyConAppArgN n ty) | 56 | false | true | 0 | 7 | 17 | 45 | 22 | 23 | null | null |
hvr/vector | Data/Vector/Primitive.hs | bsd-3-clause | findIndices = G.findIndices | 27 | findIndices = G.findIndices | 27 | findIndices = G.findIndices | 27 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
trenta3/zeno-0.2.0.1 | src/Zeno/Type.hs | mit | isVarType :: Type a -> Bool
isVarType (VarType {}) = True | 58 | isVarType :: Type a -> Bool
isVarType (VarType {}) = True | 57 | isVarType (VarType {}) = True | 29 | false | true | 0 | 7 | 11 | 28 | 14 | 14 | null | null |
goldfirere/singletons | singletons-th/src/Data/Singletons/TH/Single/Type.hs | bsd-3-clause | singPredRec ctx (DAppKindT pr ki) = singPredRec (DTyArg ki : ctx) pr | 68 | singPredRec ctx (DAppKindT pr ki) = singPredRec (DTyArg ki : ctx) pr | 68 | singPredRec ctx (DAppKindT pr ki) = singPredRec (DTyArg ki : ctx) pr | 68 | false | false | 0 | 8 | 11 | 36 | 16 | 20 | null | null |
SamirTalwar/advent-of-code | 2021/AOC_17_1.hs | mit | inTargetArea :: TargetArea -> Point -> Bool
inTargetArea (TargetArea start end) = Point.withinBounds (start, end) | 113 | inTargetArea :: TargetArea -> Point -> Bool
inTargetArea (TargetArea start end) = Point.withinBounds (start, end) | 113 | inTargetArea (TargetArea start end) = Point.withinBounds (start, end) | 69 | false | true | 0 | 10 | 14 | 46 | 22 | 24 | null | null |
tpsinnem/Idris-dev | src/Idris/Reflection.hs | bsd-3-clause | reifyTTNameType t@(App _ _ _)
= case unApply t of
(P _ f _, [Constant (I tag), Constant (I num)])
| f == reflm "DCon" -> return $ DCon tag num False -- FIXME: Uniqueness!
| f == reflm "TCon" -> return $ TCon tag num
_ -> fail ("Unknown reflection name type: " ++ show t) | 306 | reifyTTNameType t@(App _ _ _)
= case unApply t of
(P _ f _, [Constant (I tag), Constant (I num)])
| f == reflm "DCon" -> return $ DCon tag num False -- FIXME: Uniqueness!
| f == reflm "TCon" -> return $ TCon tag num
_ -> fail ("Unknown reflection name type: " ++ show t) | 306 | reifyTTNameType t@(App _ _ _)
= case unApply t of
(P _ f _, [Constant (I tag), Constant (I num)])
| f == reflm "DCon" -> return $ DCon tag num False -- FIXME: Uniqueness!
| f == reflm "TCon" -> return $ TCon tag num
_ -> fail ("Unknown reflection name type: " ++ show t) | 306 | false | false | 0 | 12 | 92 | 141 | 67 | 74 | null | null |
ihc/futhark | src/Futhark/Optimise/TileLoops.hs | isc | sufficientGroups :: MonadBinder m =>
[(VName, SubExp, VName, SubExp)] -> SubExp
-> m (SubExp, SubExp)
sufficientGroups gspace group_size = do
groups_in_dims <- forM gspace $ \(_, gd, _, ld) ->
letSubExp "groups_in_dim" =<< eDivRoundingUp Int32 (eSubExp gd) (eSubExp ld)
num_groups <- letSubExp "num_groups" =<<
foldBinOp (Mul Int32) (constant (1::Int32)) groups_in_dims
num_threads <- letSubExp "num_threads" $
BasicOp $ BinOp (Mul Int32) num_groups group_size
return (num_threads, num_groups) | 575 | sufficientGroups :: MonadBinder m =>
[(VName, SubExp, VName, SubExp)] -> SubExp
-> m (SubExp, SubExp)
sufficientGroups gspace group_size = do
groups_in_dims <- forM gspace $ \(_, gd, _, ld) ->
letSubExp "groups_in_dim" =<< eDivRoundingUp Int32 (eSubExp gd) (eSubExp ld)
num_groups <- letSubExp "num_groups" =<<
foldBinOp (Mul Int32) (constant (1::Int32)) groups_in_dims
num_threads <- letSubExp "num_threads" $
BasicOp $ BinOp (Mul Int32) num_groups group_size
return (num_threads, num_groups) | 575 | sufficientGroups gspace group_size = do
groups_in_dims <- forM gspace $ \(_, gd, _, ld) ->
letSubExp "groups_in_dim" =<< eDivRoundingUp Int32 (eSubExp gd) (eSubExp ld)
num_groups <- letSubExp "num_groups" =<<
foldBinOp (Mul Int32) (constant (1::Int32)) groups_in_dims
num_threads <- letSubExp "num_threads" $
BasicOp $ BinOp (Mul Int32) num_groups group_size
return (num_threads, num_groups) | 436 | false | true | 0 | 14 | 146 | 199 | 99 | 100 | null | null |
jdreaver/quantities | quantities.hs | bsd-3-clause | parse ["-v"] = version >> exit | 30 | parse ["-v"] = version >> exit | 30 | parse ["-v"] = version >> exit | 30 | false | false | 2 | 5 | 5 | 19 | 8 | 11 | null | null |
ezyang/ghc | compiler/basicTypes/VarSet.hs | bsd-3-clause | -- | Determines the pluralisation suffix appropriate for the length of a set
-- in the same way that plural from Outputable does for lists.
pluralVarSet :: VarSet -> SDoc
pluralVarSet = pluralUFM . getUniqSet | 208 | pluralVarSet :: VarSet -> SDoc
pluralVarSet = pluralUFM . getUniqSet | 68 | pluralVarSet = pluralUFM . getUniqSet | 37 | true | true | 0 | 5 | 34 | 21 | 12 | 9 | null | null |
google-research/dex-lang | src/lib/GenericTraversal.hs | bsd-3-clause | raverseAtomDefault :: GenericTraverser m => Atom i -> m i o (Atom o)
traverseAtomDefault atom = case atom of
Var v -> Var <$> substM v
Lam (LamExpr (LamBinder b ty arr eff) body) -> do
ty' <- tge ty
let hint = getNameHint b
effAbs <- withFreshBinder hint ty' \b' ->
extendRenamer (b@>binderName b') do
Abs (b':>ty') <$> substM eff
withFreshLamBinder hint (LamBinding arr ty') effAbs \b' -> do
extendRenamer (b@>binderName b') do
body' <- tge body
return $ Lam $ LamExpr b' body'
Pi (PiType (PiBinder b ty arr) eff resultTy) -> do
ty' <- tge ty
withFreshPiBinder (getNameHint b) (PiBinding arr ty') \b' -> do
extendRenamer (b@>binderName b') $
Pi <$> (PiType b' <$> substM eff <*> tge resultTy)
Con con -> Con <$> mapM tge con
TC tc -> TC <$> mapM tge tc
Eff _ -> substM atom
DataCon sourceName dataDefName params con args ->
DataCon sourceName <$> substM dataDefName <*>
mapM tge params <*> pure con <*> mapM tge args
TypeCon sn dataDefName params ->
TypeCon sn <$> substM dataDefName <*> mapM tge params
LabeledRow elems -> LabeledRow <$> traverseGenericE elems
Record items -> Record <$> mapM tge items
RecordTy elems -> RecordTy <$> traverseGenericE elems
Variant (Ext types rest) label i value -> do
types' <- mapM tge types
rest' <- mapM substM rest
value' <- tge value
return $ Variant (Ext types' rest') label i value'
VariantTy (Ext items rest) -> do
items' <- mapM tge items
rest' <- mapM substM rest
return $ VariantTy $ Ext items' rest'
ProjectElt _ _ -> substM atom
_ -> error $ "not implemented: " ++ pprint atom
| 1,679 | traverseAtomDefault :: GenericTraverser m => Atom i -> m i o (Atom o)
traverseAtomDefault atom = case atom of
Var v -> Var <$> substM v
Lam (LamExpr (LamBinder b ty arr eff) body) -> do
ty' <- tge ty
let hint = getNameHint b
effAbs <- withFreshBinder hint ty' \b' ->
extendRenamer (b@>binderName b') do
Abs (b':>ty') <$> substM eff
withFreshLamBinder hint (LamBinding arr ty') effAbs \b' -> do
extendRenamer (b@>binderName b') do
body' <- tge body
return $ Lam $ LamExpr b' body'
Pi (PiType (PiBinder b ty arr) eff resultTy) -> do
ty' <- tge ty
withFreshPiBinder (getNameHint b) (PiBinding arr ty') \b' -> do
extendRenamer (b@>binderName b') $
Pi <$> (PiType b' <$> substM eff <*> tge resultTy)
Con con -> Con <$> mapM tge con
TC tc -> TC <$> mapM tge tc
Eff _ -> substM atom
DataCon sourceName dataDefName params con args ->
DataCon sourceName <$> substM dataDefName <*>
mapM tge params <*> pure con <*> mapM tge args
TypeCon sn dataDefName params ->
TypeCon sn <$> substM dataDefName <*> mapM tge params
LabeledRow elems -> LabeledRow <$> traverseGenericE elems
Record items -> Record <$> mapM tge items
RecordTy elems -> RecordTy <$> traverseGenericE elems
Variant (Ext types rest) label i value -> do
types' <- mapM tge types
rest' <- mapM substM rest
value' <- tge value
return $ Variant (Ext types' rest') label i value'
VariantTy (Ext items rest) -> do
items' <- mapM tge items
rest' <- mapM substM rest
return $ VariantTy $ Ext items' rest'
ProjectElt _ _ -> substM atom
_ -> error $ "not implemented: " ++ pprint atom | 1,679 | traverseAtomDefault atom = case atom of
Var v -> Var <$> substM v
Lam (LamExpr (LamBinder b ty arr eff) body) -> do
ty' <- tge ty
let hint = getNameHint b
effAbs <- withFreshBinder hint ty' \b' ->
extendRenamer (b@>binderName b') do
Abs (b':>ty') <$> substM eff
withFreshLamBinder hint (LamBinding arr ty') effAbs \b' -> do
extendRenamer (b@>binderName b') do
body' <- tge body
return $ Lam $ LamExpr b' body'
Pi (PiType (PiBinder b ty arr) eff resultTy) -> do
ty' <- tge ty
withFreshPiBinder (getNameHint b) (PiBinding arr ty') \b' -> do
extendRenamer (b@>binderName b') $
Pi <$> (PiType b' <$> substM eff <*> tge resultTy)
Con con -> Con <$> mapM tge con
TC tc -> TC <$> mapM tge tc
Eff _ -> substM atom
DataCon sourceName dataDefName params con args ->
DataCon sourceName <$> substM dataDefName <*>
mapM tge params <*> pure con <*> mapM tge args
TypeCon sn dataDefName params ->
TypeCon sn <$> substM dataDefName <*> mapM tge params
LabeledRow elems -> LabeledRow <$> traverseGenericE elems
Record items -> Record <$> mapM tge items
RecordTy elems -> RecordTy <$> traverseGenericE elems
Variant (Ext types rest) label i value -> do
types' <- mapM tge types
rest' <- mapM substM rest
value' <- tge value
return $ Variant (Ext types' rest') label i value'
VariantTy (Ext items rest) -> do
items' <- mapM tge items
rest' <- mapM substM rest
return $ VariantTy $ Ext items' rest'
ProjectElt _ _ -> substM atom
_ -> error $ "not implemented: " ++ pprint atom | 1,609 | false | true | 0 | 19 | 426 | 701 | 315 | 386 | null | null |
jmitchell/Idris-dev | src/IRTS/CodegenC.hs | bsd-3-clause | doOp v LCrash [x] = "idris_crash(GETSTR(" ++ creg x ++ "))" | 59 | doOp v LCrash [x] = "idris_crash(GETSTR(" ++ creg x ++ "))" | 59 | doOp v LCrash [x] = "idris_crash(GETSTR(" ++ creg x ++ "))" | 59 | false | false | 0 | 7 | 10 | 27 | 13 | 14 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.