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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
AaronFriel/eff-experiments | src/Eff/Internal/Eff1.hs | bsd-3-clause | ter2 = ((Left "exc" :: Either String (Int,Int)) ==) $
run $ runError (runState tes1 (1::Int)) | 100 | ter2 = ((Left "exc" :: Either String (Int,Int)) ==) $
run $ runError (runState tes1 (1::Int)) | 100 | ter2 = ((Left "exc" :: Either String (Int,Int)) ==) $
run $ runError (runState tes1 (1::Int)) | 100 | false | false | 0 | 10 | 22 | 55 | 30 | 25 | null | null |
merijn/GPU-benchmarks | benchmark-analysis/src/Query/Field.hs | gpl-3.0 | getDistinctAlgorithmVersionQuery
:: Key Algorithm -> Maybe Text -> Query CommitId
getDistinctAlgorithmVersionQuery algoId prefix = Query
{ queryName = "distinctAlgorithmVersionQuery"
, commonTableExpressions = []
, params =
[ toPersistValue algoId
, toPersistValue prefix
, toPersistValue prefix
]
, queryText = [i|
SELECT DISTINCT algorithmVersion
FROM RunConfig
WHERE algorithmId = ? AND (algorithmVersion LIKE (? || '%') OR ? IS NULL)
|]
, convert = Simple converter
, ..
}
where
converter
:: (MonadIO n, MonadLogger n, MonadThrow n)
=> [PersistValue] -> n CommitId
converter [v] | Right val <- Sqlite.fromPersistValue v = return val
converter actualValues = logThrowM $ QueryResultUnparseable actualValues
[Sqlite.sqlType (Proxy :: Proxy CommitId)] | 840 | getDistinctAlgorithmVersionQuery
:: Key Algorithm -> Maybe Text -> Query CommitId
getDistinctAlgorithmVersionQuery algoId prefix = Query
{ queryName = "distinctAlgorithmVersionQuery"
, commonTableExpressions = []
, params =
[ toPersistValue algoId
, toPersistValue prefix
, toPersistValue prefix
]
, queryText = [i|
SELECT DISTINCT algorithmVersion
FROM RunConfig
WHERE algorithmId = ? AND (algorithmVersion LIKE (? || '%') OR ? IS NULL)
|]
, convert = Simple converter
, ..
}
where
converter
:: (MonadIO n, MonadLogger n, MonadThrow n)
=> [PersistValue] -> n CommitId
converter [v] | Right val <- Sqlite.fromPersistValue v = return val
converter actualValues = logThrowM $ QueryResultUnparseable actualValues
[Sqlite.sqlType (Proxy :: Proxy CommitId)] | 840 | getDistinctAlgorithmVersionQuery algoId prefix = Query
{ queryName = "distinctAlgorithmVersionQuery"
, commonTableExpressions = []
, params =
[ toPersistValue algoId
, toPersistValue prefix
, toPersistValue prefix
]
, queryText = [i|
SELECT DISTINCT algorithmVersion
FROM RunConfig
WHERE algorithmId = ? AND (algorithmVersion LIKE (? || '%') OR ? IS NULL)
|]
, convert = Simple converter
, ..
}
where
converter
:: (MonadIO n, MonadLogger n, MonadThrow n)
=> [PersistValue] -> n CommitId
converter [v] | Right val <- Sqlite.fromPersistValue v = return val
converter actualValues = logThrowM $ QueryResultUnparseable actualValues
[Sqlite.sqlType (Proxy :: Proxy CommitId)] | 754 | false | true | 4 | 11 | 192 | 203 | 105 | 98 | null | null |
AlexanderPankiv/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | staticPtrTyConKey :: Unique
staticPtrTyConKey = mkPreludeTyConUnique 180 | 74 | staticPtrTyConKey :: Unique
staticPtrTyConKey = mkPreludeTyConUnique 180 | 74 | staticPtrTyConKey = mkPreludeTyConUnique 180 | 45 | false | true | 0 | 5 | 8 | 14 | 7 | 7 | null | null |
olsner/ghc | testsuite/tests/polykinds/T12444.hs | bsd-3-clause | foo :: SNat (Succ c) -> SNat b -> SNat (Succ (c :+: b))
foo _ x = x | 67 | foo :: SNat (Succ c) -> SNat b -> SNat (Succ (c :+: b))
foo _ x = x | 67 | foo _ x = x | 11 | false | true | 0 | 11 | 18 | 52 | 25 | 27 | null | null |
brendanhay/gogol | gogol-logging/gen/Network/Google/Resource/Logging/Entries/Copy.hs | mpl-2.0 | -- | Multipart request metadata.
ecPayload :: Lens' EntriesCopy CopyLogEntriesRequest
ecPayload
= lens _ecPayload (\ s a -> s{_ecPayload = a}) | 144 | ecPayload :: Lens' EntriesCopy CopyLogEntriesRequest
ecPayload
= lens _ecPayload (\ s a -> s{_ecPayload = a}) | 111 | ecPayload
= lens _ecPayload (\ s a -> s{_ecPayload = a}) | 58 | true | true | 0 | 9 | 22 | 42 | 22 | 20 | null | null |
ian-mi/haskell-riak-client | Network/Riak/Message.hs | apache-2.0 | decoder PutRequestCode = Decoder decodePutRequest | 49 | decoder PutRequestCode = Decoder decodePutRequest | 49 | decoder PutRequestCode = Decoder decodePutRequest | 49 | false | false | 0 | 5 | 4 | 13 | 5 | 8 | null | null |
seizans/yesod-tutorial | Handler/Home.hs | bsd-2-clause | getHelloArgsR :: Text -> Int -> Handler RepHtml
getHelloArgsR s i = do
let helloWidget = $(widgetFile "hello")
let widget = $(widgetFile "hello-args")
defaultLayout widget
-- This is a handler function for the GET request method on the HomeR
-- resource pattern. All of your resource patterns are defined in
-- config/routes
--
-- The majority of the code you will write in Yesod lives in these handler
-- functions. You can spread them across multiple files if you are so
-- inclined, or create a single monolithic file. | 534 | getHelloArgsR :: Text -> Int -> Handler RepHtml
getHelloArgsR s i = do
let helloWidget = $(widgetFile "hello")
let widget = $(widgetFile "hello-args")
defaultLayout widget
-- This is a handler function for the GET request method on the HomeR
-- resource pattern. All of your resource patterns are defined in
-- config/routes
--
-- The majority of the code you will write in Yesod lives in these handler
-- functions. You can spread them across multiple files if you are so
-- inclined, or create a single monolithic file. | 534 | getHelloArgsR s i = do
let helloWidget = $(widgetFile "hello")
let widget = $(widgetFile "hello-args")
defaultLayout widget
-- This is a handler function for the GET request method on the HomeR
-- resource pattern. All of your resource patterns are defined in
-- config/routes
--
-- The majority of the code you will write in Yesod lives in these handler
-- functions. You can spread them across multiple files if you are so
-- inclined, or create a single monolithic file. | 486 | false | true | 0 | 12 | 101 | 72 | 36 | 36 | null | null |
robdockins/edison | edison-core/src/Data/Edison/Coll/StandardSet.hs | mit | difference = DS.difference | 34 | difference = DS.difference | 34 | difference = DS.difference | 34 | false | false | 0 | 5 | 10 | 8 | 4 | 4 | null | null |
np/ling | Ling/Compile/C.hs | bsd-3-clause | transLVal :: C.LVal -> C.Exp
transLVal (C.LVar x) = C.EVar x | 62 | transLVal :: C.LVal -> C.Exp
transLVal (C.LVar x) = C.EVar x | 62 | transLVal (C.LVar x) = C.EVar x | 33 | false | true | 0 | 8 | 12 | 35 | 17 | 18 | null | null |
vrom911/Compiler | src/Compiler/Rum/Compiler/CodeGen.hs | mit | modifyBlock :: BlockState -> Codegen ()
modifyBlock new = getBlock >>= \active ->
modify (\s -> s { blocks = Map.insert active new (blocks s) }) | 146 | modifyBlock :: BlockState -> Codegen ()
modifyBlock new = getBlock >>= \active ->
modify (\s -> s { blocks = Map.insert active new (blocks s) }) | 146 | modifyBlock new = getBlock >>= \active ->
modify (\s -> s { blocks = Map.insert active new (blocks s) }) | 106 | false | true | 0 | 14 | 27 | 66 | 34 | 32 | null | null |
siddhanathan/ghc | compiler/basicTypes/IdInfo.hs | bsd-3-clause | -- | Basic 'IdInfo' that carries no useful information whatsoever
vanillaIdInfo :: IdInfo
vanillaIdInfo
= IdInfo {
cafInfo = vanillaCafInfo,
arityInfo = unknownArity,
ruleInfo = emptyRuleInfo,
unfoldingInfo = noUnfolding,
oneShotInfo = NoOneShotInfo,
inlinePragInfo = defaultInlinePragma,
occInfo = NoOccInfo,
demandInfo = topDmd,
strictnessInfo = nopSig,
callArityInfo = unknownArity
} | 601 | vanillaIdInfo :: IdInfo
vanillaIdInfo
= IdInfo {
cafInfo = vanillaCafInfo,
arityInfo = unknownArity,
ruleInfo = emptyRuleInfo,
unfoldingInfo = noUnfolding,
oneShotInfo = NoOneShotInfo,
inlinePragInfo = defaultInlinePragma,
occInfo = NoOccInfo,
demandInfo = topDmd,
strictnessInfo = nopSig,
callArityInfo = unknownArity
} | 535 | vanillaIdInfo
= IdInfo {
cafInfo = vanillaCafInfo,
arityInfo = unknownArity,
ruleInfo = emptyRuleInfo,
unfoldingInfo = noUnfolding,
oneShotInfo = NoOneShotInfo,
inlinePragInfo = defaultInlinePragma,
occInfo = NoOccInfo,
demandInfo = topDmd,
strictnessInfo = nopSig,
callArityInfo = unknownArity
} | 511 | true | true | 0 | 6 | 262 | 77 | 48 | 29 | null | null |
lpeterse/koka | src/Interpreter/Message.hs | apache-2.0 | -- | See "Type.Pretty" for details.
prettyEnv :: Printer p => State p -> Env
prettyEnv st
= ( prettyEnvFromFlags (flags st) )
{ context = loadedName (loaded st)
, importsMap = loadedImportMap (loaded st)
} | 228 | prettyEnv :: Printer p => State p -> Env
prettyEnv st
= ( prettyEnvFromFlags (flags st) )
{ context = loadedName (loaded st)
, importsMap = loadedImportMap (loaded st)
} | 192 | prettyEnv st
= ( prettyEnvFromFlags (flags st) )
{ context = loadedName (loaded st)
, importsMap = loadedImportMap (loaded st)
} | 151 | true | true | 0 | 10 | 58 | 77 | 38 | 39 | null | null |
sol/pandoc | src/Text/Pandoc/Writers/OpenDocument.hs | gpl-2.0 | paraListStyle :: Int -> State WriterState Int
paraListStyle l = paraStyle "Text_20_body" [("style:list-style-name", "L" ++ show l )] | 132 | paraListStyle :: Int -> State WriterState Int
paraListStyle l = paraStyle "Text_20_body" [("style:list-style-name", "L" ++ show l )] | 132 | paraListStyle l = paraStyle "Text_20_body" [("style:list-style-name", "L" ++ show l )] | 86 | false | true | 0 | 9 | 17 | 44 | 22 | 22 | null | null |
raboof/xmobar | src/Plugins/Monitors/Disk.hs | bsd-3-clause | diskIOConfig :: IO MConfig
diskIOConfig = mkMConfig "" ["total", "read", "write",
"totalbar", "readbar", "writebar"] | 145 | diskIOConfig :: IO MConfig
diskIOConfig = mkMConfig "" ["total", "read", "write",
"totalbar", "readbar", "writebar"] | 145 | diskIOConfig = mkMConfig "" ["total", "read", "write",
"totalbar", "readbar", "writebar"] | 118 | false | true | 0 | 6 | 42 | 37 | 21 | 16 | null | null |
bttr/psqueues | src/Data/OrdPSQ/Internal.hs | bsd-3-clause | lbalanceRight
:: (Ord k, Ord p)
=> k -> p -> v -> LTree k p v -> k -> LTree k p v -> LTree k p v
lbalanceRight k p v l m r
| size' (left l) > size' (right l) = lsingleRight k p v l m r
| otherwise = ldoubleRight k p v l m r | 262 | lbalanceRight
:: (Ord k, Ord p)
=> k -> p -> v -> LTree k p v -> k -> LTree k p v -> LTree k p v
lbalanceRight k p v l m r
| size' (left l) > size' (right l) = lsingleRight k p v l m r
| otherwise = ldoubleRight k p v l m r | 262 | lbalanceRight k p v l m r
| size' (left l) > size' (right l) = lsingleRight k p v l m r
| otherwise = ldoubleRight k p v l m r | 157 | false | true | 1 | 12 | 100 | 148 | 70 | 78 | null | null |
nevrenato/HetsAlloy | OWL2/XML.hs | gpl-2.0 | getDataRange :: XMLBase -> Element -> DataRange
getDataRange b e =
let ch@(ch1 : _) = elChildren e
in case getName e of
"Datatype" -> DataType (getIRI b e) []
"DatatypeRestriction" ->
let dt = getIRI b $ filterC "Datatype" e
fvp = map (getFacetValuePair b) $ filterCh "FacetRestriction" e
in DataType dt fvp
"DataComplementOf" -> DataComplementOf $ getDataRange b ch1
"DataOneOf" -> DataOneOf $ map (getLiteral b) $ filterCh "Literal" e
"DataIntersectionOf" -> DataJunction IntersectionOf
$ map (getDataRange b) ch
"DataUnionOf" -> DataJunction UnionOf $ map (getDataRange b) ch
_ -> err "not data range" | 676 | getDataRange :: XMLBase -> Element -> DataRange
getDataRange b e =
let ch@(ch1 : _) = elChildren e
in case getName e of
"Datatype" -> DataType (getIRI b e) []
"DatatypeRestriction" ->
let dt = getIRI b $ filterC "Datatype" e
fvp = map (getFacetValuePair b) $ filterCh "FacetRestriction" e
in DataType dt fvp
"DataComplementOf" -> DataComplementOf $ getDataRange b ch1
"DataOneOf" -> DataOneOf $ map (getLiteral b) $ filterCh "Literal" e
"DataIntersectionOf" -> DataJunction IntersectionOf
$ map (getDataRange b) ch
"DataUnionOf" -> DataJunction UnionOf $ map (getDataRange b) ch
_ -> err "not data range" | 676 | getDataRange b e =
let ch@(ch1 : _) = elChildren e
in case getName e of
"Datatype" -> DataType (getIRI b e) []
"DatatypeRestriction" ->
let dt = getIRI b $ filterC "Datatype" e
fvp = map (getFacetValuePair b) $ filterCh "FacetRestriction" e
in DataType dt fvp
"DataComplementOf" -> DataComplementOf $ getDataRange b ch1
"DataOneOf" -> DataOneOf $ map (getLiteral b) $ filterCh "Literal" e
"DataIntersectionOf" -> DataJunction IntersectionOf
$ map (getDataRange b) ch
"DataUnionOf" -> DataJunction UnionOf $ map (getDataRange b) ch
_ -> err "not data range" | 628 | false | true | 0 | 17 | 167 | 239 | 110 | 129 | null | null |
scott-fleischman/greek-grammar | haskell/greek-grammar/src/Data/Unicode/DecomposeChar.hs | mit | decomposeChar '\x1F71' = "\x03B1\x0301" | 39 | decomposeChar '\x1F71' = "\x03B1\x0301" | 39 | decomposeChar '\x1F71' = "\x03B1\x0301" | 39 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
proger/unhal | src/HalHaskell.hs | bsd-3-clause | loident = Ident . uncap where uncap (x:xs) = toLower x : xs | 59 | loident = Ident . uncap where uncap (x:xs) = toLower x : xs | 59 | loident = Ident . uncap where uncap (x:xs) = toLower x : xs | 59 | false | false | 2 | 7 | 12 | 38 | 17 | 21 | null | null |
Icelandjack/lens | src/Control/Lens/Level.hs | bsd-3-clause | -- | This provides a breadth-first 'Traversal' of the individual levels of any other 'Traversal'
-- via iterative deepening depth-first search. The levels are returned to you in a compressed format.
--
-- This is similar to 'levels', but retains the index of the original 'IndexedTraversal', so you can
-- access it when traversing the levels later on.
--
-- >>> ["dog","cat"]^@..ilevels (traversed<.>traversed).itraversed
-- [((0,0),'d'),((0,1),'o'),((1,0),'c'),((0,2),'g'),((1,1),'a'),((1,2),'t')]
--
-- The resulting 'Traversal' of the levels which is indexed by the depth of each 'Level'.
--
-- >>> ["dog","cat"]^@..ilevels (traversed<.>traversed)<.>itraversed
-- [((2,(0,0)),'d'),((3,(0,1)),'o'),((3,(1,0)),'c'),((4,(0,2)),'g'),((4,(1,1)),'a'),((5,(1,2)),'t')]
--
-- /Note:/ Internally this is implemented by using an illegal 'Applicative', as it extracts information
-- in an order that violates the 'Applicative' laws.
ilevels :: AnIndexedTraversal i s t a b -> IndexedTraversal Int s t (Level i a) (Level j b)
ilevels l f s = ilevelOuts bz <$> traversed f (ilevelIns bz) where
bz = l sell s
| 1,101 | ilevels :: AnIndexedTraversal i s t a b -> IndexedTraversal Int s t (Level i a) (Level j b)
ilevels l f s = ilevelOuts bz <$> traversed f (ilevelIns bz) where
bz = l sell s
| 175 | ilevels l f s = ilevelOuts bz <$> traversed f (ilevelIns bz) where
bz = l sell s
| 83 | true | true | 0 | 8 | 153 | 106 | 59 | 47 | null | null |
olsner/ghc | compiler/nativeGen/X86/Ppr.hs | bsd-3-clause | pprInstr (JXX cond blockid)
= pprCondInstr (sLit "j") cond (ppr lab)
where lab = mkAsmTempLabel (getUnique blockid) | 119 | pprInstr (JXX cond blockid)
= pprCondInstr (sLit "j") cond (ppr lab)
where lab = mkAsmTempLabel (getUnique blockid) | 119 | pprInstr (JXX cond blockid)
= pprCondInstr (sLit "j") cond (ppr lab)
where lab = mkAsmTempLabel (getUnique blockid) | 119 | false | false | 0 | 7 | 20 | 53 | 25 | 28 | null | null |
sopvop/cabal | Cabal/Distribution/ParseUtils.hs | bsd-3-clause | -- | Convert the parse tree into the Field AST
-- Also check for dodgy uses of tabs in indentation.
mkField :: Int -> SyntaxTree -> ParseResult Field
mkField d (Node (n,t,_) _) | d >= 1 && t = tabsError n | 204 | mkField :: Int -> SyntaxTree -> ParseResult Field
mkField d (Node (n,t,_) _) | d >= 1 && t = tabsError n | 104 | mkField d (Node (n,t,_) _) | d >= 1 && t = tabsError n | 54 | true | true | 0 | 9 | 41 | 63 | 32 | 31 | null | null |
prb/perpubplat | src/Blog/BackEnd/ModelTransformations.hs | bsd-3-clause | -- | Add a comment to the model and storage system, including filling
-- in any necessary fields. All comments are initially set to
-- invisible.
ingest_comment :: Item -> Model -> IO Model
ingest_comment c m = do { ts <- now
; let int_id = next_id m
; let new_comment = c { internal_id = int_id
, updated = ts
, permatitle = "comment-" ++ (show int_id)
, kind = Comment }
; let (_,m') = insert m new_comment
; forkIO $ I.save m' new_comment >> return ()
; return m' } | 727 | ingest_comment :: Item -> Model -> IO Model
ingest_comment c m = do { ts <- now
; let int_id = next_id m
; let new_comment = c { internal_id = int_id
, updated = ts
, permatitle = "comment-" ++ (show int_id)
, kind = Comment }
; let (_,m') = insert m new_comment
; forkIO $ I.save m' new_comment >> return ()
; return m' } | 580 | ingest_comment c m = do { ts <- now
; let int_id = next_id m
; let new_comment = c { internal_id = int_id
, updated = ts
, permatitle = "comment-" ++ (show int_id)
, kind = Comment }
; let (_,m') = insert m new_comment
; forkIO $ I.save m' new_comment >> return ()
; return m' } | 536 | true | true | 0 | 15 | 352 | 156 | 80 | 76 | null | null |
fpinsight/hocilib | src/Database/Ocilib/Collections.hs | bsd-2-clause | -- | Return the type info object associated to the collection.
ociCollGetTypeInfo :: Ptr OCI_Coll -> IO (Ptr OCI_TypeInfo)
ociCollGetTypeInfo c = [C.exp| OCI_TypeInfo* { OCI_CollGetTypeInfo($(OCI_Coll *c)) }|] | 209 | ociCollGetTypeInfo :: Ptr OCI_Coll -> IO (Ptr OCI_TypeInfo)
ociCollGetTypeInfo c = [C.exp| OCI_TypeInfo* { OCI_CollGetTypeInfo($(OCI_Coll *c)) }|] | 146 | ociCollGetTypeInfo c = [C.exp| OCI_TypeInfo* { OCI_CollGetTypeInfo($(OCI_Coll *c)) }|] | 86 | true | true | 0 | 8 | 27 | 37 | 20 | 17 | null | null |
sukwon0709/z3-haskell | src/Z3/Monad.hs | bsd-3-clause | liftFun3 :: MonadZ3 z3 => (Base.Context -> a -> b -> c -> IO d)
-> a -> b -> c -> z3 d
liftFun3 f a b c = getContext >>= \ctx -> liftIO (f ctx a b c) | 179 | liftFun3 :: MonadZ3 z3 => (Base.Context -> a -> b -> c -> IO d)
-> a -> b -> c -> z3 d
liftFun3 f a b c = getContext >>= \ctx -> liftIO (f ctx a b c) | 179 | liftFun3 f a b c = getContext >>= \ctx -> liftIO (f ctx a b c) | 62 | false | true | 0 | 12 | 69 | 94 | 46 | 48 | null | null |
rahulmutt/ghcvm | compiler/Eta/Prelude/PrimOp.hs | bsd-3-clause | primOpInfo FinalizeWeakOp = mkGenPrimOp (fsLit "finalizeWeak#") [alphaTyVar] [mkWeakPrimTy alphaTy, mkStatePrimTy realWorldTy] ((mkTupleTy UnboxedTuple [mkStatePrimTy realWorldTy, intPrimTy, (mkFunTy (mkStatePrimTy realWorldTy) ((mkTupleTy UnboxedTuple [mkStatePrimTy realWorldTy, unitTy])))])) | 295 | primOpInfo FinalizeWeakOp = mkGenPrimOp (fsLit "finalizeWeak#") [alphaTyVar] [mkWeakPrimTy alphaTy, mkStatePrimTy realWorldTy] ((mkTupleTy UnboxedTuple [mkStatePrimTy realWorldTy, intPrimTy, (mkFunTy (mkStatePrimTy realWorldTy) ((mkTupleTy UnboxedTuple [mkStatePrimTy realWorldTy, unitTy])))])) | 295 | primOpInfo FinalizeWeakOp = mkGenPrimOp (fsLit "finalizeWeak#") [alphaTyVar] [mkWeakPrimTy alphaTy, mkStatePrimTy realWorldTy] ((mkTupleTy UnboxedTuple [mkStatePrimTy realWorldTy, intPrimTy, (mkFunTy (mkStatePrimTy realWorldTy) ((mkTupleTy UnboxedTuple [mkStatePrimTy realWorldTy, unitTy])))])) | 295 | false | false | 0 | 16 | 24 | 96 | 50 | 46 | null | null |
c089/haskell-craft3e | Chapter14_1.hs | mit | -- ... and functions.
showPerson (Adult nm ad bio)
= show nm ++ show ad ++ showBiog bio | 91 | showPerson (Adult nm ad bio)
= show nm ++ show ad ++ showBiog bio | 68 | showPerson (Adult nm ad bio)
= show nm ++ show ad ++ showBiog bio | 68 | true | false | 0 | 7 | 21 | 37 | 17 | 20 | null | null |
shayan-najd/HsParser | U/Outputable.hs | gpl-3.0 | doubleQuotes d = SDoc $ U.Pretty.doubleQuotes . runSDoc d | 58 | doubleQuotes d = SDoc $ U.Pretty.doubleQuotes . runSDoc d | 58 | doubleQuotes d = SDoc $ U.Pretty.doubleQuotes . runSDoc d | 58 | false | false | 0 | 7 | 9 | 23 | 11 | 12 | null | null |
jwiegley/lambdabot-1 | unlambda/Language/Unlambda.hs | mit | sh (Ques c) = showChar '?' . showChar c | 41 | sh (Ques c) = showChar '?' . showChar c | 41 | sh (Ques c) = showChar '?' . showChar c | 41 | false | false | 0 | 6 | 10 | 26 | 11 | 15 | null | null |
sos22/himap | HeaderParse.hs | gpl-3.0 | nameAddr :: Parser [String]
nameAddr =
stripCFWS $
do dn <- optional $ do r <- phrase
skipCFWS
return r
aa <- angleAddr
return $ case dn of
Just dn' -> [dn',aa]
Nothing -> [aa] | 254 | nameAddr :: Parser [String]
nameAddr =
stripCFWS $
do dn <- optional $ do r <- phrase
skipCFWS
return r
aa <- angleAddr
return $ case dn of
Just dn' -> [dn',aa]
Nothing -> [aa] | 254 | nameAddr =
stripCFWS $
do dn <- optional $ do r <- phrase
skipCFWS
return r
aa <- angleAddr
return $ case dn of
Just dn' -> [dn',aa]
Nothing -> [aa] | 226 | false | true | 2 | 13 | 112 | 98 | 44 | 54 | null | null |
geophf/1HaskellADay | exercises/HAD/Y2018/M02/D16/Exercise.hs | mit | -- How many coprime pairs are there of adjacent pairs?
-- Did you have to consider efficiency in your search, or nah?
{--
>>> nums <- concatMap words . drop 2 . lines <$> readFile rndNums
>>> length nums
94
pairwise :: [a] -> [(a,a)]
pairwise [_] = []
pairwise (a:b:rest) = (a,b) : pairwise (a:rest) ++ pairwise (b:rest)
Hm.
>>> product [1..94]
108736615665674308027365285256786601004186803580182872307497374434045199869417927630229109214583415458560865651202385340530688000000000000000000000
... well, I don't have all day, so ...
--}
pairOff :: [a] -> [(a,a)]
pairOff (a:b:rest) = (a,b) : pairOff rest | 609 | pairOff :: [a] -> [(a,a)]
pairOff (a:b:rest) = (a,b) : pairOff rest | 67 | pairOff (a:b:rest) = (a,b) : pairOff rest | 41 | true | true | 0 | 10 | 91 | 62 | 34 | 28 | null | null |
diagrams/diagrams-contrib | src/Diagrams/Color/XKCD.hs | bsd-3-clause | lightGrey = fromJust $ readHexColor "#d8dcd6" | 57 | lightGrey = fromJust $ readHexColor "#d8dcd6" | 57 | lightGrey = fromJust $ readHexColor "#d8dcd6" | 57 | false | false | 0 | 6 | 17 | 13 | 6 | 7 | null | null |
christiaanb/ghc | utils/genprimopcode/Main.hs | bsd-3-clause | ppType (TyApp (TyCon "Word32#") []) = "word32PrimTy" | 56 | ppType (TyApp (TyCon "Word32#") []) = "word32PrimTy" | 56 | ppType (TyApp (TyCon "Word32#") []) = "word32PrimTy" | 56 | false | false | 0 | 8 | 10 | 26 | 12 | 14 | null | null |
sergv/vector | Data/Vector/Storable/Mutable.hs | bsd-3-clause | storableSet (MVector n fp) x
| n == 0 = return ()
| otherwise = unsafePrimToPrim $
case sizeOf x of
1 -> storableSetAsPrim n fp x (undefined :: Word8)
2 -> storableSetAsPrim n fp x (undefined :: Word16)
4 -> storableSetAsPrim n fp x (undefined :: Word32)
8 -> storableSetAsPrim n fp x (undefined :: Word64)
_ -> withForeignPtr fp $ \p -> do
poke p x
let do_set i
| 2*i < n = do
copyArray (p `advancePtr` i) p i
do_set (2*i)
| otherwise = copyArray (p `advancePtr` i) p (n-i)
do_set 1 | 788 | storableSet (MVector n fp) x
| n == 0 = return ()
| otherwise = unsafePrimToPrim $
case sizeOf x of
1 -> storableSetAsPrim n fp x (undefined :: Word8)
2 -> storableSetAsPrim n fp x (undefined :: Word16)
4 -> storableSetAsPrim n fp x (undefined :: Word32)
8 -> storableSetAsPrim n fp x (undefined :: Word64)
_ -> withForeignPtr fp $ \p -> do
poke p x
let do_set i
| 2*i < n = do
copyArray (p `advancePtr` i) p i
do_set (2*i)
| otherwise = copyArray (p `advancePtr` i) p (n-i)
do_set 1 | 788 | storableSet (MVector n fp) x
| n == 0 = return ()
| otherwise = unsafePrimToPrim $
case sizeOf x of
1 -> storableSetAsPrim n fp x (undefined :: Word8)
2 -> storableSetAsPrim n fp x (undefined :: Word16)
4 -> storableSetAsPrim n fp x (undefined :: Word32)
8 -> storableSetAsPrim n fp x (undefined :: Word64)
_ -> withForeignPtr fp $ \p -> do
poke p x
let do_set i
| 2*i < n = do
copyArray (p `advancePtr` i) p i
do_set (2*i)
| otherwise = copyArray (p `advancePtr` i) p (n-i)
do_set 1 | 788 | false | false | 2 | 21 | 400 | 268 | 128 | 140 | null | null |
int-index/singletons | tests/SingletonsTestSuite.hs | bsd-3-clause | tests :: TestTree
tests =
testGroup "Testsuite" $ [
testCompileAndDumpGroup "Singletons"
[ compileAndDumpStdTest "Nat"
, compileAndDumpStdTest "Empty"
, compileAndDumpStdTest "Maybe"
, compileAndDumpStdTest "BoxUnBox"
, compileAndDumpStdTest "Operators"
, compileAndDumpStdTest "HigherOrder"
, compileAndDumpStdTest "Contains"
, compileAndDumpStdTest "AsPattern"
, compileAndDumpStdTest "DataValues"
, compileAndDumpStdTest "EqInstances"
, compileAndDumpStdTest "CaseExpressions"
, compileAndDumpStdTest "Star"
, compileAndDumpStdTest "ReturnFunc"
, compileAndDumpStdTest "Lambdas"
, compileAndDumpStdTest "LambdasComprehensive"
, compileAndDumpStdTest "Error"
, compileAndDumpStdTest "TopLevelPatterns"
, compileAndDumpStdTest "LetStatements"
, compileAndDumpStdTest "LambdaCase"
, compileAndDumpStdTest "Sections"
, compileAndDumpStdTest "PatternMatching"
, compileAndDumpStdTest "Records"
, compileAndDumpStdTest "T29"
, compileAndDumpStdTest "T33"
, compileAndDumpStdTest "T54"
, compileAndDumpStdTest "Classes"
, compileAndDumpStdTest "Classes2"
, compileAndDumpStdTest "FunDeps"
, compileAndDumpStdTest "T78"
, compileAndDumpStdTest "OrdDeriving"
, compileAndDumpStdTest "BoundedDeriving"
, compileAndDumpStdTest "BadBoundedDeriving"
, compileAndDumpStdTest "EnumDeriving"
, compileAndDumpStdTest "BadEnumDeriving"
, compileAndDumpStdTest "Fixity"
, compileAndDumpStdTest "Undef"
, compileAndDumpStdTest "T124"
, compileAndDumpStdTest "T136"
, compileAndDumpStdTest "T136b"
, compileAndDumpStdTest "T153"
, compileAndDumpStdTest "T157"
, compileAndDumpStdTest "T159"
, compileAndDumpStdTest "T167"
, compileAndDumpStdTest "T145"
, compileAndDumpStdTest "PolyKinds"
, compileAndDumpStdTest "PolyKindsApp"
, compileAndDumpStdTest "T166"
],
testCompileAndDumpGroup "Promote"
[ compileAndDumpStdTest "Constructors"
, compileAndDumpStdTest "GenDefunSymbols"
, compileAndDumpStdTest "Newtypes"
, compileAndDumpStdTest "Pragmas"
, compileAndDumpStdTest "Prelude"
],
testGroup "Database client"
[ compileAndDumpTest "GradingClient/Database" ghcOpts
, compileAndDumpTest "GradingClient/Main" ghcOpts
],
testCompileAndDumpGroup "InsertionSort"
[ compileAndDumpStdTest "InsertionSortImp"
]
] | 2,448 | tests :: TestTree
tests =
testGroup "Testsuite" $ [
testCompileAndDumpGroup "Singletons"
[ compileAndDumpStdTest "Nat"
, compileAndDumpStdTest "Empty"
, compileAndDumpStdTest "Maybe"
, compileAndDumpStdTest "BoxUnBox"
, compileAndDumpStdTest "Operators"
, compileAndDumpStdTest "HigherOrder"
, compileAndDumpStdTest "Contains"
, compileAndDumpStdTest "AsPattern"
, compileAndDumpStdTest "DataValues"
, compileAndDumpStdTest "EqInstances"
, compileAndDumpStdTest "CaseExpressions"
, compileAndDumpStdTest "Star"
, compileAndDumpStdTest "ReturnFunc"
, compileAndDumpStdTest "Lambdas"
, compileAndDumpStdTest "LambdasComprehensive"
, compileAndDumpStdTest "Error"
, compileAndDumpStdTest "TopLevelPatterns"
, compileAndDumpStdTest "LetStatements"
, compileAndDumpStdTest "LambdaCase"
, compileAndDumpStdTest "Sections"
, compileAndDumpStdTest "PatternMatching"
, compileAndDumpStdTest "Records"
, compileAndDumpStdTest "T29"
, compileAndDumpStdTest "T33"
, compileAndDumpStdTest "T54"
, compileAndDumpStdTest "Classes"
, compileAndDumpStdTest "Classes2"
, compileAndDumpStdTest "FunDeps"
, compileAndDumpStdTest "T78"
, compileAndDumpStdTest "OrdDeriving"
, compileAndDumpStdTest "BoundedDeriving"
, compileAndDumpStdTest "BadBoundedDeriving"
, compileAndDumpStdTest "EnumDeriving"
, compileAndDumpStdTest "BadEnumDeriving"
, compileAndDumpStdTest "Fixity"
, compileAndDumpStdTest "Undef"
, compileAndDumpStdTest "T124"
, compileAndDumpStdTest "T136"
, compileAndDumpStdTest "T136b"
, compileAndDumpStdTest "T153"
, compileAndDumpStdTest "T157"
, compileAndDumpStdTest "T159"
, compileAndDumpStdTest "T167"
, compileAndDumpStdTest "T145"
, compileAndDumpStdTest "PolyKinds"
, compileAndDumpStdTest "PolyKindsApp"
, compileAndDumpStdTest "T166"
],
testCompileAndDumpGroup "Promote"
[ compileAndDumpStdTest "Constructors"
, compileAndDumpStdTest "GenDefunSymbols"
, compileAndDumpStdTest "Newtypes"
, compileAndDumpStdTest "Pragmas"
, compileAndDumpStdTest "Prelude"
],
testGroup "Database client"
[ compileAndDumpTest "GradingClient/Database" ghcOpts
, compileAndDumpTest "GradingClient/Main" ghcOpts
],
testCompileAndDumpGroup "InsertionSort"
[ compileAndDumpStdTest "InsertionSortImp"
]
] | 2,448 | tests =
testGroup "Testsuite" $ [
testCompileAndDumpGroup "Singletons"
[ compileAndDumpStdTest "Nat"
, compileAndDumpStdTest "Empty"
, compileAndDumpStdTest "Maybe"
, compileAndDumpStdTest "BoxUnBox"
, compileAndDumpStdTest "Operators"
, compileAndDumpStdTest "HigherOrder"
, compileAndDumpStdTest "Contains"
, compileAndDumpStdTest "AsPattern"
, compileAndDumpStdTest "DataValues"
, compileAndDumpStdTest "EqInstances"
, compileAndDumpStdTest "CaseExpressions"
, compileAndDumpStdTest "Star"
, compileAndDumpStdTest "ReturnFunc"
, compileAndDumpStdTest "Lambdas"
, compileAndDumpStdTest "LambdasComprehensive"
, compileAndDumpStdTest "Error"
, compileAndDumpStdTest "TopLevelPatterns"
, compileAndDumpStdTest "LetStatements"
, compileAndDumpStdTest "LambdaCase"
, compileAndDumpStdTest "Sections"
, compileAndDumpStdTest "PatternMatching"
, compileAndDumpStdTest "Records"
, compileAndDumpStdTest "T29"
, compileAndDumpStdTest "T33"
, compileAndDumpStdTest "T54"
, compileAndDumpStdTest "Classes"
, compileAndDumpStdTest "Classes2"
, compileAndDumpStdTest "FunDeps"
, compileAndDumpStdTest "T78"
, compileAndDumpStdTest "OrdDeriving"
, compileAndDumpStdTest "BoundedDeriving"
, compileAndDumpStdTest "BadBoundedDeriving"
, compileAndDumpStdTest "EnumDeriving"
, compileAndDumpStdTest "BadEnumDeriving"
, compileAndDumpStdTest "Fixity"
, compileAndDumpStdTest "Undef"
, compileAndDumpStdTest "T124"
, compileAndDumpStdTest "T136"
, compileAndDumpStdTest "T136b"
, compileAndDumpStdTest "T153"
, compileAndDumpStdTest "T157"
, compileAndDumpStdTest "T159"
, compileAndDumpStdTest "T167"
, compileAndDumpStdTest "T145"
, compileAndDumpStdTest "PolyKinds"
, compileAndDumpStdTest "PolyKindsApp"
, compileAndDumpStdTest "T166"
],
testCompileAndDumpGroup "Promote"
[ compileAndDumpStdTest "Constructors"
, compileAndDumpStdTest "GenDefunSymbols"
, compileAndDumpStdTest "Newtypes"
, compileAndDumpStdTest "Pragmas"
, compileAndDumpStdTest "Prelude"
],
testGroup "Database client"
[ compileAndDumpTest "GradingClient/Database" ghcOpts
, compileAndDumpTest "GradingClient/Main" ghcOpts
],
testCompileAndDumpGroup "InsertionSort"
[ compileAndDumpStdTest "InsertionSortImp"
]
] | 2,430 | false | true | 0 | 9 | 451 | 384 | 192 | 192 | null | null |
pads-fhs/Cashlog | src/Cashlog/Data/Connection.hs | gpl-2.0 | disconnectDataSource :: DataHandle
-> IO ()
disconnectDataSource = DB.disconnect | 101 | disconnectDataSource :: DataHandle
-> IO ()
disconnectDataSource = DB.disconnect | 101 | disconnectDataSource = DB.disconnect | 36 | false | true | 0 | 8 | 29 | 28 | 12 | 16 | null | null |
vikraman/ghc | compiler/simplStg/UnariseStg.hs | bsd-3-clause | unariseExpr _ _ (StgLit l)
= StgLit l | 39 | unariseExpr _ _ (StgLit l)
= StgLit l | 39 | unariseExpr _ _ (StgLit l)
= StgLit l | 39 | false | false | 0 | 7 | 9 | 22 | 10 | 12 | null | null |
bkoropoff/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | mapPTermFC f g (PElabError err) = PElabError err | 48 | mapPTermFC f g (PElabError err) = PElabError err | 48 | mapPTermFC f g (PElabError err) = PElabError err | 48 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
mightymoose/liquidhaskell | benchmarks/vector-0.10.0.1/Data/Vector/Storable.hs | bsd-3-clause | span = G.span | 13 | span = G.span | 13 | span = G.span | 13 | false | false | 1 | 6 | 2 | 12 | 4 | 8 | null | null |
tokiwoousaka/ArareDSL | src/Sound/Arare/ArareDSL.hs | mit | makeNote :: (MonadNoteController (ArareSequencer s), NoteController s)
=> Maybe NoteLength -> Maybe NoteVelocity -> NoteScale -> ArareSequencer s ()
makeNote l v s = let
judge :: ArareSequencer s a -> Maybe a -> ArareSequencer s a
judge f v = do
x <- f
return $ maybe x id v
in do
nl <- judge getNoteLength l
nv <- judge getNoteVelocity v
sendInstrumentMessage . noteOn $ Note s nl nv
-- TODO : 時間調整
sendInstrumentMessage . noteOff $ Note s nl nv | 491 | makeNote :: (MonadNoteController (ArareSequencer s), NoteController s)
=> Maybe NoteLength -> Maybe NoteVelocity -> NoteScale -> ArareSequencer s ()
makeNote l v s = let
judge :: ArareSequencer s a -> Maybe a -> ArareSequencer s a
judge f v = do
x <- f
return $ maybe x id v
in do
nl <- judge getNoteLength l
nv <- judge getNoteVelocity v
sendInstrumentMessage . noteOn $ Note s nl nv
-- TODO : 時間調整
sendInstrumentMessage . noteOff $ Note s nl nv | 491 | makeNote l v s = let
judge :: ArareSequencer s a -> Maybe a -> ArareSequencer s a
judge f v = do
x <- f
return $ maybe x id v
in do
nl <- judge getNoteLength l
nv <- judge getNoteVelocity v
sendInstrumentMessage . noteOn $ Note s nl nv
-- TODO : 時間調整
sendInstrumentMessage . noteOff $ Note s nl nv | 340 | false | true | 0 | 12 | 127 | 193 | 87 | 106 | null | null |
acowley/roshask | src/Ros/Topic/Arrow.hs | bsd-3-clause | dropWhile = TopicArrow . T.dropWhile | 36 | dropWhile = TopicArrow . T.dropWhile | 36 | dropWhile = TopicArrow . T.dropWhile | 36 | false | false | 2 | 6 | 4 | 17 | 6 | 11 | null | null |
snoyberg/ghc | compiler/coreSyn/MkCore.hs | bsd-3-clause | mkCoreConApps :: DataCon -> [CoreExpr] -> CoreExpr
mkCoreConApps con args = mkCoreApps (Var (dataConWorkId con)) args | 117 | mkCoreConApps :: DataCon -> [CoreExpr] -> CoreExpr
mkCoreConApps con args = mkCoreApps (Var (dataConWorkId con)) args | 117 | mkCoreConApps con args = mkCoreApps (Var (dataConWorkId con)) args | 66 | false | true | 0 | 9 | 15 | 44 | 22 | 22 | null | null |
awto/chr2sql | CHR2/Parser.hs | bsd-3-clause | tyFromString _ = Nothing | 24 | tyFromString _ = Nothing | 24 | tyFromString _ = Nothing | 24 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
danr/hipspec | src/HipSpec/Utils.hs | gpl-3.0 | -- | Concatenate the results after mapM
concatMapM :: Monad m => (a -> m [b]) -> [a] -> m [b]
concatMapM f = liftM concat . mapM f | 130 | concatMapM :: Monad m => (a -> m [b]) -> [a] -> m [b]
concatMapM f = liftM concat . mapM f | 90 | concatMapM f = liftM concat . mapM f | 36 | true | true | 0 | 10 | 28 | 62 | 31 | 31 | null | null |
phylake/avm3 | llvm/util/nameres.hs | mit | nsinfo_impl string_res (NSInfo_PackageInternalNs a) = string_res a | 67 | nsinfo_impl string_res (NSInfo_PackageInternalNs a) = string_res a | 67 | nsinfo_impl string_res (NSInfo_PackageInternalNs a) = string_res a | 67 | false | false | 0 | 7 | 7 | 20 | 9 | 11 | null | null |
iand675/hs-kafka | src/Network/Kafka/Internal/Connection.hs | bsd-3-clause | nextCorrelationId :: KafkaConnection -> IO CorrelationId
nextCorrelationId c = atomicModifyIORef'
(kafkaCorrelationSupply c)
(\x -> (x + 1, CorrelationId $ fromIntegral x)) | 176 | nextCorrelationId :: KafkaConnection -> IO CorrelationId
nextCorrelationId c = atomicModifyIORef'
(kafkaCorrelationSupply c)
(\x -> (x + 1, CorrelationId $ fromIntegral x)) | 176 | nextCorrelationId c = atomicModifyIORef'
(kafkaCorrelationSupply c)
(\x -> (x + 1, CorrelationId $ fromIntegral x)) | 119 | false | true | 0 | 9 | 24 | 58 | 29 | 29 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/GT_2.hs | mit | compareRatio :: Ratio MyInt -> Ratio MyInt -> Ordering
compareRatio (CnPc x y) (CnPc x' y') = compareMyInt (srMyInt x y') (srMyInt x' y) | 140 | compareRatio :: Ratio MyInt -> Ratio MyInt -> Ordering
compareRatio (CnPc x y) (CnPc x' y') = compareMyInt (srMyInt x y') (srMyInt x' y) | 140 | compareRatio (CnPc x y) (CnPc x' y') = compareMyInt (srMyInt x y') (srMyInt x' y) | 81 | false | true | 0 | 10 | 27 | 72 | 33 | 39 | null | null |
bennofs/vplan | tests/Laws.hs | gpl-3.0 | isLens :: (Arbitrary s, Arbitrary a, CoArbitrary a, Show s, Show a, Eq s, Eq a, Function a)
=> Lens' s a -> Property
isLens l = lens_set_view l .&. lens_view_set l .&. isTraversal l | 188 | isLens :: (Arbitrary s, Arbitrary a, CoArbitrary a, Show s, Show a, Eq s, Eq a, Function a)
=> Lens' s a -> Property
isLens l = lens_set_view l .&. lens_view_set l .&. isTraversal l | 188 | isLens l = lens_set_view l .&. lens_view_set l .&. isTraversal l | 64 | false | true | 0 | 7 | 41 | 91 | 44 | 47 | null | null |
cartazio/omega | vendor/fph/example.hs | bsd-3-clause | runHR :: forall b. (forall a. a -> a) -> b -> b
runHR x y = x y | 63 | runHR :: forall b. (forall a. a -> a) -> b -> b
runHR x y = x y | 63 | runHR x y = x y | 15 | false | true | 0 | 10 | 18 | 50 | 24 | 26 | null | null |
mcschroeder/ghc | compiler/ghci/ByteCodeGen.hs | bsd-3-clause | atomPrimRep (AnnVar v) = bcIdPrimRep v | 51 | atomPrimRep (AnnVar v) = bcIdPrimRep v | 51 | atomPrimRep (AnnVar v) = bcIdPrimRep v | 51 | false | false | 0 | 7 | 18 | 18 | 8 | 10 | null | null |
FranklinChen/blaze-markup | src/Text/Blaze/Internal.hs | bsd-3-clause | -- | Create a comment from a 'String' value.
-- The text should not contain @"--"@.
-- This is not checked by the library.
stringComment :: String -> Markup
stringComment = Comment . PreEscaped . String | 202 | stringComment :: String -> Markup
stringComment = Comment . PreEscaped . String | 79 | stringComment = Comment . PreEscaped . String | 45 | true | true | 0 | 6 | 35 | 26 | 15 | 11 | null | null |
SAdams601/ParRegexSearch | test/HaRe/test/TestUtils.hs | mit | showAnnDataFromState :: RefactState -> String
showAnnDataFromState st =
case rsModule st of
Just tm -> r
where
anns = tkCache (rsTokenCache tm) Map.! mainTid
parsed = GHC.pm_parsed_source $ GHC.tm_parsed_module
$ rsTypecheckedMod tm
r = showAnnData anns 0 parsed
Nothing -> []
-- --------------------------------------------------------------------- | 407 | showAnnDataFromState :: RefactState -> String
showAnnDataFromState st =
case rsModule st of
Just tm -> r
where
anns = tkCache (rsTokenCache tm) Map.! mainTid
parsed = GHC.pm_parsed_source $ GHC.tm_parsed_module
$ rsTypecheckedMod tm
r = showAnnData anns 0 parsed
Nothing -> []
-- --------------------------------------------------------------------- | 407 | showAnnDataFromState st =
case rsModule st of
Just tm -> r
where
anns = tkCache (rsTokenCache tm) Map.! mainTid
parsed = GHC.pm_parsed_source $ GHC.tm_parsed_module
$ rsTypecheckedMod tm
r = showAnnData anns 0 parsed
Nothing -> []
-- --------------------------------------------------------------------- | 361 | false | true | 0 | 13 | 100 | 97 | 48 | 49 | null | null |
rueshyna/gogol | gogol-sqladmin/gen/Network/Google/Resource/SQL/Instances/Insert.hs | mpl-2.0 | -- | Project ID of the project to which the newly created Cloud SQL instances
-- should belong.
insProject :: Lens' InstancesInsert Text
insProject
= lens _insProject (\ s a -> s{_insProject = a}) | 198 | insProject :: Lens' InstancesInsert Text
insProject
= lens _insProject (\ s a -> s{_insProject = a}) | 102 | insProject
= lens _insProject (\ s a -> s{_insProject = a}) | 61 | true | true | 0 | 9 | 35 | 43 | 23 | 20 | null | null |
UCSD-PL/RefScript | src/Language/Rsc/ClassHierarchy.hs | bsd-3-clause | isEnumType _ _ = False | 22 | isEnumType _ _ = False | 22 | isEnumType _ _ = False | 22 | false | false | 0 | 5 | 4 | 11 | 5 | 6 | null | null |
emwap/feldspar-language | src/Feldspar/Stream.hs | bsd-3-clause | app :: Stream (a -> b) -> Stream a -> Stream b
app = zipWith ($) | 64 | app :: Stream (a -> b) -> Stream a -> Stream b
app = zipWith ($) | 64 | app = zipWith ($) | 17 | false | true | 0 | 9 | 15 | 45 | 21 | 24 | null | null |
koengit/induction-examples | List.hs | mit | --------------------------------------------------------------------------------
prop_Select (xs :: [A]) =
map fst (select xs) == xs | 135 | prop_Select (xs :: [A]) =
map fst (select xs) == xs | 53 | prop_Select (xs :: [A]) =
map fst (select xs) == xs | 53 | true | false | 0 | 8 | 14 | 35 | 18 | 17 | null | null |
haslab/SecreC | src/Language/SecreC/Transformation/Simplify.hs | gpl-3.0 | simplifyContextConstraint :: SimplifyK loc m => Bool -> SimplifyCont loc m (ContextConstraint GIdentifier (Typed loc))
simplifyContextConstraint isExpr (ContextPDec l cl isLeak isAnn ck ret n targs pargs) = do
(ss1,ret') <- simplifyReturnTypeSpecifier isExpr ret
(ss2,targs') <- simplifyMaybe (simplifyList (simplifyVariadic (simplifyTemplateTypeArgument isExpr))) targs
(ss3,pargs') <- simplifyList (simplifyCtxPArg isExpr) pargs
returnS (ss1++ss2++ss3,ContextPDec l cl isLeak isAnn ck ret' n targs' pargs') | 524 | simplifyContextConstraint :: SimplifyK loc m => Bool -> SimplifyCont loc m (ContextConstraint GIdentifier (Typed loc))
simplifyContextConstraint isExpr (ContextPDec l cl isLeak isAnn ck ret n targs pargs) = do
(ss1,ret') <- simplifyReturnTypeSpecifier isExpr ret
(ss2,targs') <- simplifyMaybe (simplifyList (simplifyVariadic (simplifyTemplateTypeArgument isExpr))) targs
(ss3,pargs') <- simplifyList (simplifyCtxPArg isExpr) pargs
returnS (ss1++ss2++ss3,ContextPDec l cl isLeak isAnn ck ret' n targs' pargs') | 524 | simplifyContextConstraint isExpr (ContextPDec l cl isLeak isAnn ck ret n targs pargs) = do
(ss1,ret') <- simplifyReturnTypeSpecifier isExpr ret
(ss2,targs') <- simplifyMaybe (simplifyList (simplifyVariadic (simplifyTemplateTypeArgument isExpr))) targs
(ss3,pargs') <- simplifyList (simplifyCtxPArg isExpr) pargs
returnS (ss1++ss2++ss3,ContextPDec l cl isLeak isAnn ck ret' n targs' pargs') | 405 | false | true | 0 | 14 | 74 | 189 | 93 | 96 | null | null |
GregorySchwartz/fasta | src/Data/Fasta/ByteString/Parse.hs | gpl-3.0 | fastaFile :: Parsec B.ByteString u [FastaSequence]
fastaFile = do
spaces
many fasta | 91 | fastaFile :: Parsec B.ByteString u [FastaSequence]
fastaFile = do
spaces
many fasta | 91 | fastaFile = do
spaces
many fasta | 40 | false | true | 0 | 7 | 19 | 32 | 15 | 17 | null | null |
alexisVallet/deep-banana | examples/tatoeba/Tatoeba.hs | bsd-3-clause | parseLinks :: Parser (IntMap Int)
parseLinks = fmap mapFromList $ many $ do
sentenceId <- decimal
char '\t'
transId <- decimal
endOfLine
return (sentenceId, transId) | 175 | parseLinks :: Parser (IntMap Int)
parseLinks = fmap mapFromList $ many $ do
sentenceId <- decimal
char '\t'
transId <- decimal
endOfLine
return (sentenceId, transId) | 175 | parseLinks = fmap mapFromList $ many $ do
sentenceId <- decimal
char '\t'
transId <- decimal
endOfLine
return (sentenceId, transId) | 141 | false | true | 0 | 9 | 34 | 66 | 30 | 36 | null | null |
frenetic-lang/nettle-openflow | src/Nettle/OpenFlow/Action.hs | bsd-3-clause | processWithTable = send WithTable | 33 | processWithTable = send WithTable | 33 | processWithTable = send WithTable | 33 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | haskell/topic/program-structure/2018-07-harold-carr-program-structure/HC.hs | unlicense | launchMissles :: (MonadIO m, MonadReader App m) => m String
launchMissles = do
pw <- getPassword
db <- getDBName
let msg = "launchMissles: " ++ pw ++ " " ++ db
loggit msg
return msg | 191 | launchMissles :: (MonadIO m, MonadReader App m) => m String
launchMissles = do
pw <- getPassword
db <- getDBName
let msg = "launchMissles: " ++ pw ++ " " ++ db
loggit msg
return msg | 191 | launchMissles = do
pw <- getPassword
db <- getDBName
let msg = "launchMissles: " ++ pw ++ " " ++ db
loggit msg
return msg | 131 | false | true | 0 | 12 | 44 | 78 | 36 | 42 | null | null |
nevrenato/HetsAlloy | Common/Keywords.hs | gpl-2.0 | -- * formula symbols
-- | implication arrow (equal and greater)
implS :: String
implS = "=>" | 93 | implS :: String
implS = "=>" | 28 | implS = "=>" | 12 | true | true | 0 | 4 | 17 | 13 | 8 | 5 | null | null |
kwangkim/pigment | tests/TacticParse.hs | mit | schemeEq _ _ _ = False | 22 | schemeEq _ _ _ = False | 22 | schemeEq _ _ _ = False | 22 | false | false | 1 | 5 | 5 | 14 | 5 | 9 | null | null |
olorin/amazonka | amazonka-rds/gen/Network/AWS/RDS/Types/Product.hs | mpl-2.0 | -- | Specifies the name of the option group.
ogOptionGroupName :: Lens' OptionGroup (Maybe Text)
ogOptionGroupName = lens _ogOptionGroupName (\ s a -> s{_ogOptionGroupName = a}) | 177 | ogOptionGroupName :: Lens' OptionGroup (Maybe Text)
ogOptionGroupName = lens _ogOptionGroupName (\ s a -> s{_ogOptionGroupName = a}) | 132 | ogOptionGroupName = lens _ogOptionGroupName (\ s a -> s{_ogOptionGroupName = a}) | 80 | true | true | 0 | 9 | 25 | 46 | 25 | 21 | null | null |
hsyl20/HViperVM | lib/ViperVM/Runtime/Logger.hs | lgpl-3.0 | -- | Thread safe logging
threadSafe :: (LogMsg -> IO ()) -> IO (LogMsg -> IO ())
threadSafe f = do
ch <- newBroadcastTChanIO
_ <- forkIO $ do
ch' <- atomically (dupTChan ch)
forever (atomically (readTChan ch') >>= f)
return (atomically . writeTChan ch) | 275 | threadSafe :: (LogMsg -> IO ()) -> IO (LogMsg -> IO ())
threadSafe f = do
ch <- newBroadcastTChanIO
_ <- forkIO $ do
ch' <- atomically (dupTChan ch)
forever (atomically (readTChan ch') >>= f)
return (atomically . writeTChan ch) | 250 | threadSafe f = do
ch <- newBroadcastTChanIO
_ <- forkIO $ do
ch' <- atomically (dupTChan ch)
forever (atomically (readTChan ch') >>= f)
return (atomically . writeTChan ch) | 194 | true | true | 0 | 16 | 67 | 118 | 55 | 63 | null | null |
ghorn/dynobud | dynobud/examples/Vec.hs | lgpl-3.0 | -- you do know the length at compile time
knownLength :: Num a => Vec 4 (Params a)
knownLength = devectorize unknownLength | 122 | knownLength :: Num a => Vec 4 (Params a)
knownLength = devectorize unknownLength | 80 | knownLength = devectorize unknownLength | 39 | true | true | 0 | 8 | 21 | 33 | 16 | 17 | null | null |
ciderpunx/project_euler_in_haskell | euler042.hs | gpl-2.0 | -- Given a character give its alphabetical number
alnum :: Char -> Int
alnum l =
ord l - 64 | 95 | alnum :: Char -> Int
alnum l =
ord l - 64 | 45 | alnum l =
ord l - 64 | 24 | true | true | 0 | 7 | 23 | 32 | 14 | 18 | null | null |
christiaanb/Idris-dev | src/IRTS/CodegenLLVM.hs | bsd-3-clause | cgOp LStrLen [s] = do
ns <- unbox FString s
len <- inst $ simpleCall "strlen" [ns]
ws <- getWordSize
len' <- case ws of
32 -> return len
x | x > 32 -> inst $ Trunc len (IntegerType 32) []
| x < 32 -> inst $ ZExt len (IntegerType 32) []
box (FArith (ATInt (ITFixed IT32))) len' | 324 | cgOp LStrLen [s] = do
ns <- unbox FString s
len <- inst $ simpleCall "strlen" [ns]
ws <- getWordSize
len' <- case ws of
32 -> return len
x | x > 32 -> inst $ Trunc len (IntegerType 32) []
| x < 32 -> inst $ ZExt len (IntegerType 32) []
box (FArith (ATInt (ITFixed IT32))) len' | 324 | cgOp LStrLen [s] = do
ns <- unbox FString s
len <- inst $ simpleCall "strlen" [ns]
ws <- getWordSize
len' <- case ws of
32 -> return len
x | x > 32 -> inst $ Trunc len (IntegerType 32) []
| x < 32 -> inst $ ZExt len (IntegerType 32) []
box (FArith (ATInt (ITFixed IT32))) len' | 324 | false | false | 0 | 15 | 107 | 165 | 76 | 89 | null | null |
wavewave/loopdiagram | src/HEP/Physics/LoopCalculation/Graph.hs | bsd-3-clause | conjugateKind NP_Qu = Just NP_Quc | 36 | conjugateKind NP_Qu = Just NP_Quc | 36 | conjugateKind NP_Qu = Just NP_Quc | 36 | false | false | 0 | 5 | 7 | 12 | 5 | 7 | null | null |
upsoft/bond | compiler/src/Language/Bond/Codegen/TypeMapping.hs | mit | -- | Returns the namespace for the 'MappingContext'. The namespace may be
-- different than specified in schema definition file if namespace mapping is
-- in effect.
getNamespace :: MappingContext -> QualifiedName
getNamespace c@MappingContext {..} = resolveNamespace c namespaces | 280 | getNamespace :: MappingContext -> QualifiedName
getNamespace c@MappingContext {..} = resolveNamespace c namespaces | 114 | getNamespace c@MappingContext {..} = resolveNamespace c namespaces | 66 | true | true | 3 | 5 | 38 | 36 | 20 | 16 | null | null |
suhailshergill/liboleg | Language/TEval/TInfLetP.hs | bsd-3-clause | lkup :: TEnv -> VarName -> TypS
lkup env x = maybe err id $ lookup x env
where err = error $ "Unbound variable " ++ x | 119 | lkup :: TEnv -> VarName -> TypS
lkup env x = maybe err id $ lookup x env
where err = error $ "Unbound variable " ++ x | 119 | lkup env x = maybe err id $ lookup x env
where err = error $ "Unbound variable " ++ x | 87 | false | true | 0 | 6 | 29 | 54 | 26 | 28 | null | null |
soupi/pureli | src/Language/Pureli/Module.hs | bsd-3-clause | filterListMap (a:as) list = case lookup a list of
Nothing -> Left $ "Could not find definition to expose: " ++ show a
Just x -> return . ((a,x):) =<< filterListMap as list
-- |
-- filter two assoc map from list | 216 | filterListMap (a:as) list = case lookup a list of
Nothing -> Left $ "Could not find definition to expose: " ++ show a
Just x -> return . ((a,x):) =<< filterListMap as list
-- |
-- filter two assoc map from list | 216 | filterListMap (a:as) list = case lookup a list of
Nothing -> Left $ "Could not find definition to expose: " ++ show a
Just x -> return . ((a,x):) =<< filterListMap as list
-- |
-- filter two assoc map from list | 216 | false | false | 5 | 7 | 47 | 83 | 41 | 42 | null | null |
romanlp/mines-haskell | tp/TP3.hs | mit | triangle :: [(Int,Int)]
triangle = [ (x,y) | x <- [1..4], y <- [1..4], x>=y ] | 77 | triangle :: [(Int,Int)]
triangle = [ (x,y) | x <- [1..4], y <- [1..4], x>=y ] | 77 | triangle = [ (x,y) | x <- [1..4], y <- [1..4], x>=y ] | 53 | false | true | 0 | 8 | 15 | 63 | 36 | 27 | null | null |
andrewthad/vinyl-vectors | src/Data/Vector/Vinyl/Default/NonEmpty/Tagged.hs | bsd-3-clause | -- Restricting memory usage
-- ------------------------
-- | /O(n)/ Yield the argument but force it not to retain any extra memory,
-- possibly by copying it.
--
-- This is especially useful when dealing with slices. For example:
--
-- > force (slice 0 2 <huge vector>)
--
-- Here, the slice retains a reference to the huge vector. Forcing it creates
-- a copy of just the elements that belong to the slice and allows the huge
-- vector to be garbage collected.
force :: G.Vector (Vector k) (Rec (TaggedFunctor Identity) rs)
=> (Vector k) (Rec (TaggedFunctor Identity) rs) -> (Vector k) (Rec (TaggedFunctor Identity) rs)
force = G.force | 639 | force :: G.Vector (Vector k) (Rec (TaggedFunctor Identity) rs)
=> (Vector k) (Rec (TaggedFunctor Identity) rs) -> (Vector k) (Rec (TaggedFunctor Identity) rs)
force = G.force | 176 | force = G.force | 15 | true | true | 0 | 12 | 112 | 112 | 59 | 53 | null | null |
taktoa/HsCalculator | src/Tests.hs | gpl-3.0 | showR :: Rational -> String
showR r = show (numerator r) ++ "%" ++ show (denominator r) | 87 | showR :: Rational -> String
showR r = show (numerator r) ++ "%" ++ show (denominator r) | 87 | showR r = show (numerator r) ++ "%" ++ show (denominator r) | 59 | false | true | 0 | 8 | 16 | 49 | 22 | 27 | null | null |
ComputationWithBoundedResources/ara-inference | src/Data/Rewriting/ARA/ByInferenceRules/Vector/Type.hs | mit | vectorLen Vector7{} = 7 | 23 | vectorLen Vector7{} = 7 | 23 | vectorLen Vector7{} = 7 | 23 | false | false | 1 | 5 | 3 | 16 | 6 | 10 | null | null |
NorfairKing/super-user-spark | src/SuperUserSpark/Bake/Internal.hs | mit | bakeDeployment :: RawDeployment -> SparkBaker BakedDeployment
bakeDeployment Deployment {..} = do
d <- bakeDirections deploymentDirections
pure Deployment {deploymentDirections = d, deploymentKind = deploymentKind} | 222 | bakeDeployment :: RawDeployment -> SparkBaker BakedDeployment
bakeDeployment Deployment {..} = do
d <- bakeDirections deploymentDirections
pure Deployment {deploymentDirections = d, deploymentKind = deploymentKind} | 222 | bakeDeployment Deployment {..} = do
d <- bakeDirections deploymentDirections
pure Deployment {deploymentDirections = d, deploymentKind = deploymentKind} | 160 | false | true | 0 | 10 | 30 | 62 | 29 | 33 | null | null |
shlevy/ghc | compiler/nativeGen/X86/CodeGen.hs | bsd-3-clause | mangleIndexTree :: DynFlags -> CmmReg -> Int -> CmmExpr
mangleIndexTree dflags reg off
= CmmMachOp (MO_Add width) [CmmReg reg, CmmLit (CmmInt (fromIntegral off) width)]
where width = typeWidth (cmmRegType dflags reg)
-- | The dual to getAnyReg: compute an expression into a register, but
-- we don't mind which one it is. | 331 | mangleIndexTree :: DynFlags -> CmmReg -> Int -> CmmExpr
mangleIndexTree dflags reg off
= CmmMachOp (MO_Add width) [CmmReg reg, CmmLit (CmmInt (fromIntegral off) width)]
where width = typeWidth (cmmRegType dflags reg)
-- | The dual to getAnyReg: compute an expression into a register, but
-- we don't mind which one it is. | 331 | mangleIndexTree dflags reg off
= CmmMachOp (MO_Add width) [CmmReg reg, CmmLit (CmmInt (fromIntegral off) width)]
where width = typeWidth (cmmRegType dflags reg)
-- | The dual to getAnyReg: compute an expression into a register, but
-- we don't mind which one it is. | 275 | false | true | 0 | 11 | 61 | 88 | 44 | 44 | null | null |
skogsbaer/HTF | Test/Framework/HUnitWrapper.hs | lgpl-2.1 | -- | Fail if the given @Either a b@ value is a 'Right'.
-- Use this function if @b@ is an instance of 'Show'.
assertLeft :: (HasCallStack, Show b) => Either a b -> IO a
assertLeft = assertLeft_ "assertLeft" "" | 209 | assertLeft :: (HasCallStack, Show b) => Either a b -> IO a
assertLeft = assertLeft_ "assertLeft" "" | 99 | assertLeft = assertLeft_ "assertLeft" "" | 40 | true | true | 0 | 8 | 40 | 48 | 23 | 25 | null | null |
leshchevds/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | dtExt :: String
dtExt = Types.diskTemplateToRaw DTExt | 53 | dtExt :: String
dtExt = Types.diskTemplateToRaw DTExt | 53 | dtExt = Types.diskTemplateToRaw DTExt | 37 | false | true | 0 | 6 | 6 | 22 | 9 | 13 | null | null |
dysinger/amazonka | amazonka-directconnect/gen/Network/AWS/DirectConnect/AllocatePrivateVirtualInterface.hs | mpl-2.0 | -- | Detailed information for the private virtual interface to be provisioned.
--
-- Default: None
apviNewPrivateVirtualInterfaceAllocation :: Lens' AllocatePrivateVirtualInterface NewPrivateVirtualInterfaceAllocation
apviNewPrivateVirtualInterfaceAllocation =
lens _apviNewPrivateVirtualInterfaceAllocation
(\s a -> s { _apviNewPrivateVirtualInterfaceAllocation = a }) | 381 | apviNewPrivateVirtualInterfaceAllocation :: Lens' AllocatePrivateVirtualInterface NewPrivateVirtualInterfaceAllocation
apviNewPrivateVirtualInterfaceAllocation =
lens _apviNewPrivateVirtualInterfaceAllocation
(\s a -> s { _apviNewPrivateVirtualInterfaceAllocation = a }) | 282 | apviNewPrivateVirtualInterfaceAllocation =
lens _apviNewPrivateVirtualInterfaceAllocation
(\s a -> s { _apviNewPrivateVirtualInterfaceAllocation = a }) | 163 | true | true | 0 | 9 | 45 | 42 | 24 | 18 | null | null |
tetigi/hlol | test/Main.hs | agpl-3.0 | testSummonerSpellsGet =
buildTest $ fmap (testCase "summonerSpellsGet" . assertRight) $ LolStaticData.getSummonerSpells | 123 | testSummonerSpellsGet =
buildTest $ fmap (testCase "summonerSpellsGet" . assertRight) $ LolStaticData.getSummonerSpells | 123 | testSummonerSpellsGet =
buildTest $ fmap (testCase "summonerSpellsGet" . assertRight) $ LolStaticData.getSummonerSpells | 123 | false | false | 3 | 8 | 14 | 34 | 14 | 20 | null | null |
acowley/ghc | compiler/typecheck/TcTypeNats.hs | bsd-3-clause | {-------------------------------------------------------------------------------
Built-in type constructors for functions on type-lelve nats
-}
typeNatTyCons :: [TyCon]
typeNatTyCons =
[ typeNatAddTyCon
, typeNatMulTyCon
, typeNatExpTyCon
, typeNatLeqTyCon
, typeNatSubTyCon
, typeNatCmpTyCon
, typeSymbolCmpTyCon
] | 332 | typeNatTyCons :: [TyCon]
typeNatTyCons =
[ typeNatAddTyCon
, typeNatMulTyCon
, typeNatExpTyCon
, typeNatLeqTyCon
, typeNatSubTyCon
, typeNatCmpTyCon
, typeSymbolCmpTyCon
] | 187 | typeNatTyCons =
[ typeNatAddTyCon
, typeNatMulTyCon
, typeNatExpTyCon
, typeNatLeqTyCon
, typeNatSubTyCon
, typeNatCmpTyCon
, typeSymbolCmpTyCon
] | 162 | true | true | 0 | 5 | 46 | 36 | 23 | 13 | null | null |
isovector/rpg-gen | src/RPG/Data/Gen/City.hs | bsd-3-clause | treeGen :: Some r => Eff r Prop
treeGen = do
color <- colorGen (0.2, 0.4) (0.5, 1.0) (0, 0.3)
width <- uniformIn (10, 30)
heightMod <- uniformIn (1.5, 3)
let height = width * heightMod
return . tagging (hasCollision .~ True)
. filled color
$ polygon origin [ rel 0 (-height / 2)
, rel (width / 2) (height / 2)
, rel (-width / 2) (height / 2)
] | 470 | treeGen :: Some r => Eff r Prop
treeGen = do
color <- colorGen (0.2, 0.4) (0.5, 1.0) (0, 0.3)
width <- uniformIn (10, 30)
heightMod <- uniformIn (1.5, 3)
let height = width * heightMod
return . tagging (hasCollision .~ True)
. filled color
$ polygon origin [ rel 0 (-height / 2)
, rel (width / 2) (height / 2)
, rel (-width / 2) (height / 2)
] | 470 | treeGen = do
color <- colorGen (0.2, 0.4) (0.5, 1.0) (0, 0.3)
width <- uniformIn (10, 30)
heightMod <- uniformIn (1.5, 3)
let height = width * heightMod
return . tagging (hasCollision .~ True)
. filled color
$ polygon origin [ rel 0 (-height / 2)
, rel (width / 2) (height / 2)
, rel (-width / 2) (height / 2)
] | 438 | false | true | 0 | 14 | 197 | 202 | 101 | 101 | null | null |
mrkkrp/stack | test/integration/lib/StackTest.hs | bsd-3-clause | doesNotExist :: FilePath -> IO ()
doesNotExist fp = do
logInfo $ "doesNotExist " ++ fp
exists <- doesFileOrDirExist fp
case exists of
(Right msg) -> error msg
(Left _) -> return () | 204 | doesNotExist :: FilePath -> IO ()
doesNotExist fp = do
logInfo $ "doesNotExist " ++ fp
exists <- doesFileOrDirExist fp
case exists of
(Right msg) -> error msg
(Left _) -> return () | 204 | doesNotExist fp = do
logInfo $ "doesNotExist " ++ fp
exists <- doesFileOrDirExist fp
case exists of
(Right msg) -> error msg
(Left _) -> return () | 170 | false | true | 0 | 12 | 56 | 88 | 39 | 49 | null | null |
rodrigogribeiro/mptc | src/BuiltIn/BuiltInTypes.hs | bsd-3-clause | -- integral constraint
integralconstr :: Type -> Asst
integralconstr v = ClassA (UnQual (Ident "Integral")) [v] | 112 | integralconstr :: Type -> Asst
integralconstr v = ClassA (UnQual (Ident "Integral")) [v] | 88 | integralconstr v = ClassA (UnQual (Ident "Integral")) [v] | 57 | true | true | 0 | 9 | 16 | 44 | 21 | 23 | null | null |
Tim-Tom/scratch | single-substitution-cipher/single-substitution.hs | unlicense | guess s c (choice:remain) cs solutions =
let
newSolutions = case checkConstraints (makeUnique s c choice) of
(True, constrained) -> (solveRec constrained cs solutions)
(False, _) -> solutions
in guess s c remain cs newSolutions | 247 | guess s c (choice:remain) cs solutions =
let
newSolutions = case checkConstraints (makeUnique s c choice) of
(True, constrained) -> (solveRec constrained cs solutions)
(False, _) -> solutions
in guess s c remain cs newSolutions | 247 | guess s c (choice:remain) cs solutions =
let
newSolutions = case checkConstraints (makeUnique s c choice) of
(True, constrained) -> (solveRec constrained cs solutions)
(False, _) -> solutions
in guess s c remain cs newSolutions | 247 | false | false | 0 | 13 | 54 | 97 | 49 | 48 | null | null |
jBugman/euler | part1/p009.hs | mit | thetriplet :: Int -> ReversedTriplet
thetriplet n = head $ filter pythagorean (possibleAddends n) | 97 | thetriplet :: Int -> ReversedTriplet
thetriplet n = head $ filter pythagorean (possibleAddends n) | 97 | thetriplet n = head $ filter pythagorean (possibleAddends n) | 60 | false | true | 0 | 8 | 13 | 33 | 16 | 17 | null | null |
cocreature/leksah | src/IDE/Session.hs | gpl-2.0 | applyLayout :: PaneLayout -> IDEAction
applyLayout layoutS = do
old <- getLayout
case old of
TerminalP {} -> applyLayout' layoutS []
otherwise -> throwIDE (__ "apply Layout can only be allied to empty Layout")
where
applyLayout' (TerminalP groups mbTabPos _ mbDetachedId mbDetachedSize) pp = do
forM_ (Map.keys groups) $ \group -> viewNest' pp group
nb <- getNotebook pp
case (mbDetachedId, mbDetachedSize) of
(Just id, Just (width, height)) -> do
mbPair <- viewDetach' pp id
case mbPair of
Nothing -> return ()
Just (win,wid) -> do
liftIO $ widgetShowAll win
liftIO $ windowSetDefaultSize win width height
_ -> return ()
liftIO $notebookSetShowTabs nb (isJust mbTabPos)
case mbTabPos of
Just p -> liftIO $notebookSetTabPos nb (paneDirectionToPosType p)
_ -> return ()
forM_ (Map.toAscList groups) $ \(group, g) ->
applyLayout' g (pp ++ [GroupP group])
applyLayout' (VerticalP l r pos) pp = do
viewSplit' pp Vertical
pane <- getPaned pp
liftIO $panedSetPosition pane pos
applyLayout' l (pp ++ [SplitP LeftP])
applyLayout' r (pp ++ [SplitP RightP])
applyLayout' (HorizontalP t b pos) pp = do
viewSplit' pp Horizontal
pane <- getPaned pp
liftIO $panedSetPosition pane pos
applyLayout' t (pp ++ [SplitP TopP])
applyLayout' b (pp ++ [SplitP BottomP]) | 1,636 | applyLayout :: PaneLayout -> IDEAction
applyLayout layoutS = do
old <- getLayout
case old of
TerminalP {} -> applyLayout' layoutS []
otherwise -> throwIDE (__ "apply Layout can only be allied to empty Layout")
where
applyLayout' (TerminalP groups mbTabPos _ mbDetachedId mbDetachedSize) pp = do
forM_ (Map.keys groups) $ \group -> viewNest' pp group
nb <- getNotebook pp
case (mbDetachedId, mbDetachedSize) of
(Just id, Just (width, height)) -> do
mbPair <- viewDetach' pp id
case mbPair of
Nothing -> return ()
Just (win,wid) -> do
liftIO $ widgetShowAll win
liftIO $ windowSetDefaultSize win width height
_ -> return ()
liftIO $notebookSetShowTabs nb (isJust mbTabPos)
case mbTabPos of
Just p -> liftIO $notebookSetTabPos nb (paneDirectionToPosType p)
_ -> return ()
forM_ (Map.toAscList groups) $ \(group, g) ->
applyLayout' g (pp ++ [GroupP group])
applyLayout' (VerticalP l r pos) pp = do
viewSplit' pp Vertical
pane <- getPaned pp
liftIO $panedSetPosition pane pos
applyLayout' l (pp ++ [SplitP LeftP])
applyLayout' r (pp ++ [SplitP RightP])
applyLayout' (HorizontalP t b pos) pp = do
viewSplit' pp Horizontal
pane <- getPaned pp
liftIO $panedSetPosition pane pos
applyLayout' t (pp ++ [SplitP TopP])
applyLayout' b (pp ++ [SplitP BottomP]) | 1,636 | applyLayout layoutS = do
old <- getLayout
case old of
TerminalP {} -> applyLayout' layoutS []
otherwise -> throwIDE (__ "apply Layout can only be allied to empty Layout")
where
applyLayout' (TerminalP groups mbTabPos _ mbDetachedId mbDetachedSize) pp = do
forM_ (Map.keys groups) $ \group -> viewNest' pp group
nb <- getNotebook pp
case (mbDetachedId, mbDetachedSize) of
(Just id, Just (width, height)) -> do
mbPair <- viewDetach' pp id
case mbPair of
Nothing -> return ()
Just (win,wid) -> do
liftIO $ widgetShowAll win
liftIO $ windowSetDefaultSize win width height
_ -> return ()
liftIO $notebookSetShowTabs nb (isJust mbTabPos)
case mbTabPos of
Just p -> liftIO $notebookSetTabPos nb (paneDirectionToPosType p)
_ -> return ()
forM_ (Map.toAscList groups) $ \(group, g) ->
applyLayout' g (pp ++ [GroupP group])
applyLayout' (VerticalP l r pos) pp = do
viewSplit' pp Vertical
pane <- getPaned pp
liftIO $panedSetPosition pane pos
applyLayout' l (pp ++ [SplitP LeftP])
applyLayout' r (pp ++ [SplitP RightP])
applyLayout' (HorizontalP t b pos) pp = do
viewSplit' pp Horizontal
pane <- getPaned pp
liftIO $panedSetPosition pane pos
applyLayout' t (pp ++ [SplitP TopP])
applyLayout' b (pp ++ [SplitP BottomP]) | 1,597 | false | true | 0 | 18 | 583 | 533 | 247 | 286 | null | null |
nwf/grade | lib/Grade/Parse.hs | bsd-2-clause | parseDingDefn :: (T.DeltaParsing f, T.LookAheadParsing f)
=> f (sdt,sds) -> f (DingName, sds, DingDefn sdt T.Caret)
parseDingDefn dl = do
(dcs, reuse) <- T.try ((,) <$> many (hashComment) <*> leadchar)
dn T.:^ c <- T.careted (DN <$> word)
(dm, ds) <- dl
-- XXX optional comment here?
dt <- untilDotLine
pure (dn, ds, DingDefn (DingMeta dm dt) c reuse dcs)
where
leadchar = T.choice [ T.char ':' *> pure False
, T.char ';' *> pure True
] | 509 | parseDingDefn :: (T.DeltaParsing f, T.LookAheadParsing f)
=> f (sdt,sds) -> f (DingName, sds, DingDefn sdt T.Caret)
parseDingDefn dl = do
(dcs, reuse) <- T.try ((,) <$> many (hashComment) <*> leadchar)
dn T.:^ c <- T.careted (DN <$> word)
(dm, ds) <- dl
-- XXX optional comment here?
dt <- untilDotLine
pure (dn, ds, DingDefn (DingMeta dm dt) c reuse dcs)
where
leadchar = T.choice [ T.char ':' *> pure False
, T.char ';' *> pure True
] | 509 | parseDingDefn dl = do
(dcs, reuse) <- T.try ((,) <$> many (hashComment) <*> leadchar)
dn T.:^ c <- T.careted (DN <$> word)
(dm, ds) <- dl
-- XXX optional comment here?
dt <- untilDotLine
pure (dn, ds, DingDefn (DingMeta dm dt) c reuse dcs)
where
leadchar = T.choice [ T.char ':' *> pure False
, T.char ';' *> pure True
] | 379 | false | true | 0 | 13 | 149 | 224 | 113 | 111 | null | null |
GaloisInc/ivory-tower-stm32 | ivory-bsp-stm32/src/Ivory/BSP/STM32F427/UART/DMA.hs | bsd-3-clause | dmaUART8 = DMAUART
{ dmaUARTPeriph = uart8
, dmaUARTDMAPeriph = dma1
, dmaUARTTxStream = DMAStream 0
, dmaUARTTxChannel = DMAChannel 5
, dmaUARTRxStream = DMAStream 6
, dmaUARTRxChannel = DMAChannel 5
} | 223 | dmaUART8 = DMAUART
{ dmaUARTPeriph = uart8
, dmaUARTDMAPeriph = dma1
, dmaUARTTxStream = DMAStream 0
, dmaUARTTxChannel = DMAChannel 5
, dmaUARTRxStream = DMAStream 6
, dmaUARTRxChannel = DMAChannel 5
} | 223 | dmaUART8 = DMAUART
{ dmaUARTPeriph = uart8
, dmaUARTDMAPeriph = dma1
, dmaUARTTxStream = DMAStream 0
, dmaUARTTxChannel = DMAChannel 5
, dmaUARTRxStream = DMAStream 6
, dmaUARTRxChannel = DMAChannel 5
} | 223 | false | false | 0 | 8 | 52 | 60 | 33 | 27 | null | null |
rahulmutt/ghcvm | compiler/Eta/Utils/UnVarGraph.hs | bsd-3-clause | k :: Var -> Int
k v = getKey (getUnique v) | 42 | k :: Var -> Int
k v = getKey (getUnique v) | 42 | k v = getKey (getUnique v) | 26 | false | true | 0 | 7 | 10 | 32 | 14 | 18 | null | null |
cryptica/slapnet | src/Parser/LOLAFormula.hs | gpl-3.0 | languageDef :: LanguageDef ()
languageDef =
emptyDef {
Token.commentStart = "{",
Token.commentEnd = "}",
Token.commentLine = "",
Token.identStart = noneOf ",;:(){}\t \n\r0123456789-",
Token.identLetter = noneOf ",;:(){}\t \n\r",
Token.reservedNames = ["FORMULA", "TRUE", "FALSE",
"NOT", "AND", "OR"],
Token.reservedOpNames = ["<", "<=", "=", "!=", ">=", ">",
"+", "-", "*"]
} | 626 | languageDef :: LanguageDef ()
languageDef =
emptyDef {
Token.commentStart = "{",
Token.commentEnd = "}",
Token.commentLine = "",
Token.identStart = noneOf ",;:(){}\t \n\r0123456789-",
Token.identLetter = noneOf ",;:(){}\t \n\r",
Token.reservedNames = ["FORMULA", "TRUE", "FALSE",
"NOT", "AND", "OR"],
Token.reservedOpNames = ["<", "<=", "=", "!=", ">=", ">",
"+", "-", "*"]
} | 626 | languageDef =
emptyDef {
Token.commentStart = "{",
Token.commentEnd = "}",
Token.commentLine = "",
Token.identStart = noneOf ",;:(){}\t \n\r0123456789-",
Token.identLetter = noneOf ",;:(){}\t \n\r",
Token.reservedNames = ["FORMULA", "TRUE", "FALSE",
"NOT", "AND", "OR"],
Token.reservedOpNames = ["<", "<=", "=", "!=", ">=", ">",
"+", "-", "*"]
} | 596 | false | true | 1 | 8 | 297 | 132 | 77 | 55 | null | null |
k0001/haskell-money | safe-money-aeson/test/Main.hs | bsd-3-clause | rawDis0_aeson :: BL.ByteString
rawDis0_aeson = "[\"USD\",100,1,4]" | 66 | rawDis0_aeson :: BL.ByteString
rawDis0_aeson = "[\"USD\",100,1,4]" | 66 | rawDis0_aeson = "[\"USD\",100,1,4]" | 35 | false | true | 0 | 5 | 5 | 13 | 7 | 6 | null | null |
zachsully/hakaru | haskell/Language/Hakaru/Parser/Maple.hs | bsd-3-clause | maple2AST (InertArgs Func
[InertName "NegativeBinomial", InertArgs ExpSeq [e1, e2]]) =
Bind "i" (op2 "gamma" r (recip_ $ recip_ p -. (lit $ Prob 1)))
(App (Var "poisson") (Var "i"))
where recip_ = App (Var "recip")
x -. y = NaryOp Sum [x, App (Var "negate") y]
op2 s x y = App (App (Var s) x) y
lit = ULiteral
r = maple2AST e1
p = maple2AST e2 | 452 | maple2AST (InertArgs Func
[InertName "NegativeBinomial", InertArgs ExpSeq [e1, e2]]) =
Bind "i" (op2 "gamma" r (recip_ $ recip_ p -. (lit $ Prob 1)))
(App (Var "poisson") (Var "i"))
where recip_ = App (Var "recip")
x -. y = NaryOp Sum [x, App (Var "negate") y]
op2 s x y = App (App (Var s) x) y
lit = ULiteral
r = maple2AST e1
p = maple2AST e2 | 452 | maple2AST (InertArgs Func
[InertName "NegativeBinomial", InertArgs ExpSeq [e1, e2]]) =
Bind "i" (op2 "gamma" r (recip_ $ recip_ p -. (lit $ Prob 1)))
(App (Var "poisson") (Var "i"))
where recip_ = App (Var "recip")
x -. y = NaryOp Sum [x, App (Var "negate") y]
op2 s x y = App (App (Var s) x) y
lit = ULiteral
r = maple2AST e1
p = maple2AST e2 | 452 | false | false | 5 | 12 | 176 | 199 | 99 | 100 | null | null |
charlesrosenbauer/Bzo-Compiler | backendTest/Backend.hs | gpl-3.0 | printFunc x = "F" ++ (show x) | 29 | printFunc x = "F" ++ (show x) | 29 | printFunc x = "F" ++ (show x) | 29 | false | false | 0 | 7 | 6 | 19 | 9 | 10 | null | null |
fthomas/ohloh-hs | Web/Ohloh/StackEntry.hs | bsd-3-clause | xpStackEntry :: PU StackEntry
xpStackEntry =
xpElem "stack_entry" $
xpWrap (uncurry5 StackEntry,
\(StackEntry i si pi ca p) ->
(i, si, pi, ca, p)) $
xp5Tuple (xpElem "id" xpText0)
(xpElem "stack_id" xpText0)
(xpElem "project_id" xpText0)
(xpElem "created_at" xpText0)
(xpOption xpProject) | 390 | xpStackEntry :: PU StackEntry
xpStackEntry =
xpElem "stack_entry" $
xpWrap (uncurry5 StackEntry,
\(StackEntry i si pi ca p) ->
(i, si, pi, ca, p)) $
xp5Tuple (xpElem "id" xpText0)
(xpElem "stack_id" xpText0)
(xpElem "project_id" xpText0)
(xpElem "created_at" xpText0)
(xpOption xpProject) | 390 | xpStackEntry =
xpElem "stack_entry" $
xpWrap (uncurry5 StackEntry,
\(StackEntry i si pi ca p) ->
(i, si, pi, ca, p)) $
xp5Tuple (xpElem "id" xpText0)
(xpElem "stack_id" xpText0)
(xpElem "project_id" xpText0)
(xpElem "created_at" xpText0)
(xpOption xpProject) | 360 | false | true | 1 | 9 | 141 | 128 | 62 | 66 | null | null |
ndmitchell/shake | src/General/GetOpt.hs | bsd-3-clause | getOpt :: [OptDescr (Either String a)] -> [String] -> ([a], [String], [String])
getOpt opts args = (flagGood, files, flagBad ++ errs)
where (flags, files, errs) = O.getOpt O.Permute opts args
(flagBad, flagGood) = partitionEithers flags | 250 | getOpt :: [OptDescr (Either String a)] -> [String] -> ([a], [String], [String])
getOpt opts args = (flagGood, files, flagBad ++ errs)
where (flags, files, errs) = O.getOpt O.Permute opts args
(flagBad, flagGood) = partitionEithers flags | 250 | getOpt opts args = (flagGood, files, flagBad ++ errs)
where (flags, files, errs) = O.getOpt O.Permute opts args
(flagBad, flagGood) = partitionEithers flags | 170 | false | true | 0 | 9 | 48 | 115 | 64 | 51 | null | null |
mightybyte/reflex-dom-stubs | src/GHCJS/DOM/HTMLSelectElement.hs | bsd-3-clause | ghcjs_dom_html_select_element_remove = undefined | 48 | ghcjs_dom_html_select_element_remove = undefined | 48 | ghcjs_dom_html_select_element_remove = undefined | 48 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
snoyberg/ghc | compiler/main/ErrUtils.hs | bsd-3-clause | ghcExit :: DynFlags -> Int -> IO ()
ghcExit dflags val
| val == 0 = exitWith ExitSuccess
| otherwise = do errorMsg dflags (text "\nCompilation had errors\n\n")
exitWith (ExitFailure val) | 210 | ghcExit :: DynFlags -> Int -> IO ()
ghcExit dflags val
| val == 0 = exitWith ExitSuccess
| otherwise = do errorMsg dflags (text "\nCompilation had errors\n\n")
exitWith (ExitFailure val) | 210 | ghcExit dflags val
| val == 0 = exitWith ExitSuccess
| otherwise = do errorMsg dflags (text "\nCompilation had errors\n\n")
exitWith (ExitFailure val) | 174 | false | true | 0 | 11 | 54 | 84 | 36 | 48 | null | null |
gnn/Hets | OWL2/Profiles.hs | gpl-2.0 | lFB :: Extended -> Maybe Relation -> ListFrameBit -> Profiles
lFB ext mr lfb = case lfb of
AnnotationBit anl -> annotations $ concatMap fst anl
ExpressionBit anl ->
let ans = annotations $ concatMap fst anl
cel = map snd anl
r = fromMaybe (error "relation needed") mr
in case ext of
Misc anno -> andProfileList [ans, annotations anno,
bottomProfile {
el = el $ andList subClass cel,
ql = ql $ andList subClass cel,
rl = all equivClassRL cel
}]
ClassEntity c -> case r of
SubClass -> andProfileList [ans, subClass c,
andList superClass cel]
_ -> andProfileList [ans, bottomProfile {
el = el $ andList subClass $ c : cel,
ql = ql $ andList subClass $ c : cel,
rl = all equivClassRL $ c : cel
}]
ObjectEntity op -> andProfileList [ans, objProp op,
andList superClass cel]
SimpleEntity (Entity _ ty ent) -> case ty of
DataProperty -> andProfileList [ans, andList superClass cel]
NamedIndividual -> andProfileList [ans, individual ent,
bottomProfile {
el = el $ andList superClass cel,
ql = all assertionQL cel,
rl = rl $ andList superClass cel
}]
_ -> error "invalid expression bit"
ObjectBit anl ->
let ans = annotations $ concatMap fst anl
opl = andList objProp $ map snd anl
r = fromMaybe (error "relation needed") mr
in case ext of
Misc anno -> andProfileList [ans, annotations anno, opl, case r of
EDRelation Equivalent -> topProfile
_ -> qlrlProfile]
ObjectEntity op -> andProfileList [ans, opl, objProp op, case r of
SubPropertyOf -> topProfile
EDRelation Equivalent -> topProfile
_ -> qlrlProfile]
_ -> error "invalit object bit"
DataBit anl ->
let ans = annotations $ concatMap fst anl
r = fromMaybe (error "relation needed") mr
in case ext of
Misc anno -> andProfileList [ans, annotations anno, case r of
EDRelation Equivalent -> topProfile
_ -> qlrlProfile]
_ -> andProfileList [ans, case r of
SubPropertyOf -> topProfile
EDRelation Equivalent -> topProfile
_ -> qlrlProfile]
IndividualSameOrDifferent anl ->
let ans = annotations $ concatMap fst anl
r = fromMaybe (error "relation needed") mr
i = andList individual $ map snd anl
in case ext of
Misc anno -> andProfileList [ans, annotations anno, i, case r of
SDRelation Different -> topProfile
_ -> elrlProfile]
SimpleEntity (Entity _ _ ind) -> andProfileList [ans, individual ind,
i, case r of
SDRelation Different -> topProfile
_ -> elrlProfile]
_ -> error "bad individual bit"
ObjectCharacteristics anl ->
let ans = annotations $ concatMap fst anl
cl = map snd anl
in case ext of
ObjectEntity op -> andProfileList [ans, objProp op,
bottomProfile {
el = char cl [Reflexive, Transitive],
ql = char cl [Reflexive, Symmetric, Asymmetric],
rl = char cl [Functional, InverseFunctional,
Irreflexive, Symmetric, Asymmetric, Transitive]
}]
_ -> error "object entity needed"
DataPropRange anl ->
let ans = annotations $ concatMap fst anl
dr = andList dataRange $ map snd anl
in andProfileList [ans, dr]
IndividualFacts anl ->
let ans = annotations $ concatMap fst anl
facts = andList fact $ map snd anl
in case ext of
SimpleEntity (Entity _ _ i) ->
andProfileList [ans, facts, individual i]
_ -> error "bad fact bit" | 4,340 | lFB :: Extended -> Maybe Relation -> ListFrameBit -> Profiles
lFB ext mr lfb = case lfb of
AnnotationBit anl -> annotations $ concatMap fst anl
ExpressionBit anl ->
let ans = annotations $ concatMap fst anl
cel = map snd anl
r = fromMaybe (error "relation needed") mr
in case ext of
Misc anno -> andProfileList [ans, annotations anno,
bottomProfile {
el = el $ andList subClass cel,
ql = ql $ andList subClass cel,
rl = all equivClassRL cel
}]
ClassEntity c -> case r of
SubClass -> andProfileList [ans, subClass c,
andList superClass cel]
_ -> andProfileList [ans, bottomProfile {
el = el $ andList subClass $ c : cel,
ql = ql $ andList subClass $ c : cel,
rl = all equivClassRL $ c : cel
}]
ObjectEntity op -> andProfileList [ans, objProp op,
andList superClass cel]
SimpleEntity (Entity _ ty ent) -> case ty of
DataProperty -> andProfileList [ans, andList superClass cel]
NamedIndividual -> andProfileList [ans, individual ent,
bottomProfile {
el = el $ andList superClass cel,
ql = all assertionQL cel,
rl = rl $ andList superClass cel
}]
_ -> error "invalid expression bit"
ObjectBit anl ->
let ans = annotations $ concatMap fst anl
opl = andList objProp $ map snd anl
r = fromMaybe (error "relation needed") mr
in case ext of
Misc anno -> andProfileList [ans, annotations anno, opl, case r of
EDRelation Equivalent -> topProfile
_ -> qlrlProfile]
ObjectEntity op -> andProfileList [ans, opl, objProp op, case r of
SubPropertyOf -> topProfile
EDRelation Equivalent -> topProfile
_ -> qlrlProfile]
_ -> error "invalit object bit"
DataBit anl ->
let ans = annotations $ concatMap fst anl
r = fromMaybe (error "relation needed") mr
in case ext of
Misc anno -> andProfileList [ans, annotations anno, case r of
EDRelation Equivalent -> topProfile
_ -> qlrlProfile]
_ -> andProfileList [ans, case r of
SubPropertyOf -> topProfile
EDRelation Equivalent -> topProfile
_ -> qlrlProfile]
IndividualSameOrDifferent anl ->
let ans = annotations $ concatMap fst anl
r = fromMaybe (error "relation needed") mr
i = andList individual $ map snd anl
in case ext of
Misc anno -> andProfileList [ans, annotations anno, i, case r of
SDRelation Different -> topProfile
_ -> elrlProfile]
SimpleEntity (Entity _ _ ind) -> andProfileList [ans, individual ind,
i, case r of
SDRelation Different -> topProfile
_ -> elrlProfile]
_ -> error "bad individual bit"
ObjectCharacteristics anl ->
let ans = annotations $ concatMap fst anl
cl = map snd anl
in case ext of
ObjectEntity op -> andProfileList [ans, objProp op,
bottomProfile {
el = char cl [Reflexive, Transitive],
ql = char cl [Reflexive, Symmetric, Asymmetric],
rl = char cl [Functional, InverseFunctional,
Irreflexive, Symmetric, Asymmetric, Transitive]
}]
_ -> error "object entity needed"
DataPropRange anl ->
let ans = annotations $ concatMap fst anl
dr = andList dataRange $ map snd anl
in andProfileList [ans, dr]
IndividualFacts anl ->
let ans = annotations $ concatMap fst anl
facts = andList fact $ map snd anl
in case ext of
SimpleEntity (Entity _ _ i) ->
andProfileList [ans, facts, individual i]
_ -> error "bad fact bit" | 4,340 | lFB ext mr lfb = case lfb of
AnnotationBit anl -> annotations $ concatMap fst anl
ExpressionBit anl ->
let ans = annotations $ concatMap fst anl
cel = map snd anl
r = fromMaybe (error "relation needed") mr
in case ext of
Misc anno -> andProfileList [ans, annotations anno,
bottomProfile {
el = el $ andList subClass cel,
ql = ql $ andList subClass cel,
rl = all equivClassRL cel
}]
ClassEntity c -> case r of
SubClass -> andProfileList [ans, subClass c,
andList superClass cel]
_ -> andProfileList [ans, bottomProfile {
el = el $ andList subClass $ c : cel,
ql = ql $ andList subClass $ c : cel,
rl = all equivClassRL $ c : cel
}]
ObjectEntity op -> andProfileList [ans, objProp op,
andList superClass cel]
SimpleEntity (Entity _ ty ent) -> case ty of
DataProperty -> andProfileList [ans, andList superClass cel]
NamedIndividual -> andProfileList [ans, individual ent,
bottomProfile {
el = el $ andList superClass cel,
ql = all assertionQL cel,
rl = rl $ andList superClass cel
}]
_ -> error "invalid expression bit"
ObjectBit anl ->
let ans = annotations $ concatMap fst anl
opl = andList objProp $ map snd anl
r = fromMaybe (error "relation needed") mr
in case ext of
Misc anno -> andProfileList [ans, annotations anno, opl, case r of
EDRelation Equivalent -> topProfile
_ -> qlrlProfile]
ObjectEntity op -> andProfileList [ans, opl, objProp op, case r of
SubPropertyOf -> topProfile
EDRelation Equivalent -> topProfile
_ -> qlrlProfile]
_ -> error "invalit object bit"
DataBit anl ->
let ans = annotations $ concatMap fst anl
r = fromMaybe (error "relation needed") mr
in case ext of
Misc anno -> andProfileList [ans, annotations anno, case r of
EDRelation Equivalent -> topProfile
_ -> qlrlProfile]
_ -> andProfileList [ans, case r of
SubPropertyOf -> topProfile
EDRelation Equivalent -> topProfile
_ -> qlrlProfile]
IndividualSameOrDifferent anl ->
let ans = annotations $ concatMap fst anl
r = fromMaybe (error "relation needed") mr
i = andList individual $ map snd anl
in case ext of
Misc anno -> andProfileList [ans, annotations anno, i, case r of
SDRelation Different -> topProfile
_ -> elrlProfile]
SimpleEntity (Entity _ _ ind) -> andProfileList [ans, individual ind,
i, case r of
SDRelation Different -> topProfile
_ -> elrlProfile]
_ -> error "bad individual bit"
ObjectCharacteristics anl ->
let ans = annotations $ concatMap fst anl
cl = map snd anl
in case ext of
ObjectEntity op -> andProfileList [ans, objProp op,
bottomProfile {
el = char cl [Reflexive, Transitive],
ql = char cl [Reflexive, Symmetric, Asymmetric],
rl = char cl [Functional, InverseFunctional,
Irreflexive, Symmetric, Asymmetric, Transitive]
}]
_ -> error "object entity needed"
DataPropRange anl ->
let ans = annotations $ concatMap fst anl
dr = andList dataRange $ map snd anl
in andProfileList [ans, dr]
IndividualFacts anl ->
let ans = annotations $ concatMap fst anl
facts = andList fact $ map snd anl
in case ext of
SimpleEntity (Entity _ _ i) ->
andProfileList [ans, facts, individual i]
_ -> error "bad fact bit" | 4,278 | false | true | 5 | 20 | 1,791 | 1,210 | 600 | 610 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.