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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
topos-house/prototype | src/Proto3.hs | bsd-3-clause | fieldName = ident | 19 | fieldName = ident | 19 | fieldName = ident | 19 | false | false | 0 | 4 | 4 | 6 | 3 | 3 | null | null |
phdenzel/dotfiles | .config/xmonad/xmonad.hs | mit | myEmacs :: String
myEmacs = "emacsclient -c --alternate-editor='emacs'" | 71 | myEmacs :: String
myEmacs = "emacsclient -c --alternate-editor='emacs'" | 71 | myEmacs = "emacsclient -c --alternate-editor='emacs'" | 53 | false | true | 0 | 4 | 7 | 11 | 6 | 5 | null | null |
CRogers/bananasnake | src/Bananasnake.hs | mit | direction :: Event t Char -> Event t Direction
direction = accumE up . fmap turn
where
turn :: Char -> Direction -> Direction
turn 'a' = turnAnticlockwise
turn 'd' = turnClockwise
turn _ = id | 209 | direction :: Event t Char -> Event t Direction
direction = accumE up . fmap turn
where
turn :: Char -> Direction -> Direction
turn 'a' = turnAnticlockwise
turn 'd' = turnClockwise
turn _ = id | 209 | direction = accumE up . fmap turn
where
turn :: Char -> Direction -> Direction
turn 'a' = turnAnticlockwise
turn 'd' = turnClockwise
turn _ = id | 162 | false | true | 0 | 6 | 53 | 75 | 36 | 39 | null | null |
BeautifulDestinations/fb | src/Facebook/Object/Marketing/Types.hs | bsd-3-clause | optimization_goal r = r `Rec.get` OptimizationGoal | 50 | optimization_goal r = r `Rec.get` OptimizationGoal | 50 | optimization_goal r = r `Rec.get` OptimizationGoal | 50 | false | false | 0 | 5 | 5 | 17 | 9 | 8 | null | null |
pfq/PFQ | user/pfq-omatic/pfq-omatic.hs | gpl-2.0 | getNumberOfPhyCores :: Int
getNumberOfPhyCores = unsafePerformIO $
length . filter (isInfixOf "processor") . lines <$> readFile procCpuInfo | 143 | getNumberOfPhyCores :: Int
getNumberOfPhyCores = unsafePerformIO $
length . filter (isInfixOf "processor") . lines <$> readFile procCpuInfo | 143 | getNumberOfPhyCores = unsafePerformIO $
length . filter (isInfixOf "processor") . lines <$> readFile procCpuInfo | 116 | false | true | 1 | 8 | 20 | 46 | 20 | 26 | null | null |
brendanhay/gogol | gogol-sheets/gen/Network/Google/Sheets/Types/Product.hs | mpl-2.0 | -- | The specification of the chart.
ecSpec :: Lens' EmbeddedChart (Maybe ChartSpec)
ecSpec = lens _ecSpec (\ s a -> s{_ecSpec = a}) | 132 | ecSpec :: Lens' EmbeddedChart (Maybe ChartSpec)
ecSpec = lens _ecSpec (\ s a -> s{_ecSpec = a}) | 95 | ecSpec = lens _ecSpec (\ s a -> s{_ecSpec = a}) | 47 | true | true | 1 | 9 | 23 | 52 | 25 | 27 | null | null |
osa1/hslua | src/Foreign/Lua/Core/Functions.hs | mit | -- | Returns @True@ if the value at the given index is a thread, and @False@
-- otherwise.
--
-- See also:
-- <https://www.lua.org/manual/5.3/manual.html#lua_isthread lua_isthread>.
isthread :: StackIndex -> Lua Bool
isthread n = (== TypeThread) <$> ltype n | 257 | isthread :: StackIndex -> Lua Bool
isthread n = (== TypeThread) <$> ltype n | 75 | isthread n = (== TypeThread) <$> ltype n | 40 | true | true | 0 | 6 | 38 | 37 | 21 | 16 | null | null |
Fuuzetsu/haddock | haddock-library/vendor/attoparsec-0.13.1.0/Data/Attoparsec/Combinator.hs | bsd-2-clause | -- | @choice ps@ tries to apply the actions in the list @ps@ in order,
-- until one of them succeeds. Returns the value of the succeeding
-- action.
choice :: Alternative f => [f a] -> f a
choice = foldr (<|>) empty | 215 | choice :: Alternative f => [f a] -> f a
choice = foldr (<|>) empty | 66 | choice = foldr (<|>) empty | 26 | true | true | 0 | 8 | 43 | 41 | 22 | 19 | null | null |
denibertovic/haskell | kubernetes/lib/Kubernetes/OpenAPI/ModelLens.hs | bsd-3-clause | -- | 'v1alpha1VolumeErrorTime' Lens
v1alpha1VolumeErrorTimeL :: Lens_' V1alpha1VolumeError (Maybe DateTime)
v1alpha1VolumeErrorTimeL f V1alpha1VolumeError{..} = (\v1alpha1VolumeErrorTime -> V1alpha1VolumeError { v1alpha1VolumeErrorTime, ..} ) <$> f v1alpha1VolumeErrorTime | 272 | v1alpha1VolumeErrorTimeL :: Lens_' V1alpha1VolumeError (Maybe DateTime)
v1alpha1VolumeErrorTimeL f V1alpha1VolumeError{..} = (\v1alpha1VolumeErrorTime -> V1alpha1VolumeError { v1alpha1VolumeErrorTime, ..} ) <$> f v1alpha1VolumeErrorTime | 236 | v1alpha1VolumeErrorTimeL f V1alpha1VolumeError{..} = (\v1alpha1VolumeErrorTime -> V1alpha1VolumeError { v1alpha1VolumeErrorTime, ..} ) <$> f v1alpha1VolumeErrorTime | 164 | true | true | 1 | 8 | 23 | 61 | 30 | 31 | null | null |
AaronFriel/Iota | Data/Iota/Stateful/Text.hs | bsd-3-clause | -- Simplified parser.
iotaS :: (IotaS a b) => (a, b) -> Text -> (Builder, a, b)
iotaS s t = closeIotaS $ runIotaS s t | 118 | iotaS :: (IotaS a b) => (a, b) -> Text -> (Builder, a, b)
iotaS s t = closeIotaS $ runIotaS s t | 95 | iotaS s t = closeIotaS $ runIotaS s t | 37 | true | true | 0 | 8 | 26 | 60 | 33 | 27 | null | null |
databrary/databrary | src/Model/Volume/Types.hs | agpl-3.0 | -- | Convert shareFull value read from db into a policy
-- value, applying a default if needed.
toPolicyDefaulting :: Maybe Bool -> a -> a -> a
toPolicyDefaulting mShareFull noPolicy restrictedPolicy =
let
-- in the rare circumstance that a volume access
-- entry in db improperly contains null for p... | 550 | toPolicyDefaulting :: Maybe Bool -> a -> a -> a
toPolicyDefaulting mShareFull noPolicy restrictedPolicy =
let
-- in the rare circumstance that a volume access
-- entry in db improperly contains null for public/shared group,
-- arbitrarily use True to follow old convention before sharefull
... | 454 | toPolicyDefaulting mShareFull noPolicy restrictedPolicy =
let
-- in the rare circumstance that a volume access
-- entry in db improperly contains null for public/shared group,
-- arbitrarily use True to follow old convention before sharefull
-- was introduced.
shareFull = fro... | 406 | true | true | 0 | 9 | 133 | 63 | 34 | 29 | null | null |
mvr/abyme | haskell-model/src/Abyme/Regiony/Addressing.hs | bsd-3-clause | isInhabited :: Universe -> Location -> Bool
isInhabited u l = isJust $ inhabitant u l | 85 | isInhabited :: Universe -> Location -> Bool
isInhabited u l = isJust $ inhabitant u l | 85 | isInhabited u l = isJust $ inhabitant u l | 41 | false | true | 0 | 6 | 15 | 33 | 16 | 17 | null | null |
snowleopard/alga | src/Algebra/Graph/ToGraph.hs | mit | adjacencyMap :: ToGraph t => Ord (ToVertex t) => t -> Map (ToVertex t) (Set (ToVertex t))
adjacencyMap = AM.adjacencyMap . toAdjacencyMap | 137 | adjacencyMap :: ToGraph t => Ord (ToVertex t) => t -> Map (ToVertex t) (Set (ToVertex t))
adjacencyMap = AM.adjacencyMap . toAdjacencyMap | 137 | adjacencyMap = AM.adjacencyMap . toAdjacencyMap | 47 | false | true | 0 | 12 | 21 | 64 | 31 | 33 | null | null |
ice1000/OI-codes | codewars/101-200/tiny-three-pass-compiler_flymake.hs | agpl-3.0 | mergeHelper (TChar '*') a b = Mul a b | 37 | mergeHelper (TChar '*') a b = Mul a b | 37 | mergeHelper (TChar '*') a b = Mul a b | 37 | false | false | 1 | 7 | 8 | 26 | 11 | 15 | null | null |
JustusAdam/servestatic | app/Main.hs | bsd-3-clause | main :: IO ()
main = do
args <- getArgs
let dir = case args of
[] -> "."
[directory] -> directory
_ -> error "Incorrect number of arguments provided (expected 1)"
serveSnaplet defaultConfig $ initDocumentServer "" dir | 265 | main :: IO ()
main = do
args <- getArgs
let dir = case args of
[] -> "."
[directory] -> directory
_ -> error "Incorrect number of arguments provided (expected 1)"
serveSnaplet defaultConfig $ initDocumentServer "" dir | 265 | main = do
args <- getArgs
let dir = case args of
[] -> "."
[directory] -> directory
_ -> error "Incorrect number of arguments provided (expected 1)"
serveSnaplet defaultConfig $ initDocumentServer "" dir | 251 | false | true | 0 | 13 | 85 | 77 | 36 | 41 | null | null |
andrewthad/persistent | persistent/Database/Persist/Sql/Util.hs | mit | dbColumns :: SqlBackend -> EntityDef -> [Text]
dbColumns conn t = case entityPrimary t of
Just _ -> flds
Nothing -> escapeDB (entityId t) : flds
where
escapeDB = connEscapeName conn . fieldDB
flds = map escapeDB (entityFields t) | 253 | dbColumns :: SqlBackend -> EntityDef -> [Text]
dbColumns conn t = case entityPrimary t of
Just _ -> flds
Nothing -> escapeDB (entityId t) : flds
where
escapeDB = connEscapeName conn . fieldDB
flds = map escapeDB (entityFields t) | 253 | dbColumns conn t = case entityPrimary t of
Just _ -> flds
Nothing -> escapeDB (entityId t) : flds
where
escapeDB = connEscapeName conn . fieldDB
flds = map escapeDB (entityFields t) | 206 | false | true | 4 | 10 | 63 | 90 | 44 | 46 | null | null |
yangsiwei880813/CS644 | src/Lexical.hs | gpl-2.0 | tokenLength :: Token -> Int
tokenLength token = length $ lexeme token | 69 | tokenLength :: Token -> Int
tokenLength token = length $ lexeme token | 69 | tokenLength token = length $ lexeme token | 41 | false | true | 2 | 7 | 11 | 31 | 13 | 18 | null | null |
Fuuzetsu/haddock | haddock-library/src/Documentation/Haddock/Parser.hs | bsd-2-clause | since :: Parser (DocH mod a)
since = ("@since " *> version <* skipHorizontalSpace <* endOfLine) >>= setSince >> return DocEmpty
where
version = decimal `sepBy1'` "."
-- | Headers inside the comment denoted with @=@ signs, up to 6 levels
-- deep.
--
-- >>> snd <$> parseOnly header "= Hello"
-- Right (DocHeader (H... | 502 | since :: Parser (DocH mod a)
since = ("@since " *> version <* skipHorizontalSpace <* endOfLine) >>= setSince >> return DocEmpty
where
version = decimal `sepBy1'` "."
-- | Headers inside the comment denoted with @=@ signs, up to 6 levels
-- deep.
--
-- >>> snd <$> parseOnly header "= Hello"
-- Right (DocHeader (H... | 502 | since = ("@since " *> version <* skipHorizontalSpace <* endOfLine) >>= setSince >> return DocEmpty
where
version = decimal `sepBy1'` "."
-- | Headers inside the comment denoted with @=@ signs, up to 6 levels
-- deep.
--
-- >>> snd <$> parseOnly header "= Hello"
-- Right (DocHeader (Header {headerLevel = 1, heade... | 473 | false | true | 0 | 10 | 88 | 69 | 39 | 30 | null | null |
scott-fleischman/greek-grammar | haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs | mit | decomposeChar '\x095D' = "\x0922\x093C" | 39 | decomposeChar '\x095D' = "\x0922\x093C" | 39 | decomposeChar '\x095D' = "\x0922\x093C" | 39 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
marcellussiegburg/autotool | collection/src/Polynomial/Grobner/Compute.hs | gpl-2.0 | info opt d = when (verbose opt) $ inform d | 42 | info opt d = when (verbose opt) $ inform d | 42 | info opt d = when (verbose opt) $ inform d | 42 | false | false | 0 | 8 | 9 | 27 | 12 | 15 | null | null |
Chattered/proplcf | BootstrapDIY.hs | mit | matchMP :: (Ord a, Show a) => Theorem a -> Proof a -> Proof a
matchMP imp ant = matchMPInst imp ant pure | 104 | matchMP :: (Ord a, Show a) => Theorem a -> Proof a -> Proof a
matchMP imp ant = matchMPInst imp ant pure | 104 | matchMP imp ant = matchMPInst imp ant pure | 42 | false | true | 0 | 9 | 22 | 62 | 27 | 35 | null | null |
pparkkin/eta | compiler/ETA/Utils/FastTypes.hs | bsd-3-clause | shiftR_FastInt x y = uncheckedIShiftRL# x y | 43 | shiftR_FastInt x y = uncheckedIShiftRL# x y | 43 | shiftR_FastInt x y = uncheckedIShiftRL# x y | 43 | false | false | 0 | 5 | 6 | 16 | 7 | 9 | null | null |
rueshyna/gogol | gogol-dataflow/gen/Network/Google/Dataflow/Types/Product.hs | mpl-2.0 | -- | The command to launch the worker harness.
trsHarnessCommand :: Lens' TaskRunnerSettings (Maybe Text)
trsHarnessCommand
= lens _trsHarnessCommand
(\ s a -> s{_trsHarnessCommand = a}) | 194 | trsHarnessCommand :: Lens' TaskRunnerSettings (Maybe Text)
trsHarnessCommand
= lens _trsHarnessCommand
(\ s a -> s{_trsHarnessCommand = a}) | 147 | trsHarnessCommand
= lens _trsHarnessCommand
(\ s a -> s{_trsHarnessCommand = a}) | 88 | true | true | 1 | 9 | 33 | 52 | 25 | 27 | null | null |
spechub/Hets | OWL2/Morphism.hs | gpl-2.0 | legalMor :: OWLMorphism -> Result ()
legalMor m = let mm = mmaps m in unless
(Set.isSubsetOf (Map.keysSet mm) (symOf $ osource m)
&& Set.isSubsetOf (Set.fromList $ inducedElems mm) (symOf $ otarget m))
$ fail "illegal OWL2 morphism" | 244 | legalMor :: OWLMorphism -> Result ()
legalMor m = let mm = mmaps m in unless
(Set.isSubsetOf (Map.keysSet mm) (symOf $ osource m)
&& Set.isSubsetOf (Set.fromList $ inducedElems mm) (symOf $ otarget m))
$ fail "illegal OWL2 morphism" | 244 | legalMor m = let mm = mmaps m in unless
(Set.isSubsetOf (Map.keysSet mm) (symOf $ osource m)
&& Set.isSubsetOf (Set.fromList $ inducedElems mm) (symOf $ otarget m))
$ fail "illegal OWL2 morphism" | 207 | false | true | 0 | 11 | 49 | 108 | 51 | 57 | null | null |
bgwines/zora | Zora/List.hs | bsd-3-clause | -- | Applies the given ternary function to all three elements of the given tuple.
triple_op :: (a -> b -> c -> d) -> (a, b, c) -> d
triple_op op (a, b, c) = op a b c | 165 | triple_op :: (a -> b -> c -> d) -> (a, b, c) -> d
triple_op op (a, b, c) = op a b c | 83 | triple_op op (a, b, c) = op a b c | 33 | true | true | 0 | 9 | 39 | 65 | 36 | 29 | null | null |
sdiehl/ghc | compiler/types/TyCoFVs.hs | bsd-3-clause | almost_devoid_co_var_of_co (ForAllCo v kind_co co) cv
= almost_devoid_co_var_of_co kind_co cv
&& (v == cv || almost_devoid_co_var_of_co co cv) | 146 | almost_devoid_co_var_of_co (ForAllCo v kind_co co) cv
= almost_devoid_co_var_of_co kind_co cv
&& (v == cv || almost_devoid_co_var_of_co co cv) | 146 | almost_devoid_co_var_of_co (ForAllCo v kind_co co) cv
= almost_devoid_co_var_of_co kind_co cv
&& (v == cv || almost_devoid_co_var_of_co co cv) | 146 | false | false | 2 | 8 | 21 | 48 | 22 | 26 | null | null |
ezyang/ghc | compiler/nativeGen/X86/Ppr.hs | bsd-3-clause | pprInstr (POPCNT format src dst) = pprOpOp (sLit "popcnt") format src (OpReg dst) | 81 | pprInstr (POPCNT format src dst) = pprOpOp (sLit "popcnt") format src (OpReg dst) | 81 | pprInstr (POPCNT format src dst) = pprOpOp (sLit "popcnt") format src (OpReg dst) | 81 | false | false | 0 | 7 | 12 | 40 | 19 | 21 | null | null |
erantapaa/haskellnews | src/HN/Model/Github.hs | bsd-3-clause | repoToItem :: G.Repo -> Maybe NewItem
repoToItem repo = do
uri <- parseURI $ G.repoHtmlUrl repo
published <- fmap toZonedTime (G.repoCreatedAt repo)
let title = ownerLogin repo ++ "/" ++ G.repoName repo
let descr = fromMaybe "No description" $ G.repoDescription repo
return $ NewItem title published descr uri | 319 | repoToItem :: G.Repo -> Maybe NewItem
repoToItem repo = do
uri <- parseURI $ G.repoHtmlUrl repo
published <- fmap toZonedTime (G.repoCreatedAt repo)
let title = ownerLogin repo ++ "/" ++ G.repoName repo
let descr = fromMaybe "No description" $ G.repoDescription repo
return $ NewItem title published descr uri | 319 | repoToItem repo = do
uri <- parseURI $ G.repoHtmlUrl repo
published <- fmap toZonedTime (G.repoCreatedAt repo)
let title = ownerLogin repo ++ "/" ++ G.repoName repo
let descr = fromMaybe "No description" $ G.repoDescription repo
return $ NewItem title published descr uri | 281 | false | true | 1 | 10 | 57 | 117 | 54 | 63 | null | null |
reckbo/ppl | pipeline-lib/FSL.hs | bsd-3-clause | dwiToNrrd :: [String] -> FilePath -> Action FilePath
dwiToNrrd options dwi = do
let out = replaceExtension' dwi "nrrd"
command_ [] "DWIConvert" $ ["--conversionMode"
,"FSLToNrrd"
,"--fslNIFTIFile", dwi
,"--inputBValues", tobval dwi
... | 465 | dwiToNrrd :: [String] -> FilePath -> Action FilePath
dwiToNrrd options dwi = do
let out = replaceExtension' dwi "nrrd"
command_ [] "DWIConvert" $ ["--conversionMode"
,"FSLToNrrd"
,"--fslNIFTIFile", dwi
,"--inputBValues", tobval dwi
... | 465 | dwiToNrrd options dwi = do
let out = replaceExtension' dwi "nrrd"
command_ [] "DWIConvert" $ ["--conversionMode"
,"FSLToNrrd"
,"--fslNIFTIFile", dwi
,"--inputBValues", tobval dwi
,"--inputBVectors", tobvec dw... | 412 | false | true | 0 | 11 | 207 | 109 | 54 | 55 | null | null |
diesys/config | XMonad/xmonad.hs | gpl-3.0 | ------------------------------------------------------------------------
-- Now run xmonad with all the defaults we set up.
-- Run xmonad with the settings you specify. No need to modify this.
--
main = xmonad =<< xmobar defaults | 230 | main = xmonad =<< xmobar defaults | 33 | main = xmonad =<< xmobar defaults | 33 | true | false | 2 | 5 | 32 | 21 | 10 | 11 | null | null |
green-haskell/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | dATA_STRING = mkBaseModule (fsLit "Data.String") | 52 | dATA_STRING = mkBaseModule (fsLit "Data.String") | 52 | dATA_STRING = mkBaseModule (fsLit "Data.String") | 52 | false | false | 0 | 7 | 8 | 15 | 7 | 8 | null | null |
ezrakilty/narc | Database/Narc/Type.hs | bsd-2-clause | isBaseTy TString = True | 24 | isBaseTy TString = True | 24 | isBaseTy TString = True | 24 | false | false | 1 | 5 | 4 | 13 | 4 | 9 | null | null |
flipstone/kioku | src/Database/Kioku/Memorizable.hs | mit | memorizeEnum :: Enum a => a -> BS.ByteString
memorizeEnum = memorizeInteger . fromIntegral . fromEnum | 101 | memorizeEnum :: Enum a => a -> BS.ByteString
memorizeEnum = memorizeInteger . fromIntegral . fromEnum | 101 | memorizeEnum = memorizeInteger . fromIntegral . fromEnum | 56 | false | true | 0 | 7 | 14 | 32 | 16 | 16 | null | null |
ghcjs/ghcjs | src/Gen2/Compactor.hs | mit | identsS :: Traversal' JStat Ident
identsS f (DeclStat i) = DeclStat <$> f i | 89 | identsS :: Traversal' JStat Ident
identsS f (DeclStat i) = DeclStat <$> f i | 89 | identsS f (DeclStat i) = DeclStat <$> f i | 55 | false | true | 1 | 6 | 27 | 39 | 16 | 23 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-data/Data/Drasil/SI_Units.hs | bsd-2-clause | specificE :: UnitDefn
specificE = makeDerU (dcc "specificE" (cnIES "specific energy")
"energy per unit mass") (joule /: kilogram) | 132 | specificE :: UnitDefn
specificE = makeDerU (dcc "specificE" (cnIES "specific energy")
"energy per unit mass") (joule /: kilogram) | 132 | specificE = makeDerU (dcc "specificE" (cnIES "specific energy")
"energy per unit mass") (joule /: kilogram) | 110 | false | true | 0 | 9 | 20 | 46 | 21 | 25 | null | null |
GaloisInc/halvm-ghc | compiler/main/DynFlags.hs | bsd-3-clause | -- Turn these flags off when enabling this way
wayUnsetGeneralFlags :: Platform -> Way -> [GeneralFlag]
wayUnsetGeneralFlags _ (WayCustom {}) = [] | 146 | wayUnsetGeneralFlags :: Platform -> Way -> [GeneralFlag]
wayUnsetGeneralFlags _ (WayCustom {}) = [] | 99 | wayUnsetGeneralFlags _ (WayCustom {}) = [] | 42 | true | true | 0 | 7 | 21 | 37 | 20 | 17 | null | null |
mumuki/mulang | src/Language/Mulang/Analyzer/EdlQueryCompiler.hs | gpl-3.0 | primitiveDeclaration = decodeDeclarationInspection | 50 | primitiveDeclaration = decodeDeclarationInspection | 50 | primitiveDeclaration = decodeDeclarationInspection | 50 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
DNNX/invariant-functors | src/Data/Functor/Invariant/TH/Internal.hs | bsd-2-clause | tvbName (KindedTV name _) = name | 32 | tvbName (KindedTV name _) = name | 32 | tvbName (KindedTV name _) = name | 32 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
hguenther/smtlib2 | Language/SMTLib2/Internals/Type/List.hs | gpl-3.0 | remove :: List e lst -> Natural idx -> List e (Remove lst idx)
remove (x ::: xs) Zero = xs | 90 | remove :: List e lst -> Natural idx -> List e (Remove lst idx)
remove (x ::: xs) Zero = xs | 90 | remove (x ::: xs) Zero = xs | 27 | false | true | 0 | 9 | 20 | 52 | 25 | 27 | null | null |
phaul/chess | Chess/Board/Attacks.hs | bsd-3-clause | ------------------------------------------------------------------------------
attackList
:: [PieceType]
-> Board
-> BitBoard
-> Colour
-> Square
-> [BitBoard]
attackList l b occ c s =
[ attackBitBoard pt s occ c .&. piecesOf b c pt | pt <- l ] | 258 | attackList
:: [PieceType]
-> Board
-> BitBoard
-> Colour
-> Square
-> [BitBoard]
attackList l b occ c s =
[ attackBitBoard pt s occ c .&. piecesOf b c pt | pt <- l ] | 179 | attackList l b occ c s =
[ attackBitBoard pt s occ c .&. piecesOf b c pt | pt <- l ] | 86 | true | true | 0 | 12 | 50 | 86 | 42 | 44 | null | null |
SamirTalwar/advent-of-code | 2016/AOC_10_1.hs | mit | botRange :: [Instruction] -> (Int, Int)
botRange instructions = (Set.findMin bots, Set.findMax bots)
where
bots = Set.fromList $ concatMap identifyBots instructions
identifyBots (StartingValue (Bot bot) _) = [bot]
identifyBots (Give (Bot source) (Bot lowDestination) (Bot highDestination)) = [source, lowDe... | 842 | botRange :: [Instruction] -> (Int, Int)
botRange instructions = (Set.findMin bots, Set.findMax bots)
where
bots = Set.fromList $ concatMap identifyBots instructions
identifyBots (StartingValue (Bot bot) _) = [bot]
identifyBots (Give (Bot source) (Bot lowDestination) (Bot highDestination)) = [source, lowDe... | 842 | botRange instructions = (Set.findMin bots, Set.findMax bots)
where
bots = Set.fromList $ concatMap identifyBots instructions
identifyBots (StartingValue (Bot bot) _) = [bot]
identifyBots (Give (Bot source) (Bot lowDestination) (Bot highDestination)) = [source, lowDestination, highDestination]
identify... | 802 | false | true | 3 | 8 | 139 | 351 | 174 | 177 | null | null |
armoredsoftware/protocol | demos/PaulPractice/BookSimpleTypedLambda.hs | bsd-3-clause | {- ECA: Look at how much closer this implementation matches our written rules.
Note that ordering of the conditionals matters!
-}
eval2 :: T -> T
eval2 (App x y)
| isAbst x && isValue y = -- E-AppAbs
let (Abst a z) = x in
sub2 z (y, a)
| isValue x = eval . App x $ eva... | 374 | eval2 :: T -> T
eval2 (App x y)
| isAbst x && isValue y = -- E-AppAbs
let (Abst a z) = x in
sub2 z (y, a)
| isValue x = eval . App x $ eval y -- E-App2
| otherwise = eval $ App (eval x) y | 234 | eval2 (App x y)
| isAbst x && isValue y = -- E-AppAbs
let (Abst a z) = x in
sub2 z (y, a)
| isValue x = eval . App x $ eval y -- E-App2
| otherwise = eval $ App (eval x) y | 218 | true | true | 0 | 11 | 128 | 126 | 59 | 67 | null | null |
bergmark/wl-pprint | Text/PrettyPrint/Leijen.hs | bsd-2-clause | -- | The document @(integer i)@ shows the literal integer @i@ using
-- 'text'.
integer :: Integer -> Doc
integer i = text (show i) | 136 | integer :: Integer -> Doc
integer i = text (show i) | 57 | integer i = text (show i) | 31 | true | true | 0 | 7 | 30 | 34 | 16 | 18 | null | null |
ribag/ganeti-experiments | src/Ganeti/HTools/Cluster.hs | gpl-2.0 | -- | Compute statistical measures of a single node.
compDetailedCVNode :: Node.Node -> [Double]
compDetailedCVNode node =
let mem = Node.pMem node
dsk = Node.pDsk node
n1 = fromIntegral
$ if Node.failN1 node
then length (Node.sList node) + length (Node.pList node)
... | 921 | compDetailedCVNode :: Node.Node -> [Double]
compDetailedCVNode node =
let mem = Node.pMem node
dsk = Node.pDsk node
n1 = fromIntegral
$ if Node.failN1 node
then length (Node.sList node) + length (Node.pList node)
else 0
res = Node.pRem node
ipri = fromI... | 869 | compDetailedCVNode node =
let mem = Node.pMem node
dsk = Node.pDsk node
n1 = fromIntegral
$ if Node.failN1 node
then length (Node.sList node) + length (Node.pList node)
else 0
res = Node.pRem node
ipri = fromIntegral . length $ Node.pList node
ise... | 825 | true | true | 0 | 15 | 259 | 321 | 169 | 152 | null | null |
CulpaBS/wbBach | src/Futhark/CodeGen/Backends/PyOpenCL.hs | bsd-3-clause | callKernel :: Py.OpCompiler Imp.OpenCL ()
callKernel (Imp.GetNumGroups v) = do
Py.stm $ Assign (Var (textual v)) $ Constant $ value (128::Int32)
return Py.Done | 163 | callKernel :: Py.OpCompiler Imp.OpenCL ()
callKernel (Imp.GetNumGroups v) = do
Py.stm $ Assign (Var (textual v)) $ Constant $ value (128::Int32)
return Py.Done | 163 | callKernel (Imp.GetNumGroups v) = do
Py.stm $ Assign (Var (textual v)) $ Constant $ value (128::Int32)
return Py.Done | 121 | false | true | 0 | 14 | 26 | 82 | 39 | 43 | null | null |
enolan/emp-pl-site | Forms.hs | agpl-3.0 | bsBoolField :: (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Bool
bsBoolField = boolField {fieldView =
\_theId name _attrs val req -> [whamlet|
$newline never
<span .bool-container>
<label .radio-inline>
<input type=radio name=#{name} value=yes :showVal id val:checked :req:required>
_{MsgB... | 494 | bsBoolField :: (Monad m, RenderMessage (HandlerSite m) FormMessage) => Field m Bool
bsBoolField = boolField {fieldView =
\_theId name _attrs val req -> [whamlet|
$newline never
<span .bool-container>
<label .radio-inline>
<input type=radio name=#{name} value=yes :showVal id val:checked :req:required>
_{MsgB... | 494 | bsBoolField = boolField {fieldView =
\_theId name _attrs val req -> [whamlet|
$newline never
<span .bool-container>
<label .radio-inline>
<input type=radio name=#{name} value=yes :showVal id val:checked :req:required>
_{MsgBoolYes}
<label .radio-inline>
<input type=radio name=#{name} value=no :showVal... | 410 | false | true | 0 | 8 | 80 | 83 | 46 | 37 | null | null |
ben-schulz/Idris-dev | src/IRTS/CodegenJavaScript.hs | bsd-3-clause | toFnType t = error (show t ++ " not defined in toFnType") | 57 | toFnType t = error (show t ++ " not defined in toFnType") | 57 | toFnType t = error (show t ++ " not defined in toFnType") | 57 | false | false | 0 | 8 | 11 | 22 | 10 | 12 | null | null |
henrystanley/Quark | Quark/QType.hs | cc0-1.0 | qtype (QQuote _ _) = Quote | 26 | qtype (QQuote _ _) = Quote | 26 | qtype (QQuote _ _) = Quote | 26 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
dkensinger/haskell | haskell-primes/AtkinSieve.hs | gpl-3.0 | eratosthenesSieve :: (Integral a) => a -> [a]
eratosthenesSieve n
| n < 2 = []
| otherwise = 2 : sieve [3,5..n]
where
isn = isqrt n
sieve [] = []
sieve ps'@(p:ps)
| p <= isn = p : sieve [ n | n <- ps, n `mod` p /= 0 ]
| otherwise = ps' | 275 | eratosthenesSieve :: (Integral a) => a -> [a]
eratosthenesSieve n
| n < 2 = []
| otherwise = 2 : sieve [3,5..n]
where
isn = isqrt n
sieve [] = []
sieve ps'@(p:ps)
| p <= isn = p : sieve [ n | n <- ps, n `mod` p /= 0 ]
| otherwise = ps' | 275 | eratosthenesSieve n
| n < 2 = []
| otherwise = 2 : sieve [3,5..n]
where
isn = isqrt n
sieve [] = []
sieve ps'@(p:ps)
| p <= isn = p : sieve [ n | n <- ps, n `mod` p /= 0 ]
| otherwise = ps' | 229 | false | true | 5 | 11 | 97 | 158 | 79 | 79 | null | null |
Alex-Diez/haskell-tdd-kata | old-katas/test/LeapYearKata/Day1Spec.hs | bsd-3-clause | spec :: Spec
spec = do
it "is a leap year when divisible by 4" $ do
isLeapYear 2016
it "is not a leap year when not divisible by 4" $ do
not $ isLeapYear 2015
it "is not a leap year when divisible by 100" $ do
not $ isLeapYear 1900
it "is a leap... | 387 | spec :: Spec
spec = do
it "is a leap year when divisible by 4" $ do
isLeapYear 2016
it "is not a leap year when not divisible by 4" $ do
not $ isLeapYear 2015
it "is not a leap year when divisible by 100" $ do
not $ isLeapYear 1900
it "is a leap yea... | 383 | spec = do
it "is a leap year when divisible by 4" $ do
isLeapYear 2016
it "is not a leap year when not divisible by 4" $ do
not $ isLeapYear 2015
it "is not a leap year when divisible by 100" $ do
not $ isLeapYear 1900
it "is a leap year when divisi... | 370 | false | true | 0 | 11 | 153 | 90 | 35 | 55 | null | null |
wavewave/pipeline-eventgen | lib/HEP/Automation/EventGeneration/Job.hs | gpl-3.0 | startDeploy :: FilePath -- ^ deploy config
-> ComputerName -- ^ computer name
-> FilePath -- ^ output config (individual)
-> IO ()
startDeploy fp cname outcfg = do
putStrLn "deploy called"
getDeployConfig fp >>=
maybe (return ()) ( \dc -> do
cdir <- getCu... | 1,007 | startDeploy :: FilePath -- ^ deploy config
-> ComputerName -- ^ computer name
-> FilePath -- ^ output config (individual)
-> IO ()
startDeploy fp cname outcfg = do
putStrLn "deploy called"
getDeployConfig fp >>=
maybe (return ()) ( \dc -> do
cdir <- getCu... | 1,007 | startDeploy fp cname outcfg = do
putStrLn "deploy called"
getDeployConfig fp >>=
maybe (return ()) ( \dc -> do
cdir <- getCurrentDirectory
let outcfg_cano = cdir </> outcfg
let pkey = deploy_privatekeyfile dc
pswd = deploy_passwordstore dc
Just cr <- getCredential pkey pswd... | 827 | false | true | 0 | 16 | 301 | 285 | 133 | 152 | null | null |
pheaver/BitVector | Data/BitVector/BitVector2.hs | bsd-3-clause | convertToBit (True, False) = T | 31 | convertToBit (True, False) = T | 31 | convertToBit (True, False) = T | 31 | false | false | 0 | 6 | 5 | 15 | 8 | 7 | null | null |
dylanmc/cryptol | src/Cryptol/ModuleSystem/Monad.hs | bsd-3-clause | getEvalEnv :: ModuleM EvalEnv
getEvalEnv = ModuleT (meEvalEnv `fmap` get) | 74 | getEvalEnv :: ModuleM EvalEnv
getEvalEnv = ModuleT (meEvalEnv `fmap` get) | 74 | getEvalEnv = ModuleT (meEvalEnv `fmap` get) | 44 | false | true | 0 | 7 | 10 | 26 | 14 | 12 | null | null |
ksaveljev/hake-2 | src/QCommon/CVar.hs | bsd-3-clause | updateLatchedVar :: CVarT -> B.ByteString -> B.ByteString -> Quake CVarT
updateLatchedVar var name value = do
state <- use (globals.gServerState)
proceedUpdate state
where
proceedUpdate state
| Just value == latchedString = return var
| isNothing latchedString && value == (var^.cvString) =... | 480 | updateLatchedVar :: CVarT -> B.ByteString -> B.ByteString -> Quake CVarT
updateLatchedVar var name value = do
state <- use (globals.gServerState)
proceedUpdate state
where
proceedUpdate state
| Just value == latchedString = return var
| isNothing latchedString && value == (var^.cvString) =... | 480 | updateLatchedVar var name value = do
state <- use (globals.gServerState)
proceedUpdate state
where
proceedUpdate state
| Just value == latchedString = return var
| isNothing latchedString && value == (var^.cvString) = return var
| state /= 0 = delayedVarUpdate var name value
... | 407 | false | true | 2 | 10 | 111 | 176 | 77 | 99 | null | null |
noughtmare/yi | yi-keymap-vim/src/Yi/Keymap/Vim/Digraph.hs | gpl-2.0 | -- LATIN CAPITAL LETTER U WITH CARON
switch 'u' '<' = '\x01D4' | 62 | switch 'u' '<' = '\x01D4' | 25 | switch 'u' '<' = '\x01D4' | 25 | true | false | 0 | 5 | 11 | 12 | 6 | 6 | null | null |
graninas/Haskell-Algorithms | Tests/FizzBuzz4.hs | gpl-3.0 | fizzBuzz x | isDivided x 15 = "FizzBuzz"
| isDivided x 5 = "Buzz"
| isDivided x 3 = "Fizz"
| otherwise = show x | 177 | fizzBuzz x | isDivided x 15 = "FizzBuzz"
| isDivided x 5 = "Buzz"
| isDivided x 3 = "Fizz"
| otherwise = show x | 177 | fizzBuzz x | isDivided x 15 = "FizzBuzz"
| isDivided x 5 = "Buzz"
| isDivided x 3 = "Fizz"
| otherwise = show x | 177 | false | false | 0 | 8 | 90 | 60 | 25 | 35 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/TextTrack.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/TextTrack.removeRegion Mozilla TextTrack.removeRegion documentation>
removeRegion ::
(MonadDOM m) => TextTrack -> Maybe VTTRegion -> m ()
removeRegion self region
= liftDOM (void (self ^. jsf "removeRegion" [toJSVal region])) | 296 | removeRegion ::
(MonadDOM m) => TextTrack -> Maybe VTTRegion -> m ()
removeRegion self region
= liftDOM (void (self ^. jsf "removeRegion" [toJSVal region])) | 171 | removeRegion self region
= liftDOM (void (self ^. jsf "removeRegion" [toJSVal region])) | 89 | true | true | 0 | 12 | 45 | 69 | 34 | 35 | null | null |
hvr/vector | Data/Vector/Storable.hs | bsd-3-clause | last = G.last | 13 | last = G.last | 13 | last = G.last | 13 | false | false | 1 | 6 | 2 | 12 | 4 | 8 | null | null |
danr/hipspec | examples/old-examples/quickspec/ZenoLists.hs | gpl-3.0 | {-
prop_62 xs x
= given (xs == [] =:= False)
$ last (x:xs) =:= last xs
-}
{-
prop_63 (n :: Nat) xs
= givenBool (n < len xs)
$ last (drop n xs) =:= last xs
-}
prop_64 :: Nat -> [Nat] -> Prop Nat
prop_64 x xs
= last (xs ++ [x]) =:= x | 243 | prop_64 :: Nat -> [Nat] -> Prop Nat
prop_64 x xs
= last (xs ++ [x]) =:= x | 75 | prop_64 x xs
= last (xs ++ [x]) =:= x | 39 | true | true | 0 | 9 | 68 | 49 | 26 | 23 | null | null |
JacquesCarette/literate-scientific-software | code/drasil-printers/Language/Drasil/TeX/Helpers.hs | bsd-2-clause | arrayS = renewcomm "arraystretch" "1.2" | 40 | arrayS = renewcomm "arraystretch" "1.2" | 40 | arrayS = renewcomm "arraystretch" "1.2" | 40 | false | false | 1 | 5 | 5 | 14 | 5 | 9 | null | null |
alexander-at-github/eta | compiler/ETA/SimplCore/SimplUtils.hs | bsd-3-clause | contIsDupable _ = False | 55 | contIsDupable _ = False | 55 | contIsDupable _ = False | 55 | false | false | 0 | 4 | 35 | 10 | 4 | 6 | null | null |
Bodigrim/arithmoi | Math/NumberTheory/Utils/FromIntegral.hs | mit | integerToWord64 :: Integer -> Word64
integerToWord64 = fromIntegral | 67 | integerToWord64 :: Integer -> Word64
integerToWord64 = fromIntegral | 67 | integerToWord64 = fromIntegral | 30 | false | true | 0 | 5 | 7 | 15 | 8 | 7 | null | null |
masterdezign/evochess | src/Lib.hs | gpl-3.0 | showS (Just p) = showP p | 24 | showS (Just p) = showP p | 24 | showS (Just p) = showP p | 24 | false | false | 0 | 7 | 5 | 18 | 8 | 10 | null | null |
christiannolte/tip-toi-reveng | src/tttool.hs | mit | main' t ("games": files) = withEachFile (dumpGames t) files | 70 | main' t ("games": files) = withEachFile (dumpGames t) files | 70 | main' t ("games": files) = withEachFile (dumpGames t) files | 70 | false | false | 0 | 7 | 19 | 29 | 14 | 15 | null | null |
shadwstalkr/sqlite-admin | Sqlite/Types.hs | gpl-3.0 | convertSqlValue SqliteTextType val = SqliteText . fromSql $ val | 63 | convertSqlValue SqliteTextType val = SqliteText . fromSql $ val | 63 | convertSqlValue SqliteTextType val = SqliteText . fromSql $ val | 63 | false | false | 0 | 6 | 8 | 19 | 9 | 10 | null | null |
facebookincubator/duckling | Duckling/Time/EN/US/Rules.hs | bsd-3-clause | rulePeriodicHolidays :: [Rule]
rulePeriodicHolidays = mkRuleHolidays
-- Fixed dates, year over year
[ ( "African Liberation Day", "african liberation day", monthDay 5 25 )
, ( "Air Force Birthday", "air force birthday", monthDay 9 18 )
, ( "Alaska Day", "alaska day", monthDay 10 18 )
, ( "American Eagle Day",... | 10,009 | rulePeriodicHolidays :: [Rule]
rulePeriodicHolidays = mkRuleHolidays
-- Fixed dates, year over year
[ ( "African Liberation Day", "african liberation day", monthDay 5 25 )
, ( "Air Force Birthday", "air force birthday", monthDay 9 18 )
, ( "Alaska Day", "alaska day", monthDay 10 18 )
, ( "American Eagle Day",... | 10,009 | rulePeriodicHolidays = mkRuleHolidays
-- Fixed dates, year over year
[ ( "African Liberation Day", "african liberation day", monthDay 5 25 )
, ( "Air Force Birthday", "air force birthday", monthDay 9 18 )
, ( "Alaska Day", "alaska day", monthDay 10 18 )
, ( "American Eagle Day", "american eagle day", monthDay... | 9,978 | false | true | 0 | 11 | 2,086 | 2,371 | 1,366 | 1,005 | null | null |
phischu/fragnix | tests/packages/scotty/Data.Vector.hs | bsd-3-clause | unsafeDrop = G.unsafeDrop | 25 | unsafeDrop = G.unsafeDrop | 25 | unsafeDrop = G.unsafeDrop | 25 | false | false | 0 | 5 | 2 | 8 | 4 | 4 | null | null |
bibaijin/cis194 | src/Spring13/Week3/Golf.hs | bsd-3-clause | each :: Int -> [a] -> [a]
each n list = [list !! i | i <- [n-1, n-1+n..length list - 1]] | 88 | each :: Int -> [a] -> [a]
each n list = [list !! i | i <- [n-1, n-1+n..length list - 1]] | 88 | each n list = [list !! i | i <- [n-1, n-1+n..length list - 1]] | 62 | false | true | 0 | 11 | 21 | 78 | 39 | 39 | null | null |
svenssonjoel/ObsidianGFX | Obsidian/Exp.hs | bsd-3-clause | binOpToIBinOp Mul = IMul | 24 | binOpToIBinOp Mul = IMul | 24 | binOpToIBinOp Mul = IMul | 24 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
ekmett/concurrent | src/Concurrent/Primitive/Ref.hs | bsd-2-clause | prefetchFrozenPrimRef3 (FrozenPrimRef m) = prefetchByteArray3 m 0 | 65 | prefetchFrozenPrimRef3 (FrozenPrimRef m) = prefetchByteArray3 m 0 | 65 | prefetchFrozenPrimRef3 (FrozenPrimRef m) = prefetchByteArray3 m 0 | 65 | false | false | 0 | 6 | 6 | 21 | 9 | 12 | null | null |
brendanhay/gogol | gogol-proximitybeacon/gen/Network/Google/Resource/ProximityBeacon/Namespaces/Update.hs | mpl-2.0 | -- | OAuth access token.
nuAccessToken :: Lens' NamespacesUpdate (Maybe Text)
nuAccessToken
= lens _nuAccessToken
(\ s a -> s{_nuAccessToken = a}) | 154 | nuAccessToken :: Lens' NamespacesUpdate (Maybe Text)
nuAccessToken
= lens _nuAccessToken
(\ s a -> s{_nuAccessToken = a}) | 129 | nuAccessToken
= lens _nuAccessToken
(\ s a -> s{_nuAccessToken = a}) | 76 | true | true | 0 | 8 | 29 | 49 | 25 | 24 | null | null |
myuon/Chimera | Chimera/Scripts/Stage2.hs | mit | stage2 :: (Given Resource, Given Config) => Stage ()
stage2 = do
lift $ addEffect effPlayerBack
wait 50
keeper $ initEnemy (V2 224 (-40)) 100 & runAuto .~ gameOfLife | 173 | stage2 :: (Given Resource, Given Config) => Stage ()
stage2 = do
lift $ addEffect effPlayerBack
wait 50
keeper $ initEnemy (V2 224 (-40)) 100 & runAuto .~ gameOfLife | 173 | stage2 = do
lift $ addEffect effPlayerBack
wait 50
keeper $ initEnemy (V2 224 (-40)) 100 & runAuto .~ gameOfLife | 120 | false | true | 0 | 14 | 36 | 80 | 38 | 42 | null | null |
patperry/hs-linear-algebra | tests/STVector.hs | bsd-3-clause | prop_swap t (VectorPair x y) = runST $
x `mutatesToVector` y $ \mx ->
y `mutatesToVector` x $ \my ->
V.swap mx my
where
_ = typed t x | 155 | prop_swap t (VectorPair x y) = runST $
x `mutatesToVector` y $ \mx ->
y `mutatesToVector` x $ \my ->
V.swap mx my
where
_ = typed t x | 155 | prop_swap t (VectorPair x y) = runST $
x `mutatesToVector` y $ \mx ->
y `mutatesToVector` x $ \my ->
V.swap mx my
where
_ = typed t x | 155 | false | false | 0 | 10 | 50 | 74 | 38 | 36 | null | null |
thiagorp/deployments-web | app/v1/projects/actions/Create.hs | bsd-3-clause | server :: Server Api
server = enter libToServant create | 55 | server :: Server Api
server = enter libToServant create | 55 | server = enter libToServant create | 34 | false | true | 0 | 5 | 8 | 19 | 9 | 10 | null | null |
ScrambledEggsOnToast/kdt | lib-src/Data/KdMap/Dynamic.hs | mit | inRange :: Real a => KdMap a p v
-> p -- ^ lower bounds of range
-> p -- ^ upper bounds of range
-> [(p, v)] -- ^ point-value pairs within given
-- range
inRange (KdMap trees _ _ _) lowers uppers =
L.concatMap (\t -> KDM.inRange t low... | 337 | inRange :: Real a => KdMap a p v
-> p -- ^ lower bounds of range
-> p -- ^ upper bounds of range
-> [(p, v)]
inRange (KdMap trees _ _ _) lowers uppers =
L.concatMap (\t -> KDM.inRange t lowers uppers) trees | 262 | inRange (KdMap trees _ _ _) lowers uppers =
L.concatMap (\t -> KDM.inRange t lowers uppers) trees | 99 | true | true | 0 | 10 | 138 | 93 | 49 | 44 | null | null |
haskell-works/conduit-succinct-json | src/Data/Succinct.hs | bsd-3-clause | fromBitsDiff :: FromBits a => [Bool] -> ([a] -> [a], [Bool])
fromBitsDiff bs = case fromBits1 bs of
(Nothing, rs) -> (id , rs)
(Just a , rs) -> case fromBitsDiff rs of
(f, ss) -> ((a:) . f, ss) | 215 | fromBitsDiff :: FromBits a => [Bool] -> ([a] -> [a], [Bool])
fromBitsDiff bs = case fromBits1 bs of
(Nothing, rs) -> (id , rs)
(Just a , rs) -> case fromBitsDiff rs of
(f, ss) -> ((a:) . f, ss) | 215 | fromBitsDiff bs = case fromBits1 bs of
(Nothing, rs) -> (id , rs)
(Just a , rs) -> case fromBitsDiff rs of
(f, ss) -> ((a:) . f, ss) | 154 | false | true | 2 | 11 | 61 | 122 | 67 | 55 | null | null |
robstewart57/hdph-rs | src/Control/Parallel/HdpH/Internal/Misc.hs | bsd-3-clause | -------------------------------------------------------------------------------
-- NFData instances for strict and lazy bytestrings
-- by strictly folding rnf for Word8
-- THIS IS in the `bytestring' package from >= 0.10.0.0
-- This instance should be part of module 'Data.ByteString.Lazy'.
{-
instance NFData Lazy.Byte... | 536 | rotate :: Int -> [a] -> [a]
rotate _ [] = [] | 44 | rotate _ [] = [] | 16 | true | true | 0 | 7 | 71 | 42 | 26 | 16 | null | null |
csabahruska/quake3 | game/Main.hs | bsd-3-clause | initWindow :: String -> Int -> Int -> IO Window
initWindow title width height = do
GLFW.init
defaultWindowHints
mapM_ windowHint
[ WindowHint'ContextVersionMajor 3
, WindowHint'ContextVersionMinor 3
, WindowHint'OpenGLProfile OpenGLProfile'Core
, WindowHint'OpenGLForwardCompat True
... | 491 | initWindow :: String -> Int -> Int -> IO Window
initWindow title width height = do
GLFW.init
defaultWindowHints
mapM_ windowHint
[ WindowHint'ContextVersionMajor 3
, WindowHint'ContextVersionMinor 3
, WindowHint'OpenGLProfile OpenGLProfile'Core
, WindowHint'OpenGLForwardCompat True
... | 491 | initWindow title width height = do
GLFW.init
defaultWindowHints
mapM_ windowHint
[ WindowHint'ContextVersionMajor 3
, WindowHint'ContextVersionMinor 3
, WindowHint'OpenGLProfile OpenGLProfile'Core
, WindowHint'OpenGLForwardCompat True
]
Just win <- createWindow width height... | 443 | false | true | 0 | 9 | 113 | 122 | 53 | 69 | null | null |
GaloisInc/ivory | ivory-examples/examples/Alloc.hs | bsd-3-clause | mystrcpy :: Def ('[Ref s ('Array 10 ('Stored IChar)), IString] ':-> ())
mystrcpy = proc "mystrcpy" $ \ buf s -> body $ do
buf' <- assign $ toCArray buf
call_ ptrstrcpy buf' s (arrayLen buf)
retVoid | 203 | mystrcpy :: Def ('[Ref s ('Array 10 ('Stored IChar)), IString] ':-> ())
mystrcpy = proc "mystrcpy" $ \ buf s -> body $ do
buf' <- assign $ toCArray buf
call_ ptrstrcpy buf' s (arrayLen buf)
retVoid | 203 | mystrcpy = proc "mystrcpy" $ \ buf s -> body $ do
buf' <- assign $ toCArray buf
call_ ptrstrcpy buf' s (arrayLen buf)
retVoid | 131 | false | true | 0 | 15 | 42 | 109 | 53 | 56 | null | null |
nevrenato/HetsAlloy | CommonLogic/Morphism.hs | gpl-2.0 | -- propagates the translation to sentences
mapSen_txt :: Morphism -> AS.TEXT -> AS.TEXT
mapSen_txt mor txt = case txt of
AS.Text phrs r -> AS.Text (map (mapSen_phr mor) phrs) r
AS.Named_text n t r -> AS.Named_text n (mapSen_txt mor t) r
-- propagates the translation to sentences | 284 | mapSen_txt :: Morphism -> AS.TEXT -> AS.TEXT
mapSen_txt mor txt = case txt of
AS.Text phrs r -> AS.Text (map (mapSen_phr mor) phrs) r
AS.Named_text n t r -> AS.Named_text n (mapSen_txt mor t) r
-- propagates the translation to sentences | 241 | mapSen_txt mor txt = case txt of
AS.Text phrs r -> AS.Text (map (mapSen_phr mor) phrs) r
AS.Named_text n t r -> AS.Named_text n (mapSen_txt mor t) r
-- propagates the translation to sentences | 196 | true | true | 5 | 11 | 51 | 101 | 49 | 52 | null | null |
manpages/haskonf | test/Haskonf/HaskonfSpec.hs | bsd-2-clause | mainDo xs = do
_ <- build pname
-- -^- Bad: errors should be addressed in real applications
launch xs | 113 | mainDo xs = do
_ <- build pname
-- -^- Bad: errors should be addressed in real applications
launch xs | 113 | mainDo xs = do
_ <- build pname
-- -^- Bad: errors should be addressed in real applications
launch xs | 113 | false | false | 1 | 9 | 31 | 30 | 11 | 19 | null | null |
kim/amazonka | amazonka-opsworks/gen/Network/AWS/OpsWorks/CreateLayer.hs | mpl-2.0 | -- | The layer name, which is used by the console.
clName :: Lens' CreateLayer Text
clName = lens _clName (\s a -> s { _clName = a }) | 133 | clName :: Lens' CreateLayer Text
clName = lens _clName (\s a -> s { _clName = a }) | 82 | clName = lens _clName (\s a -> s { _clName = a }) | 49 | true | true | 0 | 9 | 28 | 40 | 22 | 18 | null | null |
christiaanb/Idris-dev | src/Idris/ElabDecls.hs | bsd-3-clause | psolve tm = return () | 21 | psolve tm = return () | 21 | psolve tm = return () | 21 | false | false | 0 | 6 | 4 | 14 | 6 | 8 | null | null |
DavidAlphaFox/ghc | utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Layout.hs | bsd-3-clause | subBlock :: [Html] -> Maybe Html
subBlock [] = Nothing | 54 | subBlock :: [Html] -> Maybe Html
subBlock [] = Nothing | 54 | subBlock [] = Nothing | 21 | false | true | 0 | 6 | 9 | 26 | 13 | 13 | null | null |
bens/libmpd-haskell | src/Network/MPD/Applicative/Status.hs | lgpl-2.1 | noidle :: Command ()
noidle = Command emptyResponse ["noidle"] | 62 | noidle :: Command ()
noidle = Command emptyResponse ["noidle"] | 62 | noidle = Command emptyResponse ["noidle"] | 41 | false | true | 0 | 6 | 8 | 24 | 12 | 12 | null | null |
Thell/pandoc | src/Text/Pandoc/Writers/Markdown.hs | gpl-2.0 | -- | Return markdown representation of a note.
noteToMarkdown :: WriterOptions -> Int -> [Block] -> State WriterState Doc
noteToMarkdown opts num blocks = do
contents <- blockListToMarkdown opts blocks
let num' = text $ writerIdentifierPrefix opts ++ show num
let marker = if isEnabled Ext_footnotes opts
... | 819 | noteToMarkdown :: WriterOptions -> Int -> [Block] -> State WriterState Doc
noteToMarkdown opts num blocks = do
contents <- blockListToMarkdown opts blocks
let num' = text $ writerIdentifierPrefix opts ++ show num
let marker = if isEnabled Ext_footnotes opts
then text "[^" <> num' <> text "]:"
... | 772 | noteToMarkdown opts num blocks = do
contents <- blockListToMarkdown opts blocks
let num' = text $ writerIdentifierPrefix opts ++ show num
let marker = if isEnabled Ext_footnotes opts
then text "[^" <> num' <> text "]:"
else text "[" <> num' <> text "]"
let markerSize = 4 + o... | 697 | true | true | 0 | 16 | 252 | 243 | 114 | 129 | null | null |
vincenthz/cryptonite | Crypto/MAC/CMAC.hs | bsd-3-clause | cmacChunks :: (BlockCipher k, ByteArray ba) => k -> ba -> ba -> ba -> [ba]
cmacChunks k k1 k2 = rec' where
rec' msg
| B.null tl = if lack == 0
then [bxor k1 hd]
else [bxor k2 $ hd `B.append` B.pack (0x80 : replicate (lack - 1) 0)]
| otherwise = ... | 485 | cmacChunks :: (BlockCipher k, ByteArray ba) => k -> ba -> ba -> ba -> [ba]
cmacChunks k k1 k2 = rec' where
rec' msg
| B.null tl = if lack == 0
then [bxor k1 hd]
else [bxor k2 $ hd `B.append` B.pack (0x80 : replicate (lack - 1) 0)]
| otherwise = ... | 485 | cmacChunks k k1 k2 = rec' where
rec' msg
| B.null tl = if lack == 0
then [bxor k1 hd]
else [bxor k2 $ hd `B.append` B.pack (0x80 : replicate (lack - 1) 0)]
| otherwise = hd : rec' tl
where
bytes = blockSize k
(hd, tl) =... | 410 | false | true | 0 | 16 | 193 | 200 | 100 | 100 | null | null |
emcardoso/CTi | src/Haskell/Parser/ParsePostProcess.hs | bsd-3-clause | fixFunBindsInMatch :: HsMatch -> HsMatch
fixFunBindsInMatch (HsMatch sloc name pats rhs wheres)
= HsMatch sloc name pats (fixFunBindsInRhs rhs) $ fixFunBinds wheres | 167 | fixFunBindsInMatch :: HsMatch -> HsMatch
fixFunBindsInMatch (HsMatch sloc name pats rhs wheres)
= HsMatch sloc name pats (fixFunBindsInRhs rhs) $ fixFunBinds wheres | 167 | fixFunBindsInMatch (HsMatch sloc name pats rhs wheres)
= HsMatch sloc name pats (fixFunBindsInRhs rhs) $ fixFunBinds wheres | 126 | false | true | 0 | 8 | 24 | 54 | 26 | 28 | null | null |
ezyang/ghc | compiler/stgSyn/StgLint.hs | bsd-3-clause | checkTys :: Type -> Type -> MsgDoc -> LintM ()
checkTys ty1 ty2 msg = LintM $ \_lf loc _scope errs
-> if (ty1 `stgEqType` ty2)
then ((), errs)
else ((), addErr errs msg loc) | 185 | checkTys :: Type -> Type -> MsgDoc -> LintM ()
checkTys ty1 ty2 msg = LintM $ \_lf loc _scope errs
-> if (ty1 `stgEqType` ty2)
then ((), errs)
else ((), addErr errs msg loc) | 185 | checkTys ty1 ty2 msg = LintM $ \_lf loc _scope errs
-> if (ty1 `stgEqType` ty2)
then ((), errs)
else ((), addErr errs msg loc) | 138 | false | true | 0 | 9 | 46 | 90 | 49 | 41 | null | null |
isomorphism/webgl | src/Graphics/Rendering/WebGL/Constants.hs | mit | gl_VERTEX_ATTRIB_ARRAY_ENABLED :: GLenum
gl_VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622 | 80 | gl_VERTEX_ATTRIB_ARRAY_ENABLED :: GLenum
gl_VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622 | 80 | gl_VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622 | 39 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
YueLiPicasso/unification | MMAlgoA .Buggy.hs | gpl-3.0 | goodFormFOTEPassesOccursCheck (_ , Constant _) = True | 55 | goodFormFOTEPassesOccursCheck (_ , Constant _) = True | 55 | goodFormFOTEPassesOccursCheck (_ , Constant _) = True | 55 | false | false | 0 | 6 | 8 | 19 | 9 | 10 | null | null |
jwiegley/hnix | src/Nix/Expr/Shorthands.hs | bsd-3-clause | e1 $++ e2 = mkBinop NConcat e1 e2 | 33 | e1 $++ e2 = mkBinop NConcat e1 e2 | 33 | e1 $++ e2 = mkBinop NConcat e1 e2 | 33 | false | false | 0 | 5 | 7 | 19 | 8 | 11 | null | null |
oprdyn/redirector | src/Lookup.hs | gpl-2.0 | --
-- Utility function to extract the reply from the complex type hedis returns. If
-- there's an error condition (regardless of whether it is a Left for server
-- error or Nothing for a blank value), return an empty string.
--
fromReply :: (Either Reply (Maybe S.ByteString)) -> S.ByteString
fromReply x' =
either... | 642 | fromReply :: (Either Reply (Maybe S.ByteString)) -> S.ByteString
fromReply x' =
either first second x'
where
first :: Reply -> S.ByteString
first (Error s') = s'
first _ = ""
second :: (Maybe S.ByteString) -> S.ByteString
second = fromMaybe ""
--
-- Process jump hash. This entry po... | 413 | fromReply x' =
either first second x'
where
first :: Reply -> S.ByteString
first (Error s') = s'
first _ = ""
second :: (Maybe S.ByteString) -> S.ByteString
second = fromMaybe ""
--
-- Process jump hash. This entry point gets us from IO into the Redis monad,
-- and deals with conne... | 348 | true | true | 0 | 10 | 145 | 115 | 62 | 53 | null | null |
lenary/Idris-dev | src/Idris/Core/TT.hs | bsd-3-clause | showEnv' env t dbg = se 10 env t where
se p env (P nt n t) = show n
++ if dbg then "{" ++ show nt ++ " : " ++ se 10 env t ++ "}" else ""
se p env (V i) | i < length env && i >= 0
= (show $ fst $ env!!i) ++
if d... | 2,058 | showEnv' env t dbg = se 10 env t where
se p env (P nt n t) = show n
++ if dbg then "{" ++ show nt ++ " : " ++ se 10 env t ++ "}" else ""
se p env (V i) | i < length env && i >= 0
= (show $ fst $ env!!i) ++
if d... | 2,058 | showEnv' env t dbg = se 10 env t where
se p env (P nt n t) = show n
++ if dbg then "{" ++ show nt ++ " : " ++ se 10 env t ++ "}" else ""
se p env (V i) | i < length env && i >= 0
= (show $ fst $ env!!i) ++
if d... | 2,058 | false | false | 19 | 11 | 837 | 1,219 | 535 | 684 | null | null |
sordina/GLM | src/PropMain.hs | mit | start :: [String] -> IO ()
start ["-h"] = help | 50 | start :: [String] -> IO ()
start ["-h"] = help | 50 | start ["-h"] = help | 23 | false | true | 0 | 7 | 13 | 29 | 15 | 14 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/utils/Pretty.hs | bsd-3-clause | -- Specification: sepNB p k ys = sep1 (text "" <> p) k ys
-- Called when we have already found some text in the first item
-- We have to eat up nests
sepNB :: Bool -> Doc -> FastInt -> [Doc] -> Doc
sepNB g (Nest _ p) k ys = sepNB g p k ys | 241 | sepNB :: Bool -> Doc -> FastInt -> [Doc] -> Doc
sepNB g (Nest _ p) k ys = sepNB g p k ys | 90 | sepNB g (Nest _ p) k ys = sepNB g p k ys | 42 | true | true | 0 | 9 | 60 | 59 | 31 | 28 | null | null |
brendanhay/gogol | gogol-cloudiot/gen/Network/Google/Resource/CloudIOT/Projects/Locations/Registries/Groups/TestIAMPermissions.hs | mpl-2.0 | -- | REQUIRED: The resource for which the policy detail is being requested.
-- See the operation documentation for the appropriate value for this
-- field.
plrgtipResource :: Lens' ProjectsLocationsRegistriesGroupsTestIAMPermissions Text
plrgtipResource
= lens _plrgtipResource
(\ s a -> s{_plrgtipResource = a}) | 320 | plrgtipResource :: Lens' ProjectsLocationsRegistriesGroupsTestIAMPermissions Text
plrgtipResource
= lens _plrgtipResource
(\ s a -> s{_plrgtipResource = a}) | 164 | plrgtipResource
= lens _plrgtipResource
(\ s a -> s{_plrgtipResource = a}) | 82 | true | true | 1 | 9 | 49 | 48 | 24 | 24 | null | null |
rueshyna/gogol | gogol-youtube-analytics/gen/Network/Google/Resource/YouTubeAnalytics/GroupItems/Insert.hs | mpl-2.0 | -- | Creates a value of 'GroupItemsInsert' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'giiPayload'
--
-- * 'giiOnBehalfOfContentOwner'
groupItemsInsert
:: GroupItem -- ^ 'giiPayload'
-> GroupItemsInsert
groupItemsInsert pG... | 436 | groupItemsInsert
:: GroupItem -- ^ 'giiPayload'
-> GroupItemsInsert
groupItemsInsert pGiiPayload_ =
GroupItemsInsert'
{ _giiPayload = pGiiPayload_
, _giiOnBehalfOfContentOwner = Nothing
} | 211 | groupItemsInsert pGiiPayload_ =
GroupItemsInsert'
{ _giiPayload = pGiiPayload_
, _giiOnBehalfOfContentOwner = Nothing
} | 135 | true | true | 0 | 7 | 82 | 49 | 28 | 21 | null | null |
jthornber/language-c-ejt | src/Language/C/Data/Node.hs | bsd-3-clause | fileOfNode :: (CNode a) => a -> Maybe FilePath
fileOfNode = fmap posFile . justIf isSourcePos . posOfNode . nodeInfo where
justIf predicate x | predicate x = Just x
| otherwise = Nothing
-- | equality by name | 238 | fileOfNode :: (CNode a) => a -> Maybe FilePath
fileOfNode = fmap posFile . justIf isSourcePos . posOfNode . nodeInfo where
justIf predicate x | predicate x = Just x
| otherwise = Nothing
-- | equality by name | 238 | fileOfNode = fmap posFile . justIf isSourcePos . posOfNode . nodeInfo where
justIf predicate x | predicate x = Just x
| otherwise = Nothing
-- | equality by name | 191 | false | true | 0 | 8 | 68 | 87 | 38 | 49 | null | null |
srhb/quickcheck | Test/QuickCheck/Exception.hs | bsd-3-clause | discard :: a
discard = error "'discard' not supported, since your Haskell system can't catch exceptions" | 104 | discard :: a
discard = error "'discard' not supported, since your Haskell system can't catch exceptions" | 104 | discard = error "'discard' not supported, since your Haskell system can't catch exceptions" | 91 | false | true | 0 | 5 | 15 | 14 | 7 | 7 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.