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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
research-team/robot-dream | src/Driver/Interpreter_v2.hs | mit | -- Function for calculating an equivalent value of angle if it's greater than or equal to 2pi. Argument is unsigned value.
getAngle :: Double -> Double
getAngle angle
| angle < 2.0*pi = angle
| otherwise = angle `mod'` (2.0*pi) | 236 | getAngle :: Double -> Double
getAngle angle
| angle < 2.0*pi = angle
| otherwise = angle `mod'` (2.0*pi) | 113 | getAngle angle
| angle < 2.0*pi = angle
| otherwise = angle `mod'` (2.0*pi) | 84 | true | true | 1 | 9 | 48 | 54 | 28 | 26 | null | null |
ozgurakgun/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | mapPTermFC f g (PMatchApp fc n) = PMatchApp (f fc) n | 66 | mapPTermFC f g (PMatchApp fc n) = PMatchApp (f fc) n | 66 | mapPTermFC f g (PMatchApp fc n) = PMatchApp (f fc) n | 66 | false | false | 0 | 7 | 24 | 34 | 15 | 19 | null | null |
pankajmore/Imghost | Helpers/Document.hs | bsd-3-clause | staticUpload :: String -> StaticRoute
staticUpload x = StaticRoute (map T.pack ["upload",x]) [("","")] | 103 | staticUpload :: String -> StaticRoute
staticUpload x = StaticRoute (map T.pack ["upload",x]) [("","")] | 102 | staticUpload x = StaticRoute (map T.pack ["upload",x]) [("","")] | 64 | false | true | 0 | 8 | 13 | 48 | 26 | 22 | null | null |
jwvg0425/free-game | FreeGame/Internal/GLFW.hs | bsd-3-clause | blendMode2BlendingFactors Inverse = (GL.OneMinusDstColor, GL.Zero) | 66 | blendMode2BlendingFactors Inverse = (GL.OneMinusDstColor, GL.Zero) | 66 | blendMode2BlendingFactors Inverse = (GL.OneMinusDstColor, GL.Zero) | 66 | false | false | 1 | 6 | 4 | 22 | 10 | 12 | null | null |
bfops/Chess | src/Game/Render/Renderers.hs | mit | renderText :: String -> String -> Loaders -> GL ()
renderText _ _ = undefined | 77 | renderText :: String -> String -> Loaders -> GL ()
renderText _ _ = undefined | 77 | renderText _ _ = undefined | 26 | false | true | 0 | 10 | 14 | 38 | 17 | 21 | null | null |
da-x/Algorithm-W-Step-By-Step | Lamdu/Expr/Lens.hs | gpl-3.0 | compositeTypes _ T.CEmpty = pure T.CEmpty | 41 | compositeTypes _ T.CEmpty = pure T.CEmpty | 41 | compositeTypes _ T.CEmpty = pure T.CEmpty | 41 | false | false | 0 | 6 | 5 | 18 | 8 | 10 | null | null |
forste/haReFork | tools/base/lib/Monads/Tree.hs | bsd-3-clause | mapM f = Tree.sequence . fmap f | 46 | mapM f = Tree.sequence . fmap f | 46 | mapM f = Tree.sequence . fmap f | 46 | false | false | 2 | 5 | 21 | 22 | 8 | 14 | null | null |
profan/mal | haskell/step4_if_fn_do.hs | mpl-2.0 | apply_ast :: MalVal -> Env -> IOThrows MalVal
apply_ast ast@(MalList (MalSymbol "def!" : args) _) env = do
case args of
(a1@(MalSymbol _): a2 : []) -> do
evaled <- eval a2 env
liftIO $ env_set env a1 evaled
_ -> throwStr "invalid def!" | 281 | apply_ast :: MalVal -> Env -> IOThrows MalVal
apply_ast ast@(MalList (MalSymbol "def!" : args) _) env = do
case args of
(a1@(MalSymbol _): a2 : []) -> do
evaled <- eval a2 env
liftIO $ env_set env a1 evaled
_ -> throwStr "invalid def!" | 281 | apply_ast ast@(MalList (MalSymbol "def!" : args) _) env = do
case args of
(a1@(MalSymbol _): a2 : []) -> do
evaled <- eval a2 env
liftIO $ env_set env a1 evaled
_ -> throwStr "invalid def!" | 235 | false | true | 9 | 10 | 89 | 114 | 58 | 56 | null | null |
mbakke/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | hvNicType :: String
hvNicType = "nic_type" | 42 | hvNicType :: String
hvNicType = "nic_type" | 42 | hvNicType = "nic_type" | 22 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
vincenthz/hs-foundation | basement/Basement/Types/OffsetSize.hs | bsd-3-clause | sizeOfCSSize :: CSsize -> CountOf Word8
sizeOfCSSize (CSsize (-1)) = error "invalid size: CSSize is -1" | 108 | sizeOfCSSize :: CSsize -> CountOf Word8
sizeOfCSSize (CSsize (-1)) = error "invalid size: CSSize is -1" | 108 | sizeOfCSSize (CSsize (-1)) = error "invalid size: CSSize is -1" | 68 | false | true | 0 | 9 | 20 | 35 | 17 | 18 | null | null |
edom/ptt | src/Haskell/Interpret.hs | apache-2.0 | binPrimOp t = intAdd t <|> doubleAdd t | 38 | binPrimOp t = intAdd t <|> doubleAdd t | 38 | binPrimOp t = intAdd t <|> doubleAdd t | 38 | false | false | 0 | 6 | 7 | 19 | 8 | 11 | null | null |
NickAger/LearningHaskell | haskellForMacMiscPlayground/UnderstandingReader.hsproj/Example3.hs | mit | example :: String
example = runReader computation "Hello"
where
computation :: Reader String String
computation = do
greeting <- ask
return $ greeting ++ ", Haskell" | 209 | example :: String
example = runReader computation "Hello"
where
computation :: Reader String String
computation = do
greeting <- ask
return $ greeting ++ ", Haskell" | 209 | example = runReader computation "Hello"
where
computation :: Reader String String
computation = do
greeting <- ask
return $ greeting ++ ", Haskell" | 191 | false | true | 0 | 8 | 69 | 59 | 26 | 33 | null | null |
rainbowbismuth/go-analyze | src/Go/Lexer.hs | gpl-3.0 | lexNumberLit :: Char -> Parser Token
lexNumberLit '0' = imaginaryLit
<|> floatLit
<|> hexadecimalLit
<|> octalLit
<|> decimalLit | 278 | lexNumberLit :: Char -> Parser Token
lexNumberLit '0' = imaginaryLit
<|> floatLit
<|> hexadecimalLit
<|> octalLit
<|> decimalLit | 278 | lexNumberLit '0' = imaginaryLit
<|> floatLit
<|> hexadecimalLit
<|> octalLit
<|> decimalLit | 241 | false | true | 0 | 8 | 167 | 41 | 19 | 22 | null | null |
edsko/ChinesePodAPI | src/Servant/ChinesePod/Analysis.hs | bsd-3-clause | resetVocab :: FilePath -> IO ()
resetVocab vocabFile = do
vocab <- loadVocab vocabFile
modifyIORef globalAnalysisState $ \(static, dynamic) ->
(analysisStatic vocab (analysisAllWords static), dynamic) | 214 | resetVocab :: FilePath -> IO ()
resetVocab vocabFile = do
vocab <- loadVocab vocabFile
modifyIORef globalAnalysisState $ \(static, dynamic) ->
(analysisStatic vocab (analysisAllWords static), dynamic) | 214 | resetVocab vocabFile = do
vocab <- loadVocab vocabFile
modifyIORef globalAnalysisState $ \(static, dynamic) ->
(analysisStatic vocab (analysisAllWords static), dynamic) | 182 | false | true | 0 | 13 | 38 | 76 | 36 | 40 | null | null |
ocharles/hackage-server | Distribution/Server/Framework/BackupRestore.hs | bsd-3-clause | initialImportState :: BlobStores -> FilePath -> Bool
-> [(String, AbstractRestoreBackup)]
-> ImportState
initialImportState store blobdir consumeBlobs featureBackups = ImportState {
importStates = Map.fromList featureBackups,
importBlobStore = store,
importBlobDir = blobdir,
importConsumeBlobs = consumeBlobs,
importBlobsWritten = Map.empty
} | 408 | initialImportState :: BlobStores -> FilePath -> Bool
-> [(String, AbstractRestoreBackup)]
-> ImportState
initialImportState store blobdir consumeBlobs featureBackups = ImportState {
importStates = Map.fromList featureBackups,
importBlobStore = store,
importBlobDir = blobdir,
importConsumeBlobs = consumeBlobs,
importBlobsWritten = Map.empty
} | 408 | initialImportState store blobdir consumeBlobs featureBackups = ImportState {
importStates = Map.fromList featureBackups,
importBlobStore = store,
importBlobDir = blobdir,
importConsumeBlobs = consumeBlobs,
importBlobsWritten = Map.empty
} | 265 | false | true | 0 | 10 | 101 | 84 | 48 | 36 | null | null |
apyrgio/ganeti | src/Ganeti/Utils/AsyncWorker.hs | bsd-2-clause | mkAsyncWorker_ :: (MonadBaseControl IO m)
=> m a -> m (AsyncWorker () a)
mkAsyncWorker_ = mkAsyncWorker . const | 126 | mkAsyncWorker_ :: (MonadBaseControl IO m)
=> m a -> m (AsyncWorker () a)
mkAsyncWorker_ = mkAsyncWorker . const | 126 | mkAsyncWorker_ = mkAsyncWorker . const | 38 | false | true | 0 | 10 | 32 | 46 | 23 | 23 | null | null |
clojj/haskell-view | src/LibText.hs | bsd-3-clause | -- TODO map tokens to token-categories (?)
tokenAsString :: GHC.Token -> T.Text
tokenAsString t =
T.pack $ show $ toConstr t | 126 | tokenAsString :: GHC.Token -> T.Text
tokenAsString t =
T.pack $ show $ toConstr t | 83 | tokenAsString t =
T.pack $ show $ toConstr t | 46 | true | true | 0 | 7 | 22 | 36 | 18 | 18 | null | null |
vrom911/Compiler | src/Compiler/Rum/Compiler/Emitter.hs | mit | codeGenTops :: Rum.Program -> LLVM AST.Operand
codeGenTops = foldr ((>>) . codeGenTop) (return iZero) | 101 | codeGenTops :: Rum.Program -> LLVM AST.Operand
codeGenTops = foldr ((>>) . codeGenTop) (return iZero) | 101 | codeGenTops = foldr ((>>) . codeGenTop) (return iZero) | 54 | false | true | 0 | 7 | 13 | 42 | 22 | 20 | null | null |
wangbj/excises | findMissing.hs | bsd-3-clause | nexts st k s
| len < digits = Nothing
| len == digits = case st of
Just x -> if readint s /= 1 + k then Nothing else Just x
Nothing -> if readint s == 2 + k then Just (1+k) else Nothing
| x == 1 + k = nexts st x s'
| x == 2 + k = case st of
Nothing -> nexts (Just (1+k)) (2+k) s'
Just _ -> Nothing
| x /= (1+k) && x /= (2+k) = Nothing
where digits = numDigits (1+k)
len = C.length s
(s1, s') = C.splitAt digits s
x = readint s1 | 487 | nexts st k s
| len < digits = Nothing
| len == digits = case st of
Just x -> if readint s /= 1 + k then Nothing else Just x
Nothing -> if readint s == 2 + k then Just (1+k) else Nothing
| x == 1 + k = nexts st x s'
| x == 2 + k = case st of
Nothing -> nexts (Just (1+k)) (2+k) s'
Just _ -> Nothing
| x /= (1+k) && x /= (2+k) = Nothing
where digits = numDigits (1+k)
len = C.length s
(s1, s') = C.splitAt digits s
x = readint s1 | 487 | nexts st k s
| len < digits = Nothing
| len == digits = case st of
Just x -> if readint s /= 1 + k then Nothing else Just x
Nothing -> if readint s == 2 + k then Just (1+k) else Nothing
| x == 1 + k = nexts st x s'
| x == 2 + k = case st of
Nothing -> nexts (Just (1+k)) (2+k) s'
Just _ -> Nothing
| x /= (1+k) && x /= (2+k) = Nothing
where digits = numDigits (1+k)
len = C.length s
(s1, s') = C.splitAt digits s
x = readint s1 | 487 | false | false | 1 | 13 | 167 | 301 | 144 | 157 | null | null |
christiaanb/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | showCImp :: Bool -> PClause -> String
showCImp impl (PClause _ n l ws r w)
= showImp impl l ++ showWs ws ++ " = " ++ showImp impl r
++ " where " ++ show w
where
showWs [] = ""
showWs (x : xs) = " | " ++ showImp impl x ++ showWs xs | 258 | showCImp :: Bool -> PClause -> String
showCImp impl (PClause _ n l ws r w)
= showImp impl l ++ showWs ws ++ " = " ++ showImp impl r
++ " where " ++ show w
where
showWs [] = ""
showWs (x : xs) = " | " ++ showImp impl x ++ showWs xs | 258 | showCImp impl (PClause _ n l ws r w)
= showImp impl l ++ showWs ws ++ " = " ++ showImp impl r
++ " where " ++ show w
where
showWs [] = ""
showWs (x : xs) = " | " ++ showImp impl x ++ showWs xs | 220 | false | true | 1 | 10 | 85 | 120 | 57 | 63 | null | null |
fmapfmapfmap/amazonka | amazonka-rds/gen/Network/AWS/RDS/DescribeOptionGroupOptions.hs | mpl-2.0 | -- | Creates a value of 'DescribeOptionGroupOptionsResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'dogorsOptionGroupOptions'
--
-- * 'dogorsMarker'
--
-- * 'dogorsResponseStatus'
describeOptionGroupOptionsResponse
:: Int -- ^ 'dogorsResponseStatus'
-> DescribeOptionGroupOptionsResponse
describeOptionGroupOptionsResponse pResponseStatus_ =
DescribeOptionGroupOptionsResponse'
{ _dogorsOptionGroupOptions = Nothing
, _dogorsMarker = Nothing
, _dogorsResponseStatus = pResponseStatus_
} | 609 | describeOptionGroupOptionsResponse
:: Int -- ^ 'dogorsResponseStatus'
-> DescribeOptionGroupOptionsResponse
describeOptionGroupOptionsResponse pResponseStatus_ =
DescribeOptionGroupOptionsResponse'
{ _dogorsOptionGroupOptions = Nothing
, _dogorsMarker = Nothing
, _dogorsResponseStatus = pResponseStatus_
} | 334 | describeOptionGroupOptionsResponse pResponseStatus_ =
DescribeOptionGroupOptionsResponse'
{ _dogorsOptionGroupOptions = Nothing
, _dogorsMarker = Nothing
, _dogorsResponseStatus = pResponseStatus_
} | 218 | true | true | 0 | 7 | 94 | 57 | 34 | 23 | null | null |
phunehehe/deepseq-bounded | tests/Foo.hs | bsd-3-clause | xpBase4 = ([True,__],3,Just __) :: ([Bool],Int,Maybe String)
| 75 | expBase4 = ([True,__],3,Just __) :: ([Bool],Int,Maybe String) | 75 | expBase4 = ([True,__],3,Just __) :: ([Bool],Int,Maybe String) | 75 | false | false | 0 | 6 | 21 | 45 | 26 | 19 | null | null |
ardumont/haskell-lab | src/functional-approach/ch3.hs | gpl-2.0 | -- *Ch3> fib 2
-- 2
-- *Ch3> fib 10
-- 89
-- *Ch3> map fib [1..5]
-- [1,2,3,5,8]
-- Introducing the following equation:
gib :: Int -> (Int, Int)
gib n = (fib (n+1), fib n) | 172 | gib :: Int -> (Int, Int)
gib n = (fib (n+1), fib n) | 51 | gib n = (fib (n+1), fib n) | 26 | true | true | 0 | 9 | 37 | 56 | 31 | 25 | null | null |
andreagenso/java2scala | src/J2s/Integration/ScannerParser.hs | apache-2.0 | pDecimalFloatingPointLiteral = tSym DecimalFloatingPointLiteral "" | 71 | pDecimalFloatingPointLiteral = tSym DecimalFloatingPointLiteral "" | 71 | pDecimalFloatingPointLiteral = tSym DecimalFloatingPointLiteral "" | 71 | false | false | 0 | 5 | 9 | 11 | 5 | 6 | null | null |
bos/filemanip | System/FilePath/Find.hs | bsd-3-clause | foldWithHandler
:: (FilePath -> a -> IOException -> IO a) -- ^ error handler
-> RecursionPredicate -- ^ control recursion into subdirectories
-> (a -> FileInfo -> a) -- ^ function to fold with
-> a -- ^ seed value for fold
-> FilePath -- ^ directory to start searching
-> IO a -- ^ final value after folding
foldWithHandler errHandler recurse f state path =
handle (errHandler path state) $
F.getSymbolicLinkStatus path >>= visit state path 0
where visit state path depth st =
if F.isDirectory st && evalFI recurse path depth st
then traverse state path (succ depth) st
else let state' = f state (mkFI path depth st)
in state' `seq` return state'
traverse state dir depth dirSt = handle (errHandler dir state) $
getDirContents dir >>=
let state' = f state (mkFI dir depth dirSt)
in state' `seq` flip foldM state' (\state name ->
handle (errHandler dir state) $
let path = dir </> name
in F.getSymbolicLinkStatus path >>= visit state path depth)
-- | Search a directory recursively, with recursion controlled by a
-- 'RecursionPredicate'. Fold over all files found. Any errors that
-- occur are ignored, with warnings printed to 'stderr'. The fold
-- function is run from \"left\" to \"right\", so it should be strict
-- in its left argument to avoid space leaks. If you need a
-- right-to-left fold, use 'foldr' on the result of 'findWithHandler'
-- instead. | 1,567 | foldWithHandler
:: (FilePath -> a -> IOException -> IO a) -- ^ error handler
-> RecursionPredicate -- ^ control recursion into subdirectories
-> (a -> FileInfo -> a) -- ^ function to fold with
-> a -- ^ seed value for fold
-> FilePath -- ^ directory to start searching
-> IO a
foldWithHandler errHandler recurse f state path =
handle (errHandler path state) $
F.getSymbolicLinkStatus path >>= visit state path 0
where visit state path depth st =
if F.isDirectory st && evalFI recurse path depth st
then traverse state path (succ depth) st
else let state' = f state (mkFI path depth st)
in state' `seq` return state'
traverse state dir depth dirSt = handle (errHandler dir state) $
getDirContents dir >>=
let state' = f state (mkFI dir depth dirSt)
in state' `seq` flip foldM state' (\state name ->
handle (errHandler dir state) $
let path = dir </> name
in F.getSymbolicLinkStatus path >>= visit state path depth)
-- | Search a directory recursively, with recursion controlled by a
-- 'RecursionPredicate'. Fold over all files found. Any errors that
-- occur are ignored, with warnings printed to 'stderr'. The fold
-- function is run from \"left\" to \"right\", so it should be strict
-- in its left argument to avoid space leaks. If you need a
-- right-to-left fold, use 'foldr' on the result of 'findWithHandler'
-- instead. | 1,535 | foldWithHandler errHandler recurse f state path =
handle (errHandler path state) $
F.getSymbolicLinkStatus path >>= visit state path 0
where visit state path depth st =
if F.isDirectory st && evalFI recurse path depth st
then traverse state path (succ depth) st
else let state' = f state (mkFI path depth st)
in state' `seq` return state'
traverse state dir depth dirSt = handle (errHandler dir state) $
getDirContents dir >>=
let state' = f state (mkFI dir depth dirSt)
in state' `seq` flip foldM state' (\state name ->
handle (errHandler dir state) $
let path = dir </> name
in F.getSymbolicLinkStatus path >>= visit state path depth)
-- | Search a directory recursively, with recursion controlled by a
-- 'RecursionPredicate'. Fold over all files found. Any errors that
-- occur are ignored, with warnings printed to 'stderr'. The fold
-- function is run from \"left\" to \"right\", so it should be strict
-- in its left argument to avoid space leaks. If you need a
-- right-to-left fold, use 'foldr' on the result of 'findWithHandler'
-- instead. | 1,234 | true | true | 1 | 20 | 445 | 340 | 172 | 168 | null | null |
keithodulaigh/Hets | HasCASL/Sublogic.hs | gpl-2.0 | -- | bottom sublogic
bottom :: Sublogic
bottom = Sublogic
{ has_sub = False
, has_part = False
, has_eq = False
, has_pred = False
, type_classes = NoClasses
, has_polymorphism = False
, has_type_constructors = False
, has_products = False
, which_logic = Atomic
} | 304 | bottom :: Sublogic
bottom = Sublogic
{ has_sub = False
, has_part = False
, has_eq = False
, has_pred = False
, type_classes = NoClasses
, has_polymorphism = False
, has_type_constructors = False
, has_products = False
, which_logic = Atomic
} | 283 | bottom = Sublogic
{ has_sub = False
, has_part = False
, has_eq = False
, has_pred = False
, type_classes = NoClasses
, has_polymorphism = False
, has_type_constructors = False
, has_products = False
, which_logic = Atomic
} | 264 | true | true | 0 | 7 | 86 | 72 | 45 | 27 | null | null |
ulrikrasmussen/BoxProver | src/RenderHtml.hs | mit | metaKindSpan :: String -> Html
metaKindSpan = (H.span ! A.class_ "metakind") . fromString | 89 | metaKindSpan :: String -> Html
metaKindSpan = (H.span ! A.class_ "metakind") . fromString | 89 | metaKindSpan = (H.span ! A.class_ "metakind") . fromString | 58 | false | true | 0 | 9 | 12 | 33 | 17 | 16 | null | null |
HIPERFIT/futhark | src/Futhark/IR/Primitive.hs | isc | -- | The size of a value of a given primitive type in eight-bit bytes.
primByteSize :: Num a => PrimType -> a
primByteSize (IntType t) = intByteSize t | 150 | primByteSize :: Num a => PrimType -> a
primByteSize (IntType t) = intByteSize t | 79 | primByteSize (IntType t) = intByteSize t | 40 | true | true | 0 | 10 | 28 | 40 | 18 | 22 | null | null |
haskell-opengl/OpenGLRaw | src/Graphics/GL/Functions/F24.hs | bsd-3-clause | -- glSecondaryColor3uivEXT -----------------------------------------------------
-- | This command is an alias for 'glSecondaryColor3uiv'.
glSecondaryColor3uivEXT
:: MonadIO m
=> Ptr GLuint -- ^ @v@ pointing to @3@ elements of type @ColorUI@.
-> m ()
glSecondaryColor3uivEXT v1 = liftIO $ dyn110 ptr_glSecondaryColor3uivEXT v1 | 333 | glSecondaryColor3uivEXT
:: MonadIO m
=> Ptr GLuint -- ^ @v@ pointing to @3@ elements of type @ColorUI@.
-> m ()
glSecondaryColor3uivEXT v1 = liftIO $ dyn110 ptr_glSecondaryColor3uivEXT v1 | 193 | glSecondaryColor3uivEXT v1 = liftIO $ dyn110 ptr_glSecondaryColor3uivEXT v1 | 75 | true | true | 0 | 9 | 46 | 49 | 23 | 26 | null | null |
bjornbm/astro-orbit | Astro/Orbit/Interpolate.hs | bsd-3-clause | -- Polate assuming x0 = 0 and y0 = 0.
linearPolate00 :: (Div d d DOne, Mul DOne dy dy, Fractional a)
=> (Quantity d a, Quantity dy a)
-> Quantity d a -> Quantity dy a
linearPolate00 (x1,y1) x = x / x1 * y1 | 231 | linearPolate00 :: (Div d d DOne, Mul DOne dy dy, Fractional a)
=> (Quantity d a, Quantity dy a)
-> Quantity d a -> Quantity dy a
linearPolate00 (x1,y1) x = x / x1 * y1 | 193 | linearPolate00 (x1,y1) x = x / x1 * y1 | 38 | true | true | 0 | 10 | 71 | 99 | 49 | 50 | null | null |
DaMSL/K3 | src/Language/K3/Core/Utils.hs | apache-2.0 | foldNamedDeclExpression :: (Monad m) => Identifier -> (a -> K3 Expression -> m (a, K3 Expression))
-> a -> K3 Declaration -> m (a, K3 Declaration)
foldNamedDeclExpression i exprF acc prog = foldProgram namedDeclF mkP mkP Nothing acc prog
where namedDeclF nacc d@(tag -> DGlobal n t eOpt) | i == n = do
(a, neOpt) <- case eOpt of
Nothing -> return (nacc, Nothing)
Just e -> exprF nacc e >>= \(a,ne) -> return (a, Just ne)
return . (a,) $ replaceTag d $ DGlobal n t neOpt
namedDeclF nacc d@(tag -> DTrigger n t e) | i == n = do
(a, ne) <- exprF nacc e
return . (a,) $ replaceTag d $ DTrigger n t ne
namedDeclF nacc d = return (nacc, d)
mkP a b = return (a,b)
-- | Parallel foldMapTree on expressions. | 844 | foldNamedDeclExpression :: (Monad m) => Identifier -> (a -> K3 Expression -> m (a, K3 Expression))
-> a -> K3 Declaration -> m (a, K3 Declaration)
foldNamedDeclExpression i exprF acc prog = foldProgram namedDeclF mkP mkP Nothing acc prog
where namedDeclF nacc d@(tag -> DGlobal n t eOpt) | i == n = do
(a, neOpt) <- case eOpt of
Nothing -> return (nacc, Nothing)
Just e -> exprF nacc e >>= \(a,ne) -> return (a, Just ne)
return . (a,) $ replaceTag d $ DGlobal n t neOpt
namedDeclF nacc d@(tag -> DTrigger n t e) | i == n = do
(a, ne) <- exprF nacc e
return . (a,) $ replaceTag d $ DTrigger n t ne
namedDeclF nacc d = return (nacc, d)
mkP a b = return (a,b)
-- | Parallel foldMapTree on expressions. | 844 | foldNamedDeclExpression i exprF acc prog = foldProgram namedDeclF mkP mkP Nothing acc prog
where namedDeclF nacc d@(tag -> DGlobal n t eOpt) | i == n = do
(a, neOpt) <- case eOpt of
Nothing -> return (nacc, Nothing)
Just e -> exprF nacc e >>= \(a,ne) -> return (a, Just ne)
return . (a,) $ replaceTag d $ DGlobal n t neOpt
namedDeclF nacc d@(tag -> DTrigger n t e) | i == n = do
(a, ne) <- exprF nacc e
return . (a,) $ replaceTag d $ DTrigger n t ne
namedDeclF nacc d = return (nacc, d)
mkP a b = return (a,b)
-- | Parallel foldMapTree on expressions. | 673 | false | true | 2 | 17 | 284 | 363 | 182 | 181 | null | null |
thoughtpolice/binary-serialise-cbor | bench/Real/Load.hs | bsd-3-clause | utf8Warnings :: LineNo -> String -> String -> [PWarning]
utf8Warnings line fieldname s =
take 1 [ UTFWarning n fieldname
| (n,l) <- zip [line..] (lines s)
, '\xfffd' `elem` l ] | 196 | utf8Warnings :: LineNo -> String -> String -> [PWarning]
utf8Warnings line fieldname s =
take 1 [ UTFWarning n fieldname
| (n,l) <- zip [line..] (lines s)
, '\xfffd' `elem` l ] | 196 | utf8Warnings line fieldname s =
take 1 [ UTFWarning n fieldname
| (n,l) <- zip [line..] (lines s)
, '\xfffd' `elem` l ] | 139 | false | true | 0 | 11 | 51 | 84 | 44 | 40 | null | null |
nevrenato/Hets_Fork | CspCASL/testwrap.hs | gpl-2.0 | dash20, dash10 :: String
dash10 = "----------" | 46 | dash20, dash10 :: String
dash10 = "----------" | 46 | dash10 = "----------" | 21 | false | true | 2 | 6 | 6 | 24 | 9 | 15 | null | null |
ooz/Hafer | src/Hafer/Export/ClassDiagram/Dot.hs | mit | addMethods :: [Method] -> String
addMethods l = case l of
a:as -> "|" ++ convertMethods l
[] -> "" | 109 | addMethods :: [Method] -> String
addMethods l = case l of
a:as -> "|" ++ convertMethods l
[] -> "" | 109 | addMethods l = case l of
a:as -> "|" ++ convertMethods l
[] -> "" | 76 | false | true | 0 | 9 | 30 | 56 | 26 | 30 | null | null |
eugenkiss/loopgotowhile | tests/Language/LoopGotoWhile/While/Strict/Tests.hs | bsd-3-clause | testParsing9 :: Assertion
testParsing9 = assertBool "" $ isLeft $ runProgram [] $
"x0 := x1 + 1\n" ++
"x3 := x1 + 1" | 125 | testParsing9 :: Assertion
testParsing9 = assertBool "" $ isLeft $ runProgram [] $
"x0 := x1 + 1\n" ++
"x3 := x1 + 1" | 125 | testParsing9 = assertBool "" $ isLeft $ runProgram [] $
"x0 := x1 + 1\n" ++
"x3 := x1 + 1" | 99 | false | true | 0 | 9 | 32 | 42 | 18 | 24 | null | null |
edsko/cabal | cabal-install/Distribution/Client/IndexUtils.hs | bsd-3-clause | refTypeFromTypeCode :: Tar.TypeCode -> BuildTreeRefType
refTypeFromTypeCode t
| t == Tar.buildTreeRefTypeCode = LinkRef
| t == Tar.buildTreeSnapshotTypeCode = SnapshotRef
| otherwise =
error "Distribution.Client.IndexUtils.refTypeFromTypeCode: unknown type code" | 302 | refTypeFromTypeCode :: Tar.TypeCode -> BuildTreeRefType
refTypeFromTypeCode t
| t == Tar.buildTreeRefTypeCode = LinkRef
| t == Tar.buildTreeSnapshotTypeCode = SnapshotRef
| otherwise =
error "Distribution.Client.IndexUtils.refTypeFromTypeCode: unknown type code" | 302 | refTypeFromTypeCode t
| t == Tar.buildTreeRefTypeCode = LinkRef
| t == Tar.buildTreeSnapshotTypeCode = SnapshotRef
| otherwise =
error "Distribution.Client.IndexUtils.refTypeFromTypeCode: unknown type code" | 246 | false | true | 1 | 9 | 66 | 60 | 28 | 32 | null | null |
rolph-recto/liquidhaskell | src/Language/Haskell/Liquid/Parse.hs | bsd-3-clause | isPrimBareType _ _ = False | 41 | isPrimBareType _ _ = False | 41 | isPrimBareType _ _ = False | 41 | false | false | 0 | 5 | 19 | 11 | 5 | 6 | null | null |
andrewMacmurray/haskell-book-solutions | src/ch24/Logfile.hs | mit | logFileEx :: String
logFileEx = [r|
-- wheee a comment
# 2025-02-05
08:00 Breakfast
09:00 Sanitizing moisture collector
11:00 Exercising in high-grav gym
12:00 Lunch
13:00 Programming
17:00 Commuting home in rover
17:30 R&R
19:00 Dinner
21:00 Shower
21:15 Read
22:00 Sleep
# 2025-02-07 -- dates not nececessarily sequential
08:00 Breakfast -- should I try skippin bfast?
09:00 Bumped head, passed out
13:36 Wake up, headache
13:37 Go to medbay
13:40 Patch self up
13:45 Commute home for rest
14:15 Read
21:00 Dinner
21:15 Read
22:00 Sleep
|] | 543 | logFileEx :: String
logFileEx = [r|
-- wheee a comment
# 2025-02-05
08:00 Breakfast
09:00 Sanitizing moisture collector
11:00 Exercising in high-grav gym
12:00 Lunch
13:00 Programming
17:00 Commuting home in rover
17:30 R&R
19:00 Dinner
21:00 Shower
21:15 Read
22:00 Sleep
# 2025-02-07 -- dates not nececessarily sequential
08:00 Breakfast -- should I try skippin bfast?
09:00 Bumped head, passed out
13:36 Wake up, headache
13:37 Go to medbay
13:40 Patch self up
13:45 Commute home for rest
14:15 Read
21:00 Dinner
21:15 Read
22:00 Sleep
|] | 543 | logFileEx = [r|
-- wheee a comment
# 2025-02-05
08:00 Breakfast
09:00 Sanitizing moisture collector
11:00 Exercising in high-grav gym
12:00 Lunch
13:00 Programming
17:00 Commuting home in rover
17:30 R&R
19:00 Dinner
21:00 Shower
21:15 Read
22:00 Sleep
# 2025-02-07 -- dates not nececessarily sequential
08:00 Breakfast -- should I try skippin bfast?
09:00 Bumped head, passed out
13:36 Wake up, headache
13:37 Go to medbay
13:40 Patch self up
13:45 Commute home for rest
14:15 Read
21:00 Dinner
21:15 Read
22:00 Sleep
|] | 523 | false | true | 0 | 6 | 89 | 22 | 11 | 11 | null | null |
sacundim/free-operational | Control/MonadPlus/Operational.hs | bsd-3-clause | fromProgramP
:: (Operational instr m, Functor m, MonadPlus m) => ProgramP instr a -> m a
fromProgramP = interpretP singleton | 128 | fromProgramP
:: (Operational instr m, Functor m, MonadPlus m) => ProgramP instr a -> m a
fromProgramP = interpretP singleton | 128 | fromProgramP = interpretP singleton | 35 | false | true | 0 | 7 | 23 | 52 | 25 | 27 | null | null |
tjakway/ghcjvm | compiler/hsSyn/HsDecls.hs | bsd-3-clause | isTypeFamilyDecl _ = False | 26 | isTypeFamilyDecl _ = False | 26 | isTypeFamilyDecl _ = False | 26 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
mebaran/hs-salesforce | Network/Salesforce/Util.hs | mit | sfDelete :: (SFContext m, Failure HttpException m) => BSU.ByteString -> m (Request m1)
sfDelete = sfReq "DELETE" | 112 | sfDelete :: (SFContext m, Failure HttpException m) => BSU.ByteString -> m (Request m1)
sfDelete = sfReq "DELETE" | 112 | sfDelete = sfReq "DELETE" | 25 | false | true | 0 | 9 | 16 | 46 | 23 | 23 | null | null |
RomainGehrig/ConsoleChess | src/ConsoleChess/Moves.hs | mit | isEatable :: Coordinate Int -> Color -> Board -> Bool
isEatable coord col board = maybe False (\p -> view color p /= col) piece
where piece = coord `M.lookup` view pieces board | 178 | isEatable :: Coordinate Int -> Color -> Board -> Bool
isEatable coord col board = maybe False (\p -> view color p /= col) piece
where piece = coord `M.lookup` view pieces board | 178 | isEatable coord col board = maybe False (\p -> view color p /= col) piece
where piece = coord `M.lookup` view pieces board | 124 | false | true | 0 | 9 | 34 | 78 | 39 | 39 | null | null |
HIPERFIT/hopencl | examples/VectorAdd/VectorAdd.hs | bsd-3-clause | main :: IO ()
main = do
-- Set up OpenCL context
platform <- head <$> getPlatformIDs
device <- head <$> getDeviceIDs [DeviceTypeAll] platform
context <- createContext [device] [ContextPlatform platform] NoContextCallback
queue <- createCommandQueue context device [QueueOutOfOrderExecModeEnable]
-- Create OpenCL Kernel
prog <- createProgram context =<< readFile "vector_add.cl"
buildProgram prog [device] ""
kernel <- createKernel prog "vectorAdd"
-- Allocate device memory
array0 <- newListArray context list0
array1 <- newListArray context list1
out <- mallocArray context [MemWriteOnly] n :: IO (MemObject Float)
-- The type of the allocated output can not be infered without
-- parsing the C code, so we need to specify it manually
-- Enqueue kernel
setKernelArgs kernel [MObjArg array0, MObjArg array1, MObjArg out]
event <- enqueueNDRangeKernel queue kernel [] [fromIntegral n] [] []
-- Read result
print =<< peekListArray queue n out
free array0
free array1
free out
performGC
threadDelay 2000000 | 1,070 | main :: IO ()
main = do
-- Set up OpenCL context
platform <- head <$> getPlatformIDs
device <- head <$> getDeviceIDs [DeviceTypeAll] platform
context <- createContext [device] [ContextPlatform platform] NoContextCallback
queue <- createCommandQueue context device [QueueOutOfOrderExecModeEnable]
-- Create OpenCL Kernel
prog <- createProgram context =<< readFile "vector_add.cl"
buildProgram prog [device] ""
kernel <- createKernel prog "vectorAdd"
-- Allocate device memory
array0 <- newListArray context list0
array1 <- newListArray context list1
out <- mallocArray context [MemWriteOnly] n :: IO (MemObject Float)
-- The type of the allocated output can not be infered without
-- parsing the C code, so we need to specify it manually
-- Enqueue kernel
setKernelArgs kernel [MObjArg array0, MObjArg array1, MObjArg out]
event <- enqueueNDRangeKernel queue kernel [] [fromIntegral n] [] []
-- Read result
print =<< peekListArray queue n out
free array0
free array1
free out
performGC
threadDelay 2000000 | 1,070 | main = do
-- Set up OpenCL context
platform <- head <$> getPlatformIDs
device <- head <$> getDeviceIDs [DeviceTypeAll] platform
context <- createContext [device] [ContextPlatform platform] NoContextCallback
queue <- createCommandQueue context device [QueueOutOfOrderExecModeEnable]
-- Create OpenCL Kernel
prog <- createProgram context =<< readFile "vector_add.cl"
buildProgram prog [device] ""
kernel <- createKernel prog "vectorAdd"
-- Allocate device memory
array0 <- newListArray context list0
array1 <- newListArray context list1
out <- mallocArray context [MemWriteOnly] n :: IO (MemObject Float)
-- The type of the allocated output can not be infered without
-- parsing the C code, so we need to specify it manually
-- Enqueue kernel
setKernelArgs kernel [MObjArg array0, MObjArg array1, MObjArg out]
event <- enqueueNDRangeKernel queue kernel [] [fromIntegral n] [] []
-- Read result
print =<< peekListArray queue n out
free array0
free array1
free out
performGC
threadDelay 2000000 | 1,056 | false | true | 0 | 11 | 209 | 293 | 133 | 160 | null | null |
ygale/yesod | yesod-core/bench/th.hs | mit | main :: IO ()
main = do
forM_ samples $ \sample ->
unless (dispatch1 True (sample, "GET") == dispatch2a True (sample, "GET"))
(error $ show sample)
defaultMain
[ bench "dispatch1" $ nf (map (dispatch1 True . (, "GET"))) samples
, bench "dispatch2" $ nf (map (dispatch2a True . (, "GET"))) samples
, bench "dispatch1a" $ nf (map (dispatch1 True . (, "GET"))) samples
, bench "dispatch2a" $ nf (map (dispatch2a True . (, "GET"))) samples
] | 505 | main :: IO ()
main = do
forM_ samples $ \sample ->
unless (dispatch1 True (sample, "GET") == dispatch2a True (sample, "GET"))
(error $ show sample)
defaultMain
[ bench "dispatch1" $ nf (map (dispatch1 True . (, "GET"))) samples
, bench "dispatch2" $ nf (map (dispatch2a True . (, "GET"))) samples
, bench "dispatch1a" $ nf (map (dispatch1 True . (, "GET"))) samples
, bench "dispatch2a" $ nf (map (dispatch2a True . (, "GET"))) samples
] | 505 | main = do
forM_ samples $ \sample ->
unless (dispatch1 True (sample, "GET") == dispatch2a True (sample, "GET"))
(error $ show sample)
defaultMain
[ bench "dispatch1" $ nf (map (dispatch1 True . (, "GET"))) samples
, bench "dispatch2" $ nf (map (dispatch2a True . (, "GET"))) samples
, bench "dispatch1a" $ nf (map (dispatch1 True . (, "GET"))) samples
, bench "dispatch2a" $ nf (map (dispatch2a True . (, "GET"))) samples
] | 491 | false | true | 0 | 15 | 143 | 221 | 112 | 109 | null | null |
kmate/HaRe | test/testdata/LiftToToplevel/D2.hs | bsd-3-clause | {-lift 'sq' to top level. In this refactoring, 'sq' will
be hided in the import declaraion of module 'D2' in module 'C2'.-}
sumSquares (x:xs) = sq x + sumSquares xs
where
sq x = x ^ pow
pow =2 | 210 | sumSquares (x:xs) = sq x + sumSquares xs
where
sq x = x ^ pow
pow =2 | 82 | sumSquares (x:xs) = sq x + sumSquares xs
where
sq x = x ^ pow
pow =2 | 82 | true | false | 1 | 7 | 56 | 48 | 23 | 25 | null | null |
nikki-and-the-robots/nikki | src/Physics/Chipmunk/Types.hs | lgpl-3.0 | initChipmunk :: Space -> BodyAttributes -> [ShapeDescription]
-> Vector -> IO Chipmunk
initChipmunk space as@StaticBodyAttributes{position} shapeTypes baryCenterOffset = do
let normalAttrs = static2normalAttributes as
body <- mkBody normalAttrs
let chip = StaticChipmunk space body [] []
(vector2position (position -~ baryCenterOffset)) position
addInitShape chip shapeTypes | 410 | initChipmunk :: Space -> BodyAttributes -> [ShapeDescription]
-> Vector -> IO Chipmunk
initChipmunk space as@StaticBodyAttributes{position} shapeTypes baryCenterOffset = do
let normalAttrs = static2normalAttributes as
body <- mkBody normalAttrs
let chip = StaticChipmunk space body [] []
(vector2position (position -~ baryCenterOffset)) position
addInitShape chip shapeTypes | 410 | initChipmunk space as@StaticBodyAttributes{position} shapeTypes baryCenterOffset = do
let normalAttrs = static2normalAttributes as
body <- mkBody normalAttrs
let chip = StaticChipmunk space body [] []
(vector2position (position -~ baryCenterOffset)) position
addInitShape chip shapeTypes | 319 | false | true | 3 | 15 | 79 | 127 | 58 | 69 | null | null |
Vetii/SCFDMA | src/Bucket.hs | mit | null (Bucket _) = False | 24 | null (Bucket _) = False | 24 | null (Bucket _) = False | 24 | false | false | 0 | 6 | 5 | 16 | 7 | 9 | null | null |
odr/pers | app/Main.hs | bsd-3-clause | main :: IO ()
main = do
forkIO sql
site | 47 | main :: IO ()
main = do
forkIO sql
site | 47 | main = do
forkIO sql
site | 33 | false | true | 0 | 7 | 17 | 25 | 11 | 14 | null | null |
TomMD/ghc | compiler/main/HscTypes.hs | bsd-3-clause | setInteractivePrintName :: InteractiveContext -> Name -> InteractiveContext
setInteractivePrintName ic n = ic{ic_int_print = n} | 127 | setInteractivePrintName :: InteractiveContext -> Name -> InteractiveContext
setInteractivePrintName ic n = ic{ic_int_print = n} | 127 | setInteractivePrintName ic n = ic{ic_int_print = n} | 51 | false | true | 0 | 6 | 13 | 32 | 17 | 15 | null | null |
np/hlatex | Language/LaTeX/Builder/Beamer.hs | bsd-3-clause | {- | The '+' incremental overlay specification (like in @<+->@).
Beamer User Guide at 8.6.4 Incremental Specifications -}
ovPlus :: OverlayInt
ovPlus = OvPlus | 164 | ovPlus :: OverlayInt
ovPlus = OvPlus | 36 | ovPlus = OvPlus | 15 | true | true | 0 | 6 | 29 | 19 | 8 | 11 | null | null |
dzamkov/Oedel | src/Graphics/Oedel/Terminal/Draw.hs | mit | hline appr ch point (Width wid) = Draw [String appr point $ replicate wid ch] | 77 | hline appr ch point (Width wid) = Draw [String appr point $ replicate wid ch] | 77 | hline appr ch point (Width wid) = Draw [String appr point $ replicate wid ch] | 77 | false | false | 0 | 8 | 14 | 45 | 19 | 26 | null | null |
emptylambda/BLT | src/Boogie/TypeChecker.hs | gpl-3.0 | checkStatement :: Statement -> Typing ()
checkStatement (Pos pos s) = do
modify $ setPos pos
case s of
Predicate _ (SpecClause _ _ e) -> checkMatch (text "predicate") BoolType e
Havoc vars -> checkHavocLefts (nub vars) (length (nub vars))
Assign lhss rhss -> checkAssign lhss rhss
Call lhss name args -> checkCall lhss name args
CallForall name args -> checkCallForall name args
If cond thenBlock elseBlock -> checkIf cond thenBlock elseBlock
While cond invs b -> checkWhile cond invs b
Goto ids -> checkGoto ids
Break Nothing -> checkSimpleBreak
Break (Just l) -> checkLabelBreak l
_ -> return () | 645 | checkStatement :: Statement -> Typing ()
checkStatement (Pos pos s) = do
modify $ setPos pos
case s of
Predicate _ (SpecClause _ _ e) -> checkMatch (text "predicate") BoolType e
Havoc vars -> checkHavocLefts (nub vars) (length (nub vars))
Assign lhss rhss -> checkAssign lhss rhss
Call lhss name args -> checkCall lhss name args
CallForall name args -> checkCallForall name args
If cond thenBlock elseBlock -> checkIf cond thenBlock elseBlock
While cond invs b -> checkWhile cond invs b
Goto ids -> checkGoto ids
Break Nothing -> checkSimpleBreak
Break (Just l) -> checkLabelBreak l
_ -> return () | 645 | checkStatement (Pos pos s) = do
modify $ setPos pos
case s of
Predicate _ (SpecClause _ _ e) -> checkMatch (text "predicate") BoolType e
Havoc vars -> checkHavocLefts (nub vars) (length (nub vars))
Assign lhss rhss -> checkAssign lhss rhss
Call lhss name args -> checkCall lhss name args
CallForall name args -> checkCallForall name args
If cond thenBlock elseBlock -> checkIf cond thenBlock elseBlock
While cond invs b -> checkWhile cond invs b
Goto ids -> checkGoto ids
Break Nothing -> checkSimpleBreak
Break (Just l) -> checkLabelBreak l
_ -> return () | 604 | false | true | 0 | 14 | 147 | 256 | 116 | 140 | null | null |
sandrolovnicki/lambda-calculus-interpreter | src/Syntax.hs | mit | uncurryShow (Application e1 e2) = ". " <> show e1 <> " " <> show e2 | 67 | uncurryShow (Application e1 e2) = ". " <> show e1 <> " " <> show e2 | 67 | uncurryShow (Application e1 e2) = ". " <> show e1 <> " " <> show e2 | 67 | false | false | 0 | 8 | 15 | 35 | 16 | 19 | null | null |
andrewthad/yesod-static-commons | src/Yesod/Static/Bootstrap.hs | bsd-3-clause | theme_3_6 :: Route EmbeddedStatic
theme_3_6 = bootstrap_3_3_6_css_bootstrap_theme_css | 85 | theme_3_6 :: Route EmbeddedStatic
theme_3_6 = bootstrap_3_3_6_css_bootstrap_theme_css | 85 | theme_3_6 = bootstrap_3_3_6_css_bootstrap_theme_css | 51 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
monte-language/masque | Masque/Objects/Double.hs | gpl-3.0 | callDouble d "multiply" [obj] _ = do
x <- coerceDouble obj
wrapDouble $ d * x | 85 | callDouble d "multiply" [obj] _ = do
x <- coerceDouble obj
wrapDouble $ d * x | 85 | callDouble d "multiply" [obj] _ = do
x <- coerceDouble obj
wrapDouble $ d * x | 85 | false | false | 0 | 8 | 23 | 43 | 18 | 25 | null | null |
CarloMicieli/fun-with-haskell | src/craft3e/Chapter04.hs | apache-2.0 | allEqual_prop3 :: Integer -> Integer -> Integer -> Property
allEqual_prop3 m n p = (m /= n || n /= p) ==> allEqual m n p == False | 129 | allEqual_prop3 :: Integer -> Integer -> Integer -> Property
allEqual_prop3 m n p = (m /= n || n /= p) ==> allEqual m n p == False | 129 | allEqual_prop3 m n p = (m /= n || n /= p) ==> allEqual m n p == False | 69 | false | true | 0 | 10 | 27 | 66 | 31 | 35 | null | null |
cornell-pl/evolution | Database/Memory.hs | gpl-3.0 | delRecord :: Id -> Table -> Table
delRecord i (Table hs rs) = Table hs $ Map.delete i rs | 88 | delRecord :: Id -> Table -> Table
delRecord i (Table hs rs) = Table hs $ Map.delete i rs | 88 | delRecord i (Table hs rs) = Table hs $ Map.delete i rs | 54 | false | true | 0 | 7 | 18 | 50 | 23 | 27 | null | null |
kmate/imperative-edsl | src/Language/Embedded/CExp.hs | bsd-3-clause | evalBinary :: Binary a -> a
evalBinary BiAdd = (+) | 51 | evalBinary :: Binary a -> a
evalBinary BiAdd = (+) | 51 | evalBinary BiAdd = (+) | 23 | false | true | 0 | 6 | 10 | 23 | 12 | 11 | null | null |
ryantm/ghc | libraries/base/Data/Data.hs | bsd-3-clause | maybeDataType :: DataType
maybeDataType = mkDataType "Prelude.Maybe" [nothingConstr,justConstr] | 95 | maybeDataType :: DataType
maybeDataType = mkDataType "Prelude.Maybe" [nothingConstr,justConstr] | 95 | maybeDataType = mkDataType "Prelude.Maybe" [nothingConstr,justConstr] | 69 | false | true | 0 | 6 | 7 | 28 | 13 | 15 | null | null |
goldfirere/singletons | singletons-base/tests/compile-and-dump/GradingClient/Database.hs | bsd-3-clause | -- Equality for rows based on ids.
eqRow :: Row s -> Row s -> Bool
eqRow r1 r2 = getId r1 == getId r2 | 101 | eqRow :: Row s -> Row s -> Bool
eqRow r1 r2 = getId r1 == getId r2 | 66 | eqRow r1 r2 = getId r1 == getId r2 | 34 | true | true | 0 | 7 | 24 | 41 | 19 | 22 | null | null |
bnordbo/bloodhound | src/Database/Bloodhound/Client.hs | bsd-3-clause | -- | 'mkAggregateSearch' is a helper function that defaults everything in a 'Search' except for
-- the 'Query' and the 'Aggregation'.
--
-- >>> let terms = TermsAgg $ (mkTermsAggregation "user") { termCollectMode = Just BreadthFirst }
-- >>> terms
-- TermsAgg (TermsAggregation {term = Left "user", termInclude = Nothing, termExclude = Nothing, termOrder = Nothing, termMinDocCount = Nothing, termSize = Nothing, termShardSize = Nothing, termCollectMode = Just BreadthFirst, termExecutionHint = Nothing, termAggs = Nothing})
-- >>> let myAggregation = mkAggregateSearch Nothing $ mkAggregations "users" terms
mkAggregateSearch :: Maybe Query -> Aggregations -> Search
mkAggregateSearch query mkSearchAggs = Search query Nothing Nothing (Just mkSearchAggs) Nothing False (From 0) (Size 0) | 789 | mkAggregateSearch :: Maybe Query -> Aggregations -> Search
mkAggregateSearch query mkSearchAggs = Search query Nothing Nothing (Just mkSearchAggs) Nothing False (From 0) (Size 0) | 178 | mkAggregateSearch query mkSearchAggs = Search query Nothing Nothing (Just mkSearchAggs) Nothing False (From 0) (Size 0) | 119 | true | true | 0 | 7 | 111 | 69 | 37 | 32 | null | null |
zaxtax/hakaru | commands/Summary.hs | bsd-3-clause | header :: Bool -> Maybe String -> [Text]
header logfloats mmodule =
[ "{-# LANGUAGE DataKinds, NegativeLiterals #-}"
, TxT.unwords [ "module"
, case mmodule of
Just m -> pack m
Nothing -> "Main"
, "where" ]
, ""
, if logfloats
then TxT.unlines [ "import Data.Number.LogFloat hiding (product)"
, "import Prelude hiding (product, exp, log, (**))"
]
else "import Prelude hiding (product)"
, if logfloats
then "import Language.Hakaru.Runtime.LogFloatPrelude"
else "import Language.Hakaru.Runtime.Prelude"
, "import Language.Hakaru.Types.Sing"
, "import qualified System.Random.MWC as MWC"
, "import Control.Monad"
, ""
] | 865 | header :: Bool -> Maybe String -> [Text]
header logfloats mmodule =
[ "{-# LANGUAGE DataKinds, NegativeLiterals #-}"
, TxT.unwords [ "module"
, case mmodule of
Just m -> pack m
Nothing -> "Main"
, "where" ]
, ""
, if logfloats
then TxT.unlines [ "import Data.Number.LogFloat hiding (product)"
, "import Prelude hiding (product, exp, log, (**))"
]
else "import Prelude hiding (product)"
, if logfloats
then "import Language.Hakaru.Runtime.LogFloatPrelude"
else "import Language.Hakaru.Runtime.Prelude"
, "import Language.Hakaru.Types.Sing"
, "import qualified System.Random.MWC as MWC"
, "import Control.Monad"
, ""
] | 865 | header logfloats mmodule =
[ "{-# LANGUAGE DataKinds, NegativeLiterals #-}"
, TxT.unwords [ "module"
, case mmodule of
Just m -> pack m
Nothing -> "Main"
, "where" ]
, ""
, if logfloats
then TxT.unlines [ "import Data.Number.LogFloat hiding (product)"
, "import Prelude hiding (product, exp, log, (**))"
]
else "import Prelude hiding (product)"
, if logfloats
then "import Language.Hakaru.Runtime.LogFloatPrelude"
else "import Language.Hakaru.Runtime.Prelude"
, "import Language.Hakaru.Types.Sing"
, "import qualified System.Random.MWC as MWC"
, "import Control.Monad"
, ""
] | 824 | false | true | 0 | 11 | 335 | 120 | 67 | 53 | null | null |
Spawek/HCPParse | src/Lib/Util.hs | mit | breakOnGlue glue rest@(x:xs)
| glue `isPrefixOf` rest = ([], rest)
| otherwise = (x:piece, rest')
where (piece, rest') = breakOnGlue glue xs
| 157 | breakOnGlue glue rest@(x:xs)
| glue `isPrefixOf` rest = ([], rest)
| otherwise = (x:piece, rest')
where (piece, rest') = breakOnGlue glue xs
| 157 | breakOnGlue glue rest@(x:xs)
| glue `isPrefixOf` rest = ([], rest)
| otherwise = (x:piece, rest')
where (piece, rest') = breakOnGlue glue xs
| 157 | false | false | 1 | 8 | 38 | 77 | 42 | 35 | null | null |
capn-freako/BayHac_2015 | CaesarCipher.hs | bsd-3-clause | rotate :: Int -> [a] -> [a]
rotate n xs = drop n xs ++ take n xs | 64 | rotate :: Int -> [a] -> [a]
rotate n xs = drop n xs ++ take n xs | 64 | rotate n xs = drop n xs ++ take n xs | 36 | false | true | 2 | 9 | 17 | 53 | 23 | 30 | null | null |
mariefarrell/Hets | Common/XmlDiff.hs | gpl-2.0 | hetsTags :: UnordTags
hetsTags = Map.fromList
$ map (\ (e, as) -> (unqual e, Set.fromList $ map unqual as))
[ ("DGNode", ["name"])
, ("DGLink", ["linkid", "source", "target"])
, ("Axiom", [])
, ("Theorem", []) ] | 221 | hetsTags :: UnordTags
hetsTags = Map.fromList
$ map (\ (e, as) -> (unqual e, Set.fromList $ map unqual as))
[ ("DGNode", ["name"])
, ("DGLink", ["linkid", "source", "target"])
, ("Axiom", [])
, ("Theorem", []) ] | 221 | hetsTags = Map.fromList
$ map (\ (e, as) -> (unqual e, Set.fromList $ map unqual as))
[ ("DGNode", ["name"])
, ("DGLink", ["linkid", "source", "target"])
, ("Axiom", [])
, ("Theorem", []) ] | 199 | false | true | 2 | 9 | 43 | 110 | 64 | 46 | null | null |
4ZP6Capstone2015/ampersand | src/Database/Design/Ampersand/Output/ToPandoc/ChapterConceptualAnalysis.hs | gpl-3.0 | chpConceptualAnalysis :: Int -> FSpec -> (Blocks,[Picture])
chpConceptualAnalysis lev fSpec = (
-- *** Header ***
chptHeader (fsLang fSpec) ConceptualAnalysis
<> -- *** Intro ***
caIntro
<> -- *** For all themes, a section containing the conceptual analysis for that theme ***
caBlocks, pictures)
where
-- shorthand for easy localizing
l :: LocalizedStr -> String
l lstr = localize (fsLang fSpec) lstr
caIntro :: Blocks
caIntro
= (case fsLang fSpec of
Dutch -> para
( "Dit hoofdstuk beschrijft een formele taal, waarin functionele eisen ten behoeve van "
<> (singleQuoted.str.name) fSpec
<> " kunnen worden besproken en uitgedrukt. "
<> "De formalisering dient om een bouwbare specificatie te verkrijgen. "
<> "Een derde met voldoende deskundigheid kan op basis van dit hoofdstuk toetsen of de gemaakte afspraken "
<> "overeenkomen met de formele regels en definities. "
)
English -> para
( "This chapter defines the formal language, in which functional requirements of "
<> (singleQuoted.str.name) fSpec
<> " can be analysed and expressed."
<> "The purpose of this formalisation is to obtain a buildable specification. "
<> "This chapter allows an independent professional with sufficient background to check whether the agreements made "
<> "correspond to the formal rules and definitions. "
)
)<> purposes2Blocks (getOpts fSpec) (purposesDefinedIn fSpec (fsLang fSpec) fSpec) -- This explains the purpose of this context.
caBlocks = mconcat (map caSection (vpatterns fSpec))
pictures = concatMap patPicts (vpatterns fSpec)
-----------------------------------------------------
-- the Picture that represents this pattern's conceptual graph
patPicts :: Pattern -> [Picture]
patPicts pat = pictOfPat pat :
(map pictOfRule (invariants fSpec `isc` udefrules pat))
pictOfPat :: Pattern -> Picture
pictOfPat = makePicture fSpec . PTRelsUsedInPat
pictOfRule :: Rule -> Picture
pictOfRule = makePicture fSpec . PTSingleRule
caSection :: Pattern -> Blocks
caSection pat
= -- new section to explain this pattern
headerWithLabel (XRefConceptualAnalysisPattern pat) (lev+2) ((text.name) pat)
-- The section starts with the reason why this pattern exists
<> (purposes2Blocks (getOpts fSpec) (purposesDefinedIn fSpec (fsLang fSpec) pat))
-- followed by a conceptual model for this pattern
<> ( case (fsLang fSpec) of
(Dutch ) -> -- announce the conceptual diagram
para ("Figuur " <> xRefReference (getOpts fSpec) (pictOfPat pat) <> " geeft een conceptueel diagram van dit pattern.")
-- draw the conceptual diagram
<>((plain . showImage (getOpts fSpec) . pictOfPat) pat)
(English) -> para ("Figure " <> xRefReference (getOpts fSpec) (pictOfPat pat) <> " shows a conceptual diagram of this pattern.")
<>((plain . showImage (getOpts fSpec) . pictOfPat) pat)
) <>
(
-- now provide the text of this pattern.
(case fsLang fSpec of
Dutch -> para "De definities van concepten zijn te vinden in de index."
<> header (lev+3) "Gedeclareerde relaties"
<> para "Deze paragraaf geeft een opsomming van de gedeclareerde relaties met eigenschappen en betekenis."
English -> para "The definitions of concepts can be found in the glossary."
<> header (lev+3) "Declared relations"
<> para "This section itemizes the declared relations with properties and purpose."
)
<> definitionList (map caRelation [d | d@Sgn{}<-relsDefdIn pat `uni` relsMentionedIn pat])
<> case map caRule (invariants fSpec `isc` udefrules pat) of
[] -> mempty
blocks -> (case fsLang fSpec of
Dutch -> header (lev+3) "Regels"
<> plain "Deze paragraaf geeft een opsomming van de regels met een verwijzing naar de gemeenschappelijke taal van de belanghebbenden ten behoeve van de traceerbaarheid."
English -> header (lev+3) "Rules"
<> plain "This section itemizes the rules with a reference to the shared language of stakeholders for the sake of traceability."
)
<> definitionList blocks
)
caRelation :: Declaration -> (Inlines, [Blocks])
caRelation d
= let purp = (purposes2Blocks (getOpts fSpec) [p | p<-purposesDefinedIn fSpec (fsLang fSpec) d])
in (mempty
,[ -- First the reason why the relation exists, if any, with its properties as fundamental parts of its being..
( case ( isNull purp, fsLang fSpec) of
(True , Dutch) -> plain ("De volgende " <> str(nladjs d) <> " is gedefinieerd ")
(True , English) -> plain ("The following " <> str(ukadjs d) <> " has been defined ")
(False, Dutch) -> purp <> plain ("Voor dat doel is de volgende " <> str(nladjs d) <> " gedefinieerd ")
(False, English) -> purp <> plain ("For this purpose, the following " <> str(ukadjs d) <> " has been defined ")
)
-- Then the declaration of the relation with its properties and its intended meaning
<> pandocEqnArrayWithLabel (XRefConceptualAnalysisDeclaration d)
[ [ texOnly_Id(name d)
, ":"
, texOnly_Id(name (source d))++(if isFunction d then texOnly_fun else texOnly_rel)++texOnly_Id(name(target d))
]
]
<> case meaning2Blocks (fsLang fSpec) d of
[] -> case fsLang fSpec of
Dutch -> case commaNL "en" [ show (amLang markup) | markup<-ameaMrk (decMean d), amLang markup/=fsLang fSpec] of
[] -> plain "(Geen betekenis gespecificeerd)"
langs -> plain (str ("(Geen betekenis gespecificeerd, maar wel in het "++langs++")"))
English -> case commaEng "and" [ show (amLang markup) | markup<-ameaMrk (decMean d), amLang markup/=fsLang fSpec] of
[] -> plain "(No meaning has been specified)"
langs -> plain (str ("(No meaning has been specified, except in "++langs++")"))
ms -> fromList ms
])
ukadjs d = case [Uni,Tot]>-properties d of
[] -> commaEng "and" (map ukadj (properties d>-[Uni,Tot]))++" function"
_ -> commaEng "and" (map ukadj (properties d))++" relation"
where
ukadj Uni = "univalent"
ukadj Inj = "injective"
ukadj Sur = "surjective"
ukadj Tot = "total"
ukadj Sym = "symmetric"
ukadj Asy = "antisymmetric"
ukadj Trn = "transitive"
ukadj Rfx = "reflexive"
ukadj Irf = "irreflexive"
ukadj Aut = "automatically computed"
ukadj Prop = "symmetric and antisymmetric"
nladjs d = case [Uni,Tot]>-properties d of
[] -> commaNL "en" (map nladj (properties d>-[Uni,Tot]))++" functie"
_ -> commaNL "en" (map nladj (properties d))++" relatie"
where
nladj Uni = "univalente"
nladj Inj = "injectieve"
nladj Sur = "surjectieve"
nladj Tot = "totale"
nladj Sym = "symmetrische"
nladj Asy = "antisymmetrische"
nladj Trn = "transitieve"
nladj Rfx = "reflexieve"
nladj Irf = "irreflexieve"
nladj Aut = "automatisch berekende"
nladj Prop = "symmetrische en antisymmetrische"
caRule :: Rule -> (Inlines, [Blocks])
caRule r
= let purp = (purposes2Blocks (getOpts fSpec) (purposesDefinedIn fSpec (fsLang fSpec) r))
in ( mempty
, [ -- First the reason why the rule exists, if any..
purp
-- Then the rule as a requirement
<> plain
( if isNull purp
then (xRefTo . XRefNaturalLanguageRule) r
<> str (l (NL " is gemaakt :" ,EN " has been made:"))
else str (l (NL "Daarom bestaat ", EN "Therefore "))
<> (xRefTo . XRefNaturalLanguageRule) r
<> str (l (NL ":", EN " exists:"))
)
<> fromList (meaning2Blocks (fsLang fSpec) r)
-- then the formal rule
<> plain
( str (l (NL "Dit is - gebruikmakend van relaties "
,EN "Using relations " ))
<>(mconcat (intersperse (str ", ")
[ xRefTo (XRefConceptualAnalysisDeclaration d)
<> text (" ("++name d++")")
| d@Sgn{}<-relsMentionedIn r]))
<> str (l (NL " - geformaliseerd als "
,EN ", this is formalized as "))
)
<> (if showPredExpr (getOpts fSpec)
then pandocEqnArrayWithLabel (XRefConceptualAnalysisRule r) ((showLatex.toPredLogic) r)
else pandocEquationWithLabel (XRefConceptualAnalysisRule r) (showMath r)
)
-- followed by a conceptual model for this rule
<> para
( str (l (NL "Figuur ", EN "Figure "))
<> xRefReference (getOpts fSpec) (pictOfRule r)
<> str (l (NL " geeft een conceptueel diagram van deze regel."
,EN " shows a conceptual diagram of this rule."))
)
<>plain (showImage (getOpts fSpec) (pictOfRule r))
]
) | 10,176 | chpConceptualAnalysis :: Int -> FSpec -> (Blocks,[Picture])
chpConceptualAnalysis lev fSpec = (
-- *** Header ***
chptHeader (fsLang fSpec) ConceptualAnalysis
<> -- *** Intro ***
caIntro
<> -- *** For all themes, a section containing the conceptual analysis for that theme ***
caBlocks, pictures)
where
-- shorthand for easy localizing
l :: LocalizedStr -> String
l lstr = localize (fsLang fSpec) lstr
caIntro :: Blocks
caIntro
= (case fsLang fSpec of
Dutch -> para
( "Dit hoofdstuk beschrijft een formele taal, waarin functionele eisen ten behoeve van "
<> (singleQuoted.str.name) fSpec
<> " kunnen worden besproken en uitgedrukt. "
<> "De formalisering dient om een bouwbare specificatie te verkrijgen. "
<> "Een derde met voldoende deskundigheid kan op basis van dit hoofdstuk toetsen of de gemaakte afspraken "
<> "overeenkomen met de formele regels en definities. "
)
English -> para
( "This chapter defines the formal language, in which functional requirements of "
<> (singleQuoted.str.name) fSpec
<> " can be analysed and expressed."
<> "The purpose of this formalisation is to obtain a buildable specification. "
<> "This chapter allows an independent professional with sufficient background to check whether the agreements made "
<> "correspond to the formal rules and definitions. "
)
)<> purposes2Blocks (getOpts fSpec) (purposesDefinedIn fSpec (fsLang fSpec) fSpec) -- This explains the purpose of this context.
caBlocks = mconcat (map caSection (vpatterns fSpec))
pictures = concatMap patPicts (vpatterns fSpec)
-----------------------------------------------------
-- the Picture that represents this pattern's conceptual graph
patPicts :: Pattern -> [Picture]
patPicts pat = pictOfPat pat :
(map pictOfRule (invariants fSpec `isc` udefrules pat))
pictOfPat :: Pattern -> Picture
pictOfPat = makePicture fSpec . PTRelsUsedInPat
pictOfRule :: Rule -> Picture
pictOfRule = makePicture fSpec . PTSingleRule
caSection :: Pattern -> Blocks
caSection pat
= -- new section to explain this pattern
headerWithLabel (XRefConceptualAnalysisPattern pat) (lev+2) ((text.name) pat)
-- The section starts with the reason why this pattern exists
<> (purposes2Blocks (getOpts fSpec) (purposesDefinedIn fSpec (fsLang fSpec) pat))
-- followed by a conceptual model for this pattern
<> ( case (fsLang fSpec) of
(Dutch ) -> -- announce the conceptual diagram
para ("Figuur " <> xRefReference (getOpts fSpec) (pictOfPat pat) <> " geeft een conceptueel diagram van dit pattern.")
-- draw the conceptual diagram
<>((plain . showImage (getOpts fSpec) . pictOfPat) pat)
(English) -> para ("Figure " <> xRefReference (getOpts fSpec) (pictOfPat pat) <> " shows a conceptual diagram of this pattern.")
<>((plain . showImage (getOpts fSpec) . pictOfPat) pat)
) <>
(
-- now provide the text of this pattern.
(case fsLang fSpec of
Dutch -> para "De definities van concepten zijn te vinden in de index."
<> header (lev+3) "Gedeclareerde relaties"
<> para "Deze paragraaf geeft een opsomming van de gedeclareerde relaties met eigenschappen en betekenis."
English -> para "The definitions of concepts can be found in the glossary."
<> header (lev+3) "Declared relations"
<> para "This section itemizes the declared relations with properties and purpose."
)
<> definitionList (map caRelation [d | d@Sgn{}<-relsDefdIn pat `uni` relsMentionedIn pat])
<> case map caRule (invariants fSpec `isc` udefrules pat) of
[] -> mempty
blocks -> (case fsLang fSpec of
Dutch -> header (lev+3) "Regels"
<> plain "Deze paragraaf geeft een opsomming van de regels met een verwijzing naar de gemeenschappelijke taal van de belanghebbenden ten behoeve van de traceerbaarheid."
English -> header (lev+3) "Rules"
<> plain "This section itemizes the rules with a reference to the shared language of stakeholders for the sake of traceability."
)
<> definitionList blocks
)
caRelation :: Declaration -> (Inlines, [Blocks])
caRelation d
= let purp = (purposes2Blocks (getOpts fSpec) [p | p<-purposesDefinedIn fSpec (fsLang fSpec) d])
in (mempty
,[ -- First the reason why the relation exists, if any, with its properties as fundamental parts of its being..
( case ( isNull purp, fsLang fSpec) of
(True , Dutch) -> plain ("De volgende " <> str(nladjs d) <> " is gedefinieerd ")
(True , English) -> plain ("The following " <> str(ukadjs d) <> " has been defined ")
(False, Dutch) -> purp <> plain ("Voor dat doel is de volgende " <> str(nladjs d) <> " gedefinieerd ")
(False, English) -> purp <> plain ("For this purpose, the following " <> str(ukadjs d) <> " has been defined ")
)
-- Then the declaration of the relation with its properties and its intended meaning
<> pandocEqnArrayWithLabel (XRefConceptualAnalysisDeclaration d)
[ [ texOnly_Id(name d)
, ":"
, texOnly_Id(name (source d))++(if isFunction d then texOnly_fun else texOnly_rel)++texOnly_Id(name(target d))
]
]
<> case meaning2Blocks (fsLang fSpec) d of
[] -> case fsLang fSpec of
Dutch -> case commaNL "en" [ show (amLang markup) | markup<-ameaMrk (decMean d), amLang markup/=fsLang fSpec] of
[] -> plain "(Geen betekenis gespecificeerd)"
langs -> plain (str ("(Geen betekenis gespecificeerd, maar wel in het "++langs++")"))
English -> case commaEng "and" [ show (amLang markup) | markup<-ameaMrk (decMean d), amLang markup/=fsLang fSpec] of
[] -> plain "(No meaning has been specified)"
langs -> plain (str ("(No meaning has been specified, except in "++langs++")"))
ms -> fromList ms
])
ukadjs d = case [Uni,Tot]>-properties d of
[] -> commaEng "and" (map ukadj (properties d>-[Uni,Tot]))++" function"
_ -> commaEng "and" (map ukadj (properties d))++" relation"
where
ukadj Uni = "univalent"
ukadj Inj = "injective"
ukadj Sur = "surjective"
ukadj Tot = "total"
ukadj Sym = "symmetric"
ukadj Asy = "antisymmetric"
ukadj Trn = "transitive"
ukadj Rfx = "reflexive"
ukadj Irf = "irreflexive"
ukadj Aut = "automatically computed"
ukadj Prop = "symmetric and antisymmetric"
nladjs d = case [Uni,Tot]>-properties d of
[] -> commaNL "en" (map nladj (properties d>-[Uni,Tot]))++" functie"
_ -> commaNL "en" (map nladj (properties d))++" relatie"
where
nladj Uni = "univalente"
nladj Inj = "injectieve"
nladj Sur = "surjectieve"
nladj Tot = "totale"
nladj Sym = "symmetrische"
nladj Asy = "antisymmetrische"
nladj Trn = "transitieve"
nladj Rfx = "reflexieve"
nladj Irf = "irreflexieve"
nladj Aut = "automatisch berekende"
nladj Prop = "symmetrische en antisymmetrische"
caRule :: Rule -> (Inlines, [Blocks])
caRule r
= let purp = (purposes2Blocks (getOpts fSpec) (purposesDefinedIn fSpec (fsLang fSpec) r))
in ( mempty
, [ -- First the reason why the rule exists, if any..
purp
-- Then the rule as a requirement
<> plain
( if isNull purp
then (xRefTo . XRefNaturalLanguageRule) r
<> str (l (NL " is gemaakt :" ,EN " has been made:"))
else str (l (NL "Daarom bestaat ", EN "Therefore "))
<> (xRefTo . XRefNaturalLanguageRule) r
<> str (l (NL ":", EN " exists:"))
)
<> fromList (meaning2Blocks (fsLang fSpec) r)
-- then the formal rule
<> plain
( str (l (NL "Dit is - gebruikmakend van relaties "
,EN "Using relations " ))
<>(mconcat (intersperse (str ", ")
[ xRefTo (XRefConceptualAnalysisDeclaration d)
<> text (" ("++name d++")")
| d@Sgn{}<-relsMentionedIn r]))
<> str (l (NL " - geformaliseerd als "
,EN ", this is formalized as "))
)
<> (if showPredExpr (getOpts fSpec)
then pandocEqnArrayWithLabel (XRefConceptualAnalysisRule r) ((showLatex.toPredLogic) r)
else pandocEquationWithLabel (XRefConceptualAnalysisRule r) (showMath r)
)
-- followed by a conceptual model for this rule
<> para
( str (l (NL "Figuur ", EN "Figure "))
<> xRefReference (getOpts fSpec) (pictOfRule r)
<> str (l (NL " geeft een conceptueel diagram van deze regel."
,EN " shows a conceptual diagram of this rule."))
)
<>plain (showImage (getOpts fSpec) (pictOfRule r))
]
) | 10,176 | chpConceptualAnalysis lev fSpec = (
-- *** Header ***
chptHeader (fsLang fSpec) ConceptualAnalysis
<> -- *** Intro ***
caIntro
<> -- *** For all themes, a section containing the conceptual analysis for that theme ***
caBlocks, pictures)
where
-- shorthand for easy localizing
l :: LocalizedStr -> String
l lstr = localize (fsLang fSpec) lstr
caIntro :: Blocks
caIntro
= (case fsLang fSpec of
Dutch -> para
( "Dit hoofdstuk beschrijft een formele taal, waarin functionele eisen ten behoeve van "
<> (singleQuoted.str.name) fSpec
<> " kunnen worden besproken en uitgedrukt. "
<> "De formalisering dient om een bouwbare specificatie te verkrijgen. "
<> "Een derde met voldoende deskundigheid kan op basis van dit hoofdstuk toetsen of de gemaakte afspraken "
<> "overeenkomen met de formele regels en definities. "
)
English -> para
( "This chapter defines the formal language, in which functional requirements of "
<> (singleQuoted.str.name) fSpec
<> " can be analysed and expressed."
<> "The purpose of this formalisation is to obtain a buildable specification. "
<> "This chapter allows an independent professional with sufficient background to check whether the agreements made "
<> "correspond to the formal rules and definitions. "
)
)<> purposes2Blocks (getOpts fSpec) (purposesDefinedIn fSpec (fsLang fSpec) fSpec) -- This explains the purpose of this context.
caBlocks = mconcat (map caSection (vpatterns fSpec))
pictures = concatMap patPicts (vpatterns fSpec)
-----------------------------------------------------
-- the Picture that represents this pattern's conceptual graph
patPicts :: Pattern -> [Picture]
patPicts pat = pictOfPat pat :
(map pictOfRule (invariants fSpec `isc` udefrules pat))
pictOfPat :: Pattern -> Picture
pictOfPat = makePicture fSpec . PTRelsUsedInPat
pictOfRule :: Rule -> Picture
pictOfRule = makePicture fSpec . PTSingleRule
caSection :: Pattern -> Blocks
caSection pat
= -- new section to explain this pattern
headerWithLabel (XRefConceptualAnalysisPattern pat) (lev+2) ((text.name) pat)
-- The section starts with the reason why this pattern exists
<> (purposes2Blocks (getOpts fSpec) (purposesDefinedIn fSpec (fsLang fSpec) pat))
-- followed by a conceptual model for this pattern
<> ( case (fsLang fSpec) of
(Dutch ) -> -- announce the conceptual diagram
para ("Figuur " <> xRefReference (getOpts fSpec) (pictOfPat pat) <> " geeft een conceptueel diagram van dit pattern.")
-- draw the conceptual diagram
<>((plain . showImage (getOpts fSpec) . pictOfPat) pat)
(English) -> para ("Figure " <> xRefReference (getOpts fSpec) (pictOfPat pat) <> " shows a conceptual diagram of this pattern.")
<>((plain . showImage (getOpts fSpec) . pictOfPat) pat)
) <>
(
-- now provide the text of this pattern.
(case fsLang fSpec of
Dutch -> para "De definities van concepten zijn te vinden in de index."
<> header (lev+3) "Gedeclareerde relaties"
<> para "Deze paragraaf geeft een opsomming van de gedeclareerde relaties met eigenschappen en betekenis."
English -> para "The definitions of concepts can be found in the glossary."
<> header (lev+3) "Declared relations"
<> para "This section itemizes the declared relations with properties and purpose."
)
<> definitionList (map caRelation [d | d@Sgn{}<-relsDefdIn pat `uni` relsMentionedIn pat])
<> case map caRule (invariants fSpec `isc` udefrules pat) of
[] -> mempty
blocks -> (case fsLang fSpec of
Dutch -> header (lev+3) "Regels"
<> plain "Deze paragraaf geeft een opsomming van de regels met een verwijzing naar de gemeenschappelijke taal van de belanghebbenden ten behoeve van de traceerbaarheid."
English -> header (lev+3) "Rules"
<> plain "This section itemizes the rules with a reference to the shared language of stakeholders for the sake of traceability."
)
<> definitionList blocks
)
caRelation :: Declaration -> (Inlines, [Blocks])
caRelation d
= let purp = (purposes2Blocks (getOpts fSpec) [p | p<-purposesDefinedIn fSpec (fsLang fSpec) d])
in (mempty
,[ -- First the reason why the relation exists, if any, with its properties as fundamental parts of its being..
( case ( isNull purp, fsLang fSpec) of
(True , Dutch) -> plain ("De volgende " <> str(nladjs d) <> " is gedefinieerd ")
(True , English) -> plain ("The following " <> str(ukadjs d) <> " has been defined ")
(False, Dutch) -> purp <> plain ("Voor dat doel is de volgende " <> str(nladjs d) <> " gedefinieerd ")
(False, English) -> purp <> plain ("For this purpose, the following " <> str(ukadjs d) <> " has been defined ")
)
-- Then the declaration of the relation with its properties and its intended meaning
<> pandocEqnArrayWithLabel (XRefConceptualAnalysisDeclaration d)
[ [ texOnly_Id(name d)
, ":"
, texOnly_Id(name (source d))++(if isFunction d then texOnly_fun else texOnly_rel)++texOnly_Id(name(target d))
]
]
<> case meaning2Blocks (fsLang fSpec) d of
[] -> case fsLang fSpec of
Dutch -> case commaNL "en" [ show (amLang markup) | markup<-ameaMrk (decMean d), amLang markup/=fsLang fSpec] of
[] -> plain "(Geen betekenis gespecificeerd)"
langs -> plain (str ("(Geen betekenis gespecificeerd, maar wel in het "++langs++")"))
English -> case commaEng "and" [ show (amLang markup) | markup<-ameaMrk (decMean d), amLang markup/=fsLang fSpec] of
[] -> plain "(No meaning has been specified)"
langs -> plain (str ("(No meaning has been specified, except in "++langs++")"))
ms -> fromList ms
])
ukadjs d = case [Uni,Tot]>-properties d of
[] -> commaEng "and" (map ukadj (properties d>-[Uni,Tot]))++" function"
_ -> commaEng "and" (map ukadj (properties d))++" relation"
where
ukadj Uni = "univalent"
ukadj Inj = "injective"
ukadj Sur = "surjective"
ukadj Tot = "total"
ukadj Sym = "symmetric"
ukadj Asy = "antisymmetric"
ukadj Trn = "transitive"
ukadj Rfx = "reflexive"
ukadj Irf = "irreflexive"
ukadj Aut = "automatically computed"
ukadj Prop = "symmetric and antisymmetric"
nladjs d = case [Uni,Tot]>-properties d of
[] -> commaNL "en" (map nladj (properties d>-[Uni,Tot]))++" functie"
_ -> commaNL "en" (map nladj (properties d))++" relatie"
where
nladj Uni = "univalente"
nladj Inj = "injectieve"
nladj Sur = "surjectieve"
nladj Tot = "totale"
nladj Sym = "symmetrische"
nladj Asy = "antisymmetrische"
nladj Trn = "transitieve"
nladj Rfx = "reflexieve"
nladj Irf = "irreflexieve"
nladj Aut = "automatisch berekende"
nladj Prop = "symmetrische en antisymmetrische"
caRule :: Rule -> (Inlines, [Blocks])
caRule r
= let purp = (purposes2Blocks (getOpts fSpec) (purposesDefinedIn fSpec (fsLang fSpec) r))
in ( mempty
, [ -- First the reason why the rule exists, if any..
purp
-- Then the rule as a requirement
<> plain
( if isNull purp
then (xRefTo . XRefNaturalLanguageRule) r
<> str (l (NL " is gemaakt :" ,EN " has been made:"))
else str (l (NL "Daarom bestaat ", EN "Therefore "))
<> (xRefTo . XRefNaturalLanguageRule) r
<> str (l (NL ":", EN " exists:"))
)
<> fromList (meaning2Blocks (fsLang fSpec) r)
-- then the formal rule
<> plain
( str (l (NL "Dit is - gebruikmakend van relaties "
,EN "Using relations " ))
<>(mconcat (intersperse (str ", ")
[ xRefTo (XRefConceptualAnalysisDeclaration d)
<> text (" ("++name d++")")
| d@Sgn{}<-relsMentionedIn r]))
<> str (l (NL " - geformaliseerd als "
,EN ", this is formalized as "))
)
<> (if showPredExpr (getOpts fSpec)
then pandocEqnArrayWithLabel (XRefConceptualAnalysisRule r) ((showLatex.toPredLogic) r)
else pandocEquationWithLabel (XRefConceptualAnalysisRule r) (showMath r)
)
-- followed by a conceptual model for this rule
<> para
( str (l (NL "Figuur ", EN "Figure "))
<> xRefReference (getOpts fSpec) (pictOfRule r)
<> str (l (NL " geeft een conceptueel diagram van deze regel."
,EN " shows a conceptual diagram of this rule."))
)
<>plain (showImage (getOpts fSpec) (pictOfRule r))
]
) | 10,116 | false | true | 34 | 28 | 3,622 | 2,429 | 1,170 | 1,259 | null | null |
ml9951/ghc | compiler/main/HscTypes.hs | bsd-3-clause | -- | Retrieve the compiled byte-code if possible. Panic if it is a file-based linkable
byteCodeOfObject :: Unlinked -> CompiledByteCode
byteCodeOfObject (BCOs bc _) = bc | 169 | byteCodeOfObject :: Unlinked -> CompiledByteCode
byteCodeOfObject (BCOs bc _) = bc | 82 | byteCodeOfObject (BCOs bc _) = bc | 33 | true | true | 0 | 6 | 25 | 31 | 15 | 16 | null | null |
tjakway/ghcjvm | compiler/prelude/PrelNames.hs | bsd-3-clause | pushCallStackKey = mkPreludeMiscIdUnique 518 | 45 | pushCallStackKey = mkPreludeMiscIdUnique 518 | 45 | pushCallStackKey = mkPreludeMiscIdUnique 518 | 45 | false | false | 0 | 5 | 4 | 9 | 4 | 5 | null | null |
Chobbes/DocsDuck | DocsDuck.hs | mit | vecToSubs :: V.Vector (V.Vector ByteString) -> [Submission]
vecToSubs vs = map vecToSub (V.toList vs) | 101 | vecToSubs :: V.Vector (V.Vector ByteString) -> [Submission]
vecToSubs vs = map vecToSub (V.toList vs) | 101 | vecToSubs vs = map vecToSub (V.toList vs) | 41 | false | true | 0 | 9 | 13 | 47 | 23 | 24 | null | null |
Cahu/krpc-hs | src/KRPCHS/SpaceCenter.hs | gpl-3.0 | {-
- The thrust limiter of the engine. A value between 0 and 1. Setting this
- attribute may have no effect, for example the thrust limit for a solid
- rocket booster cannot be changed in flight.
-}
getEngineThrustLimit :: KRPCHS.SpaceCenter.Engine -> RPCContext (Float)
getEngineThrustLimit thisArg = do
let r = makeRequest "SpaceCenter" "Engine_get_ThrustLimit" [makeArgument 0 thisArg]
res <- sendRequest r
processResponse res | 445 | getEngineThrustLimit :: KRPCHS.SpaceCenter.Engine -> RPCContext (Float)
getEngineThrustLimit thisArg = do
let r = makeRequest "SpaceCenter" "Engine_get_ThrustLimit" [makeArgument 0 thisArg]
res <- sendRequest r
processResponse res | 242 | getEngineThrustLimit thisArg = do
let r = makeRequest "SpaceCenter" "Engine_get_ThrustLimit" [makeArgument 0 thisArg]
res <- sendRequest r
processResponse res | 170 | true | true | 0 | 13 | 79 | 73 | 33 | 40 | null | null |
zeyuanxy/haskell-playground | write-yourself-a-scheme/chap8/main.hs | mit | eval env (List [Atom "define", Atom var, form]) =
eval env form >>= defineVar env var | 88 | eval env (List [Atom "define", Atom var, form]) =
eval env form >>= defineVar env var | 88 | eval env (List [Atom "define", Atom var, form]) =
eval env form >>= defineVar env var | 88 | false | false | 0 | 9 | 18 | 46 | 22 | 24 | null | null |
ozgurakgun/Idris-dev | src/Idris/Core/CaseTree.hs | bsd-3-clause | substAlt n repl (FnCase fn ns sc) = FnCase fn ns (substSC n repl sc) | 71 | substAlt n repl (FnCase fn ns sc) = FnCase fn ns (substSC n repl sc) | 71 | substAlt n repl (FnCase fn ns sc) = FnCase fn ns (substSC n repl sc) | 71 | false | false | 0 | 7 | 17 | 40 | 19 | 21 | null | null |
michalkonecny/aern2 | aern2-mfun/src/AERN2/BoxFunMinMax/Expressions/Parsers/Lisp/Parser.hs | bsd-3-clause | buildDefinitionExpression :: Expression -> Expression
buildDefinitionExpression (Pair _ (Pair variable (Pair value Null))) =
Definition variable (analyzeExpression value) | 172 | buildDefinitionExpression :: Expression -> Expression
buildDefinitionExpression (Pair _ (Pair variable (Pair value Null))) =
Definition variable (analyzeExpression value) | 172 | buildDefinitionExpression (Pair _ (Pair variable (Pair value Null))) =
Definition variable (analyzeExpression value) | 118 | false | true | 0 | 11 | 19 | 53 | 26 | 27 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/HTMLSelectElement.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement.multiple Mozilla HTMLSelectElement.multiple documentation>
setMultiple :: (MonadDOM m) => HTMLSelectElement -> Bool -> m ()
setMultiple self val
= liftDOM (self ^. jss "multiple" (toJSVal val)) | 269 | setMultiple :: (MonadDOM m) => HTMLSelectElement -> Bool -> m ()
setMultiple self val
= liftDOM (self ^. jss "multiple" (toJSVal val)) | 136 | setMultiple self val
= liftDOM (self ^. jss "multiple" (toJSVal val)) | 71 | true | true | 0 | 10 | 30 | 65 | 31 | 34 | null | null |
JPMoresmau/leksah | src/IDE/Core/State.hs | gpl-2.0 | postAsyncIDE' :: MonadIDE m => Int32 -> IDEM () -> m ()
postAsyncIDE' priority f = reifyIDE $ \ideR ->
void . idleAdd priority $ reflectIDE f ideR >> return False | 166 | postAsyncIDE' :: MonadIDE m => Int32 -> IDEM () -> m ()
postAsyncIDE' priority f = reifyIDE $ \ideR ->
void . idleAdd priority $ reflectIDE f ideR >> return False | 166 | postAsyncIDE' priority f = reifyIDE $ \ideR ->
void . idleAdd priority $ reflectIDE f ideR >> return False | 110 | false | true | 1 | 9 | 34 | 78 | 35 | 43 | null | null |
bhamrick/hsmath | Math/Polynomial/Modular.hs | bsd-3-clause | -- TODO: Consider non-error ways to die
-- Will throw an error if it ever encounters a number it can't invert.
-- This means (in many cases) that a nontrivial factor of n was found,
-- which would be useful to expose at a higher level.
modularPolyGcd :: P Integer -> P Integer -> Integer -> P Integer
modularPolyGcd f 0 _ = f | 325 | modularPolyGcd :: P Integer -> P Integer -> Integer -> P Integer
modularPolyGcd f 0 _ = f | 89 | modularPolyGcd f 0 _ = f | 24 | true | true | 0 | 9 | 63 | 48 | 23 | 25 | null | null |
evancz/builder | src/Reporting/Task.hs | bsd-3-clause | mapError :: (x -> y) -> Task_ x a -> Task_ y a
mapError =
withExceptT | 71 | mapError :: (x -> y) -> Task_ x a -> Task_ y a
mapError =
withExceptT | 71 | mapError =
withExceptT | 24 | false | true | 0 | 8 | 17 | 42 | 19 | 23 | null | null |
PasswordManager/passman-core | src/Passman/Core/Config/Lens.hs | gpl-3.0 | -- | Path to the passlist file
passlistPath :: Functor f => (FilePath -> f FilePath)
-> C.Config -> f C.Config
passlistPath f (C.Config a b) = C.Config a <$> f b | 187 | passlistPath :: Functor f => (FilePath -> f FilePath)
-> C.Config -> f C.Config
passlistPath f (C.Config a b) = C.Config a <$> f b | 156 | passlistPath f (C.Config a b) = C.Config a <$> f b | 50 | true | true | 0 | 9 | 57 | 71 | 34 | 37 | null | null |
diku-dk/futhark | src/Futhark/Optimise/TileLoops.hs | isc | tileable ::
Stm GPU ->
Maybe
( SubExp,
[VName],
(Commutativity, Lambda GPU, [SubExp], Lambda GPU)
)
tileable stm
| Op (OtherOp (Screma w arrs form)) <- stmExp stm,
Just (reds, map_lam) <- isRedomapSOAC form,
Reduce red_comm red_lam red_nes <- singleReduce reds,
lambdaReturnType map_lam == lambdaReturnType red_lam, -- No mapout arrays.
not $ null arrs,
all primType $ lambdaReturnType map_lam,
all (primType . paramType) $ lambdaParams map_lam =
Just (w, arrs, (red_comm, red_lam, red_nes, map_lam))
| otherwise =
Nothing | 582 | tileable ::
Stm GPU ->
Maybe
( SubExp,
[VName],
(Commutativity, Lambda GPU, [SubExp], Lambda GPU)
)
tileable stm
| Op (OtherOp (Screma w arrs form)) <- stmExp stm,
Just (reds, map_lam) <- isRedomapSOAC form,
Reduce red_comm red_lam red_nes <- singleReduce reds,
lambdaReturnType map_lam == lambdaReturnType red_lam, -- No mapout arrays.
not $ null arrs,
all primType $ lambdaReturnType map_lam,
all (primType . paramType) $ lambdaParams map_lam =
Just (w, arrs, (red_comm, red_lam, red_nes, map_lam))
| otherwise =
Nothing | 582 | tileable stm
| Op (OtherOp (Screma w arrs form)) <- stmExp stm,
Just (reds, map_lam) <- isRedomapSOAC form,
Reduce red_comm red_lam red_nes <- singleReduce reds,
lambdaReturnType map_lam == lambdaReturnType red_lam, -- No mapout arrays.
not $ null arrs,
all primType $ lambdaReturnType map_lam,
all (primType . paramType) $ lambdaParams map_lam =
Just (w, arrs, (red_comm, red_lam, red_nes, map_lam))
| otherwise =
Nothing | 458 | false | true | 1 | 13 | 137 | 221 | 110 | 111 | null | null |
emilaxelsson/compass | examples/NanoFeldspar.hs | bsd-3-clause | min :: (Ord a, SimpleType a) => Data a -> Data a -> Data a
min = smartSugar Min | 79 | min :: (Ord a, SimpleType a) => Data a -> Data a -> Data a
min = smartSugar Min | 79 | min = smartSugar Min | 20 | false | true | 0 | 9 | 18 | 51 | 23 | 28 | null | null |
chreekat/yesod | yesod-core/test/YesodCoreTest/InternalRequest.hs | bsd-2-clause | respectSessionLang :: Bool
respectSessionLang = reqLangs r == ["en"] where
r = parseWaiRequest' defaultRequest [("_LANG", "en")] Nothing g | 140 | respectSessionLang :: Bool
respectSessionLang = reqLangs r == ["en"] where
r = parseWaiRequest' defaultRequest [("_LANG", "en")] Nothing g | 140 | respectSessionLang = reqLangs r == ["en"] where
r = parseWaiRequest' defaultRequest [("_LANG", "en")] Nothing g | 113 | false | true | 0 | 9 | 19 | 52 | 26 | 26 | null | null |
sgillespie/ghc | compiler/prelude/TysWiredIn.hs | bsd-3-clause | pcSpecialDataCon :: Name -> [Type] -> TyCon -> RuntimeRepInfo -> DataCon
pcSpecialDataCon dc_name arg_tys tycon rri
= pcDataConWithFixity' False dc_name (incrUnique (nameUnique dc_name)) rri
[] [] arg_tys tycon | 237 | pcSpecialDataCon :: Name -> [Type] -> TyCon -> RuntimeRepInfo -> DataCon
pcSpecialDataCon dc_name arg_tys tycon rri
= pcDataConWithFixity' False dc_name (incrUnique (nameUnique dc_name)) rri
[] [] arg_tys tycon | 237 | pcSpecialDataCon dc_name arg_tys tycon rri
= pcDataConWithFixity' False dc_name (incrUnique (nameUnique dc_name)) rri
[] [] arg_tys tycon | 164 | false | true | 0 | 9 | 54 | 72 | 36 | 36 | null | null |
brendanhay/gogol | gogol-books/gen/Network/Google/Resource/Books/MyLibrary/Annotations/Insert.hs | mpl-2.0 | -- | String to identify the originator of this request.
mlaiSource :: Lens' MyLibraryAnnotationsInsert (Maybe Text)
mlaiSource
= lens _mlaiSource (\ s a -> s{_mlaiSource = a}) | 177 | mlaiSource :: Lens' MyLibraryAnnotationsInsert (Maybe Text)
mlaiSource
= lens _mlaiSource (\ s a -> s{_mlaiSource = a}) | 121 | mlaiSource
= lens _mlaiSource (\ s a -> s{_mlaiSource = a}) | 61 | true | true | 0 | 9 | 28 | 48 | 25 | 23 | null | null |
lucasdicioccio/stampede | Stampede/Helpers.hs | apache-2.0 | heartBeat :: Frame -> Maybe Text
heartBeat = readHeader id "heart-beat" | 71 | heartBeat :: Frame -> Maybe Text
heartBeat = readHeader id "heart-beat" | 71 | heartBeat = readHeader id "heart-beat" | 38 | false | true | 0 | 6 | 10 | 23 | 11 | 12 | null | null |
rfw/castor | src/Castor/Interpreter.hs | mit | dump (Application f x) = "(" <> dump f <> " " <> dump x <> ")" | 62 | dump (Application f x) = "(" <> dump f <> " " <> dump x <> ")" | 62 | dump (Application f x) = "(" <> dump f <> " " <> dump x <> ")" | 62 | false | false | 0 | 9 | 16 | 39 | 18 | 21 | null | null |
eb-gh-cr/XMonadContrib1 | XMonad/Actions/MyCycleWindowFocus.hs | bsd-3-clause | rotFocusedDown :: X ()
rotFocusedDown = windows . W.modify' $ rotFocused' rotDown | 81 | rotFocusedDown :: X ()
rotFocusedDown = windows . W.modify' $ rotFocused' rotDown | 81 | rotFocusedDown = windows . W.modify' $ rotFocused' rotDown | 58 | false | true | 0 | 7 | 11 | 29 | 14 | 15 | null | null |
trenta3/zeno-0.2.0.1 | Example.hs | mit | prop_add_assoc (x :: Nat) y z
= prove (x + (y + z) :=: (x + y) + z) | 69 | prop_add_assoc (x :: Nat) y z
= prove (x + (y + z) :=: (x + y) + z) | 69 | prop_add_assoc (x :: Nat) y z
= prove (x + (y + z) :=: (x + y) + z) | 69 | false | false | 0 | 11 | 20 | 52 | 27 | 25 | null | null |
kim/amazonka | amazonka-redshift/gen/Network/AWS/Redshift/Types.hs | mpl-2.0 | -- | The name of the cluster subnet group.
csg1ClusterSubnetGroupName :: Lens' ClusterSubnetGroup (Maybe Text)
csg1ClusterSubnetGroupName =
lens _csg1ClusterSubnetGroupName
(\s a -> s { _csg1ClusterSubnetGroupName = a }) | 232 | csg1ClusterSubnetGroupName :: Lens' ClusterSubnetGroup (Maybe Text)
csg1ClusterSubnetGroupName =
lens _csg1ClusterSubnetGroupName
(\s a -> s { _csg1ClusterSubnetGroupName = a }) | 189 | csg1ClusterSubnetGroupName =
lens _csg1ClusterSubnetGroupName
(\s a -> s { _csg1ClusterSubnetGroupName = a }) | 121 | true | true | 0 | 9 | 39 | 46 | 25 | 21 | null | null |
brendanhay/gogol | gogol-jobs/gen/Network/Google/Resource/Jobs/Projects/Complete.hs | mpl-2.0 | -- | Legacy upload protocol for media (e.g. \"media\", \"multipart\").
pcUploadType :: Lens' ProjectsComplete (Maybe Text)
pcUploadType
= lens _pcUploadType (\ s a -> s{_pcUploadType = a}) | 190 | pcUploadType :: Lens' ProjectsComplete (Maybe Text)
pcUploadType
= lens _pcUploadType (\ s a -> s{_pcUploadType = a}) | 119 | pcUploadType
= lens _pcUploadType (\ s a -> s{_pcUploadType = a}) | 67 | true | true | 0 | 9 | 28 | 48 | 25 | 23 | null | null |
merijn/trifecta | src/Text/Trifecta/Util/Array.hs | bsd-3-clause | fromList :: Int -> [a] -> Array a
fromList n xs0 = run $ do
mary <- new_ n
go xs0 mary 0
where
go [] !mary !_ = return mary
go (x:xs) mary i = do write mary i x
go xs mary (i+1) | 219 | fromList :: Int -> [a] -> Array a
fromList n xs0 = run $ do
mary <- new_ n
go xs0 mary 0
where
go [] !mary !_ = return mary
go (x:xs) mary i = do write mary i x
go xs mary (i+1) | 219 | fromList n xs0 = run $ do
mary <- new_ n
go xs0 mary 0
where
go [] !mary !_ = return mary
go (x:xs) mary i = do write mary i x
go xs mary (i+1) | 185 | false | true | 3 | 10 | 86 | 137 | 58 | 79 | null | null |
Bodigrim/katas | src/haskell/7-Complementary-DNA.hs | bsd-2-clause | dnaStrand :: DNA -> DNA
dnaStrand = map f where
f A = T
f T = A
f G = C
f C = G | 87 | dnaStrand :: DNA -> DNA
dnaStrand = map f where
f A = T
f T = A
f G = C
f C = G | 87 | dnaStrand = map f where
f A = T
f T = A
f G = C
f C = G | 63 | false | true | 0 | 7 | 33 | 52 | 26 | 26 | null | null |
d12frosted/optparse-applicative-kb | Options/Applicative/Internal.hs | bsd-3-clause | hoistMaybe :: MonadPlus m => Maybe a -> m a
hoistMaybe = maybe mzero return | 75 | hoistMaybe :: MonadPlus m => Maybe a -> m a
hoistMaybe = maybe mzero return | 75 | hoistMaybe = maybe mzero return | 31 | false | true | 0 | 7 | 14 | 33 | 15 | 18 | null | null |
josuf107/Fizzckle | src/Fizz/Core.hs | gpl-3.0 | getTimestamp :: Timestamped a -> Day
getTimestamp = fst | 55 | getTimestamp :: Timestamped a -> Day
getTimestamp = fst | 55 | getTimestamp = fst | 18 | false | true | 0 | 6 | 8 | 18 | 9 | 9 | null | null |
fmapfmapfmap/amazonka | amazonka-support/gen/Network/AWS/Support/DescribeCases.hs | mpl-2.0 | -- | The response status code.
drsResponseStatus :: Lens' DescribeCasesResponse Int
drsResponseStatus = lens _drsResponseStatus (\ s a -> s{_drsResponseStatus = a}) | 164 | drsResponseStatus :: Lens' DescribeCasesResponse Int
drsResponseStatus = lens _drsResponseStatus (\ s a -> s{_drsResponseStatus = a}) | 133 | drsResponseStatus = lens _drsResponseStatus (\ s a -> s{_drsResponseStatus = a}) | 80 | true | true | 1 | 9 | 21 | 43 | 22 | 21 | null | null |
DigitalLogistics/haskell-jwt | src/Web/JWT.hs | mit | decodeAndVerifySignature :: Secret -> T.Text -> Maybe (JWT VerifiedJWT)
decodeAndVerifySignature secret' input = do
(h,c,s) <- extractElems $ T.splitOn "." input
header' <- parseJWT h
claims' <- parseJWT c
algo <- fmap alg header'
let sign = if Just s == calculateMessageDigest h c algo then pure $ Signature s else mzero
Verified <$> header' <*> claims' <*> sign
where
calculateMessageDigest header' claims' (Just algo') = Just $ calculateDigest algo' secret' (dotted [header', claims'])
calculateMessageDigest _ _ Nothing = Nothing
extractElems (h:c:s:_) = Just (h,c,s)
extractElems _ = Nothing
-- | Try to extract the value for the issue claim field 'iss' from the web token in JSON form | 776 | decodeAndVerifySignature :: Secret -> T.Text -> Maybe (JWT VerifiedJWT)
decodeAndVerifySignature secret' input = do
(h,c,s) <- extractElems $ T.splitOn "." input
header' <- parseJWT h
claims' <- parseJWT c
algo <- fmap alg header'
let sign = if Just s == calculateMessageDigest h c algo then pure $ Signature s else mzero
Verified <$> header' <*> claims' <*> sign
where
calculateMessageDigest header' claims' (Just algo') = Just $ calculateDigest algo' secret' (dotted [header', claims'])
calculateMessageDigest _ _ Nothing = Nothing
extractElems (h:c:s:_) = Just (h,c,s)
extractElems _ = Nothing
-- | Try to extract the value for the issue claim field 'iss' from the web token in JSON form | 776 | decodeAndVerifySignature secret' input = do
(h,c,s) <- extractElems $ T.splitOn "." input
header' <- parseJWT h
claims' <- parseJWT c
algo <- fmap alg header'
let sign = if Just s == calculateMessageDigest h c algo then pure $ Signature s else mzero
Verified <$> header' <*> claims' <*> sign
where
calculateMessageDigest header' claims' (Just algo') = Just $ calculateDigest algo' secret' (dotted [header', claims'])
calculateMessageDigest _ _ Nothing = Nothing
extractElems (h:c:s:_) = Just (h,c,s)
extractElems _ = Nothing
-- | Try to extract the value for the issue claim field 'iss' from the web token in JSON form | 704 | false | true | 1 | 12 | 194 | 255 | 121 | 134 | null | null |
shlevy/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | mkRoleAnnotEnv :: [LRoleAnnotDecl GhcRn] -> RoleAnnotEnv
mkRoleAnnotEnv role_annot_decls
= mkNameEnv [ (name, ra_decl)
| ra_decl <- role_annot_decls
, let name = roleAnnotDeclName (unLoc ra_decl)
, not (isUnboundName name) ] | 264 | mkRoleAnnotEnv :: [LRoleAnnotDecl GhcRn] -> RoleAnnotEnv
mkRoleAnnotEnv role_annot_decls
= mkNameEnv [ (name, ra_decl)
| ra_decl <- role_annot_decls
, let name = roleAnnotDeclName (unLoc ra_decl)
, not (isUnboundName name) ] | 264 | mkRoleAnnotEnv role_annot_decls
= mkNameEnv [ (name, ra_decl)
| ra_decl <- role_annot_decls
, let name = roleAnnotDeclName (unLoc ra_decl)
, not (isUnboundName name) ] | 207 | false | true | 0 | 13 | 68 | 82 | 39 | 43 | null | null |
frms-/aws | Aws/S3/Core.hs | bsd-3-clause | s3EndpointEu :: B.ByteString
s3EndpointEu = "s3-eu-west-1.amazonaws.com" | 72 | s3EndpointEu :: B.ByteString
s3EndpointEu = "s3-eu-west-1.amazonaws.com" | 72 | s3EndpointEu = "s3-eu-west-1.amazonaws.com" | 43 | false | true | 0 | 7 | 5 | 20 | 8 | 12 | null | null |
ihc/futhark | src/Futhark/Tools.hs | isc | partitionChunkedKernelFoldParameters _ _ =
error "partitionChunkedKernelFoldParameters: lambda takes too few parameters" | 122 | partitionChunkedKernelFoldParameters _ _ =
error "partitionChunkedKernelFoldParameters: lambda takes too few parameters" | 122 | partitionChunkedKernelFoldParameters _ _ =
error "partitionChunkedKernelFoldParameters: lambda takes too few parameters" | 122 | false | false | 0 | 5 | 12 | 14 | 6 | 8 | null | null |
shlevy/arithmoi | Math/NumberTheory/GCD/LowLevel.hs | mit | -- | Greatest common divisor of two 'Int#'s, calculated with the binary gcd algorithm.
gcdInt# :: Int# -> Int# -> Int#
gcdInt# a# b# = word2Int# (gcdWord# (int2Word# (absInt# a#)) (int2Word# (absInt# b#))) | 205 | gcdInt# :: Int# -> Int# -> Int#
gcdInt# a# b# = word2Int# (gcdWord# (int2Word# (absInt# a#)) (int2Word# (absInt# b#))) | 118 | gcdInt# a# b# = word2Int# (gcdWord# (int2Word# (absInt# a#)) (int2Word# (absInt# b#))) | 86 | true | true | 0 | 11 | 32 | 60 | 30 | 30 | null | null |
AntonXue/SSTG | src/SSTG/Core/Execution/Support.hs | bsd-3-clause | -- | Increment `Status` steps.
incStatusSteps :: Status -> Status
incStatusSteps status = status { status_steps = (status_steps status) + 1 } | 141 | incStatusSteps :: Status -> Status
incStatusSteps status = status { status_steps = (status_steps status) + 1 } | 110 | incStatusSteps status = status { status_steps = (status_steps status) + 1 } | 75 | true | true | 0 | 9 | 21 | 37 | 20 | 17 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.