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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sol/uu-parsinglib | src/Text/ParserCombinators/UU/Demo/Examples.hs | mit | justamessage = "justamessage" | 29 | justamessage = "justamessage" | 29 | justamessage = "justamessage" | 29 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
skill-lang/skill | deps/haskell/WriteFields.hs | bsd-3-clause | p'f'd ((GSet v) : r_d) = p'v64 (length r_d + 1) >> mapM_ (\(GSet v) -> p'f'd v) ((GSet v) : r_d) | 99 | p'f'd ((GSet v) : r_d) = p'v64 (length r_d + 1) >> mapM_ (\(GSet v) -> p'f'd v) ((GSet v) : r_d) | 99 | p'f'd ((GSet v) : r_d) = p'v64 (length r_d + 1) >> mapM_ (\(GSet v) -> p'f'd v) ((GSet v) : r_d) | 99 | false | false | 0 | 10 | 24 | 74 | 37 | 37 | null | null |
LTI2000/hinterface | src/Foreign/Erlang/LocalNode.hs | bsd-3-clause | askLocalNode :: Monad m => NodeT m LocalNode
askLocalNode = NodeT (asks localNode) | 82 | askLocalNode :: Monad m => NodeT m LocalNode
askLocalNode = NodeT (asks localNode) | 82 | askLocalNode = NodeT (asks localNode) | 37 | false | true | 0 | 7 | 12 | 32 | 15 | 17 | null | null |
akegalj/snowdrift | dev/Sdm.hs | agpl-3.0 | ifExists :: DBType a => a -> PgAction () -> PgAction ()
ifExists dbType as = do
exists <- doesDBExist dbType
if | exists -> as
| otherwise ->
liftIO $ leaveLn $ mconcat ["'"
,toString dbType
,"' does not exist; doin... | 331 | ifExists :: DBType a => a -> PgAction () -> PgAction ()
ifExists dbType as = do
exists <- doesDBExist dbType
if | exists -> as
| otherwise ->
liftIO $ leaveLn $ mconcat ["'"
,toString dbType
,"' does not exist; doin... | 331 | ifExists dbType as = do
exists <- doesDBExist dbType
if | exists -> as
| otherwise ->
liftIO $ leaveLn $ mconcat ["'"
,toString dbType
,"' does not exist; doing nothing"] | 275 | false | true | 0 | 12 | 147 | 95 | 44 | 51 | null | null |
kazu-yamamoto/simple-sendfile | Network/Sendfile/Fallback.hs | bsd-3-clause | -- |
-- Sendfile emulation using conduit.
-- Used system calls:
--
-- - Used system calls: open(), stat(), read(), writev(), send() and close().
sendfileWithHeader :: Socket -> FilePath -> FileRange -> IO () -> [ByteString] -> IO ()
sendfileWithHeader sock path range hook hdr = do
sendMany sock hdr
sendfile s... | 339 | sendfileWithHeader :: Socket -> FilePath -> FileRange -> IO () -> [ByteString] -> IO ()
sendfileWithHeader sock path range hook hdr = do
sendMany sock hdr
sendfile sock path range hook | 192 | sendfileWithHeader sock path range hook hdr = do
sendMany sock hdr
sendfile sock path range hook | 104 | true | true | 0 | 11 | 64 | 80 | 40 | 40 | null | null |
berufsnerd/haskell-tcp-calculation-server | src/Protocol.hs | gpl-3.0 | execQuery state (Auth u p)
= case auth newstate of
Unauthicated -> return (newstate, Error PermissionError)
Authenticated _ -> return (newstate, Okay)
where
newstate = authUser dic u p state
dic = insert "user" "pass" empty | 269 | execQuery state (Auth u p)
= case auth newstate of
Unauthicated -> return (newstate, Error PermissionError)
Authenticated _ -> return (newstate, Okay)
where
newstate = authUser dic u p state
dic = insert "user" "pass" empty | 269 | execQuery state (Auth u p)
= case auth newstate of
Unauthicated -> return (newstate, Error PermissionError)
Authenticated _ -> return (newstate, Okay)
where
newstate = authUser dic u p state
dic = insert "user" "pass" empty | 269 | false | false | 0 | 10 | 81 | 90 | 44 | 46 | null | null |
wxwxwwxxx/ghc | compiler/coreSyn/CoreFVs.hs | bsd-3-clause | delBindersFV :: [Var] -> VarSet -> VarSet
delBindersFV bs fvs = foldr delBinderFV fvs bs | 88 | delBindersFV :: [Var] -> VarSet -> VarSet
delBindersFV bs fvs = foldr delBinderFV fvs bs | 88 | delBindersFV bs fvs = foldr delBinderFV fvs bs | 46 | false | true | 0 | 6 | 14 | 38 | 18 | 20 | null | null |
ocean0yohsuke/Simply-Typed-Lambda | src/Lambda/Evaluator/Prelude.hs | bsd-3-clause | compareOpr :: Name -> (Integer -> Integer -> Bool) -> Term -> Lambda Term
compareOpr name opr t = (*:) $ AFUNC ("("++ show t ++ name ++")") $ f t
where
f :: Term -> Term -> Lambda Term
f (INT n1 _) (INT n2 _) = (*:) $ bool (n1 `opr` n2) | 246 | compareOpr :: Name -> (Integer -> Integer -> Bool) -> Term -> Lambda Term
compareOpr name opr t = (*:) $ AFUNC ("("++ show t ++ name ++")") $ f t
where
f :: Term -> Term -> Lambda Term
f (INT n1 _) (INT n2 _) = (*:) $ bool (n1 `opr` n2) | 246 | compareOpr name opr t = (*:) $ AFUNC ("("++ show t ++ name ++")") $ f t
where
f :: Term -> Term -> Lambda Term
f (INT n1 _) (INT n2 _) = (*:) $ bool (n1 `opr` n2) | 172 | false | true | 3 | 12 | 63 | 140 | 72 | 68 | null | null |
oldmanmike/ghc | compiler/iface/IfaceType.hs | bsd-3-clause | isIfaceInvisBndr :: IfaceTyConBinder -> Bool
isIfaceInvisBndr (IfaceNamed (IfaceTv _ Invisible)) = True | 103 | isIfaceInvisBndr :: IfaceTyConBinder -> Bool
isIfaceInvisBndr (IfaceNamed (IfaceTv _ Invisible)) = True | 103 | isIfaceInvisBndr (IfaceNamed (IfaceTv _ Invisible)) = True | 58 | false | true | 0 | 9 | 11 | 32 | 16 | 16 | null | null |
ekmett/ansi-terminal | System/Console/ANSI/Unix.hs | bsd-3-clause | cursorDownCode n = csi [n] "B" | 30 | cursorDownCode n = csi [n] "B" | 30 | cursorDownCode n = csi [n] "B" | 30 | false | false | 1 | 6 | 5 | 21 | 8 | 13 | null | null |
mettekou/ghc | libraries/base/Data/List/NonEmpty.hs | bsd-3-clause | -- | Convert a stream to a normal list efficiently.
toList :: NonEmpty a -> [a]
toList ~(a :| as) = a : as | 106 | toList :: NonEmpty a -> [a]
toList ~(a :| as) = a : as | 54 | toList ~(a :| as) = a : as | 26 | true | true | 0 | 8 | 23 | 37 | 19 | 18 | null | null |
anttisalonen/freekick | haskell/libfreekick/Freekick/Libsoccer/TournamentInstance.hs | agpl-3.0 | addClubs' s [] = s | 40 | addClubs' s [] = s | 40 | addClubs' s [] = s | 40 | false | false | 0 | 6 | 26 | 13 | 6 | 7 | null | null |
wochinge/CacheSimulator | src/BeladyCache.hs | bsd-3-clause | alter' :: FileRequest -> FilePrio -> Maybe (FilePrio, S.Seq OtherRequest) -> (Empty, Maybe (FilePrio, S.Seq OtherRequest))
alter' (Read, _, _) prio Nothing = (Empty, Just (prio, S.empty)) | 187 | alter' :: FileRequest -> FilePrio -> Maybe (FilePrio, S.Seq OtherRequest) -> (Empty, Maybe (FilePrio, S.Seq OtherRequest))
alter' (Read, _, _) prio Nothing = (Empty, Just (prio, S.empty)) | 187 | alter' (Read, _, _) prio Nothing = (Empty, Just (prio, S.empty)) | 64 | false | true | 0 | 14 | 26 | 96 | 50 | 46 | null | null |
Chobbes/Juicy.Pixels | src/Codec/Picture/Saving.hs | bsd-3-clause | from16toFloat :: ( PixelBaseComponent source ~ Word16
, PixelBaseComponent dest ~ Float )
=> Image source -> Image dest
from16toFloat Image { imageWidth = w, imageHeight = h
, imageData = arr } = Image w h transformed
where transformed = V.map toWord8 arr
toWor... | 519 | from16toFloat :: ( PixelBaseComponent source ~ Word16
, PixelBaseComponent dest ~ Float )
=> Image source -> Image dest
from16toFloat Image { imageWidth = w, imageHeight = h
, imageData = arr } = Image w h transformed
where transformed = V.map toWord8 arr
toWor... | 519 | from16toFloat Image { imageWidth = w, imageHeight = h
, imageData = arr } = Image w h transformed
where transformed = V.map toWord8 arr
toWord8 v = fromIntegral v / 65536.0
-- | This function will try to do anything to encode an image
-- as RADIANCE, make all color conversion and such. ... | 372 | false | true | 0 | 8 | 139 | 109 | 56 | 53 | null | null |
kim/amazonka | amazonka-elasticbeanstalk/gen/Network/AWS/ElasticBeanstalk/DescribeApplications.hs | mpl-2.0 | describeApplicationsResponse :: DescribeApplicationsResponse
describeApplicationsResponse = DescribeApplicationsResponse
{ _darApplications = mempty
} | 158 | describeApplicationsResponse :: DescribeApplicationsResponse
describeApplicationsResponse = DescribeApplicationsResponse
{ _darApplications = mempty
} | 158 | describeApplicationsResponse = DescribeApplicationsResponse
{ _darApplications = mempty
} | 97 | false | true | 0 | 6 | 18 | 19 | 11 | 8 | null | null |
zepto-lang/zepto | src/Zepto/Macro.hs | gpl-2.0 | transformRule :: Env -> Int -> LispVal -> LispVal -> LispVal -> IOThrowsError LispVal
transformRule localEnv ellipsisIndex (List result) transform@(List (List l : ts)) (List ellipsisList) =
if macroElementMatchesMany transform
then do
curT <- transformRule localEnv (ellipsisIndex + 1) (List []) (Lis... | 1,451 | transformRule :: Env -> Int -> LispVal -> LispVal -> LispVal -> IOThrowsError LispVal
transformRule localEnv ellipsisIndex (List result) transform@(List (List l : ts)) (List ellipsisList) =
if macroElementMatchesMany transform
then do
curT <- transformRule localEnv (ellipsisIndex + 1) (List []) (Lis... | 1,451 | transformRule localEnv ellipsisIndex (List result) transform@(List (List l : ts)) (List ellipsisList) =
if macroElementMatchesMany transform
then do
curT <- transformRule localEnv (ellipsisIndex + 1) (List []) (List l) (List result)
case curT of
SimpleVal (Nil _) -> if el... | 1,365 | false | true | 0 | 16 | 439 | 546 | 268 | 278 | null | null |
HaskellForCats/HaskellForCats | ladiesWhoCodeHaskell/ladiesWhoCodeHaskell004.hs | mit | -- import ladiesWhoCodeHaskell000
----------------
-- tuples --
---------------
-- tuples are the inverse of lists
-- they are bounded, they can have heterogeneous members.
-- the are great for key-value pairs
-- they are a way to get back multiple parameters from a function
headAndLength x = (head x,length x) | 315 | headAndLength x = (head x,length x) | 35 | headAndLength x = (head x,length x) | 35 | true | false | 1 | 7 | 53 | 33 | 18 | 15 | null | null |
ksaveljev/hake-2 | src/Constants.hs | bsd-3-clause | csMapChecksum = 31 :: Int | 25 | csMapChecksum = 31 :: Int | 25 | csMapChecksum = 31 :: Int | 25 | false | false | 0 | 4 | 4 | 9 | 5 | 4 | null | null |
bkoropoff/Idris-dev | src/Idris/ElabQuasiquote.hs | bsd-3-clause | extractUnquotes n (PAppBind fc f args)
= do (f', ex1) <- extractUnquotes n f
args' <- mapM (extractPArgUnquotes n) args
let (args'', exs) = unzip args'
return (PAppBind fc f' args'', ex1 ++ concat exs) | 224 | extractUnquotes n (PAppBind fc f args)
= do (f', ex1) <- extractUnquotes n f
args' <- mapM (extractPArgUnquotes n) args
let (args'', exs) = unzip args'
return (PAppBind fc f' args'', ex1 ++ concat exs) | 224 | extractUnquotes n (PAppBind fc f args)
= do (f', ex1) <- extractUnquotes n f
args' <- mapM (extractPArgUnquotes n) args
let (args'', exs) = unzip args'
return (PAppBind fc f' args'', ex1 ++ concat exs) | 224 | false | false | 0 | 10 | 57 | 104 | 48 | 56 | null | null |
urbanslug/ghc | compiler/hsSyn/HsTypes.hs | bsd-3-clause | ---------------------
mkAnonWildCardTy :: HsType RdrName
mkAnonWildCardTy = HsWildCardTy (AnonWildCard PlaceHolder) | 115 | mkAnonWildCardTy :: HsType RdrName
mkAnonWildCardTy = HsWildCardTy (AnonWildCard PlaceHolder) | 93 | mkAnonWildCardTy = HsWildCardTy (AnonWildCard PlaceHolder) | 58 | true | true | 1 | 7 | 9 | 27 | 12 | 15 | null | null |
jgoerzen/missingpy | testsrc/Objectstest.hs | gpl-2.0 | test_base =
[
f "showPyObject" (5::CInt) showPyObject "<type 'int'>: 5"
] | 86 | test_base =
[
f "showPyObject" (5::CInt) showPyObject "<type 'int'>: 5"
] | 86 | test_base =
[
f "showPyObject" (5::CInt) showPyObject "<type 'int'>: 5"
] | 86 | false | false | 1 | 8 | 23 | 28 | 13 | 15 | null | null |
alexvong1995/pandoc | src/Text/Pandoc/Pretty.hs | gpl-2.0 | -- | Wraps a 'Doc' in single quotes.
quotes :: Doc -> Doc
quotes = inside (char '\'') (char '\'') | 97 | quotes :: Doc -> Doc
quotes = inside (char '\'') (char '\'') | 60 | quotes = inside (char '\'') (char '\'') | 39 | true | true | 0 | 7 | 19 | 40 | 18 | 22 | null | null |
beni55/pwsafe | test/CipherSpec.hs | mit | handlerUnit :: IOError -> IO ()
handlerUnit = const $ return () | 63 | handlerUnit :: IOError -> IO ()
handlerUnit = const $ return () | 63 | handlerUnit = const $ return () | 31 | false | true | 0 | 7 | 11 | 29 | 14 | 15 | null | null |
nilcons/tag-game | src/Keys.hs | apache-2.0 | handleKeys :: Event -> KeySet -> KeySet
handleKeys ev = case ev of
EventKey key ud _ _ -> case playerKey key of
Nothing -> id
Just pkey -> case ud of
Up -> delete pkey
Down -> insert pkey
_ -> id | 219 | handleKeys :: Event -> KeySet -> KeySet
handleKeys ev = case ev of
EventKey key ud _ _ -> case playerKey key of
Nothing -> id
Just pkey -> case ud of
Up -> delete pkey
Down -> insert pkey
_ -> id | 219 | handleKeys ev = case ev of
EventKey key ud _ _ -> case playerKey key of
Nothing -> id
Just pkey -> case ud of
Up -> delete pkey
Down -> insert pkey
_ -> id | 179 | false | true | 0 | 14 | 66 | 97 | 44 | 53 | null | null |
faylang/fay-server | src/Language/Fay/JQuery.hs | bsd-3-clause | closestWithContext :: String -> String -> JQuery -> Fay JQuery
closestWithContext = ffi "%3['closest'](%1, %2)" | 111 | closestWithContext :: String -> String -> JQuery -> Fay JQuery
closestWithContext = ffi "%3['closest'](%1, %2)" | 111 | closestWithContext = ffi "%3['closest'](%1, %2)" | 48 | false | true | 0 | 8 | 14 | 29 | 14 | 15 | null | null |
roelvandijk/aeson | tests/DataFamilies/Encoders.hs | bsd-3-clause | thSomeTypeParseJSONTaggedObject :: Value -> Parser (SomeType c () Int)
thSomeTypeParseJSONTaggedObject = $(mkParseJSON optsTaggedObject 'Unary) | 143 | thSomeTypeParseJSONTaggedObject :: Value -> Parser (SomeType c () Int)
thSomeTypeParseJSONTaggedObject = $(mkParseJSON optsTaggedObject 'Unary) | 143 | thSomeTypeParseJSONTaggedObject = $(mkParseJSON optsTaggedObject 'Unary) | 72 | false | true | 0 | 9 | 13 | 40 | 20 | 20 | null | null |
yiannist/ganeti | src/Ganeti/WConfd/ConfigWriter.hs | bsd-2-clause | targetToPredicate (ToGroups gs) = (`Set.member` gs) . nodeGroup | 63 | targetToPredicate (ToGroups gs) = (`Set.member` gs) . nodeGroup | 63 | targetToPredicate (ToGroups gs) = (`Set.member` gs) . nodeGroup | 63 | false | false | 0 | 7 | 7 | 27 | 15 | 12 | null | null |
bitemyapp/ghc | testsuite/tests/rts/ListStaticPointers.hs | bsd-3-clause | g :: Int -> Int
g = (+1) | 24 | g :: Int -> Int
g = (+1) | 24 | g = (+1) | 8 | false | true | 0 | 7 | 7 | 26 | 12 | 14 | null | null |
Proclivis/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxAUI_DOCKART_BORDER_COLOUR :: Int
wxAUI_DOCKART_BORDER_COLOUR = 13 | 67 | wxAUI_DOCKART_BORDER_COLOUR :: Int
wxAUI_DOCKART_BORDER_COLOUR = 13 | 67 | wxAUI_DOCKART_BORDER_COLOUR = 13 | 32 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
yesodweb/persistent | persistent/Database/Persist/TH.hs | mit | -- | Same as 'persistFileWith', but uses several external files instead of
-- one. Splitting your Persistent definitions into multiple modules can
-- potentially dramatically speed up compile times.
--
-- The recommended file extension is @.persistentmodels@.
--
-- ==== __Examples__
--
-- Split your Persistent definiti... | 1,742 | persistManyFileWith :: PersistSettings -> [FilePath] -> Q Exp
persistManyFileWith ps fps = do
mapM_ qAddDependentFile fps
ss <- mapM (qRunIO . getFileContents) fps
let s = T.intercalate "\n" ss -- be tolerant of the user forgetting to put a line-break at EOF.
parseReferences ps s | 296 | persistManyFileWith ps fps = do
mapM_ qAddDependentFile fps
ss <- mapM (qRunIO . getFileContents) fps
let s = T.intercalate "\n" ss -- be tolerant of the user forgetting to put a line-break at EOF.
parseReferences ps s | 234 | true | true | 0 | 11 | 283 | 125 | 81 | 44 | null | null |
ony/LibClang | test/Test_InclusionVisitor.hs | bsd-3-clause | test tu = getInclusions tu >>= DVS.mapM_ printInclusion | 55 | test tu = getInclusions tu >>= DVS.mapM_ printInclusion | 55 | test tu = getInclusions tu >>= DVS.mapM_ printInclusion | 55 | false | false | 1 | 7 | 7 | 24 | 9 | 15 | null | null |
Philonous/pontarius-xmpp | source/Network/Xmpp/Stanza.hs | bsd-3-clause | associatedErrorType Conflict = Cancel | 50 | associatedErrorType Conflict = Cancel | 50 | associatedErrorType Conflict = Cancel | 50 | false | false | 0 | 5 | 16 | 9 | 4 | 5 | null | null |
rueshyna/gogol | gogol-games/gen/Network/Google/Games/Types/Product.hs | mpl-2.0 | -- | The current steps recorded for this achievement if it is incremental.
aurCurrentSteps :: Lens' AchievementUpdateResponse (Maybe Int32)
aurCurrentSteps
= lens _aurCurrentSteps
(\ s a -> s{_aurCurrentSteps = a})
. mapping _Coerce | 246 | aurCurrentSteps :: Lens' AchievementUpdateResponse (Maybe Int32)
aurCurrentSteps
= lens _aurCurrentSteps
(\ s a -> s{_aurCurrentSteps = a})
. mapping _Coerce | 171 | aurCurrentSteps
= lens _aurCurrentSteps
(\ s a -> s{_aurCurrentSteps = a})
. mapping _Coerce | 106 | true | true | 0 | 10 | 46 | 55 | 28 | 27 | null | null |
pgj/ActiveHs | Html.hs | bsd-3-clause | splitComment' :: String -> Maybe (String, String)
splitComment' a = f [] a where
f ac ('-':'-':c) | isComment c = Just (reverse $ dropWhile (==' ') ac, c) -- !!!
f ac ('"':cs) = uncurry f $ skipString ('"':ac) cs
f ac (c:cs) = f (c:ac) cs
f ac [] = Nothing
isComment ('-':c) = isComment c
isC... | 647 | splitComment' :: String -> Maybe (String, String)
splitComment' a = f [] a where
f ac ('-':'-':c) | isComment c = Just (reverse $ dropWhile (==' ') ac, c) -- !!!
f ac ('"':cs) = uncurry f $ skipString ('"':ac) cs
f ac (c:cs) = f (c:ac) cs
f ac [] = Nothing
isComment ('-':c) = isComment c
isC... | 647 | splitComment' a = f [] a where
f ac ('-':'-':c) | isComment c = Just (reverse $ dropWhile (==' ') ac, c) -- !!!
f ac ('"':cs) = uncurry f $ skipString ('"':ac) cs
f ac (c:cs) = f (c:ac) cs
f ac [] = Nothing
isComment ('-':c) = isComment c
isComment (d:_) | isSymbol d = False
isComment _ ... | 597 | false | true | 0 | 10 | 165 | 362 | 186 | 176 | null | null |
kawu/pedestrian-dag | src/Data/DAG.hs | bsd-2-clause | ingoingEdges :: NodeID -> DAG a b -> [EdgeID]
ingoingEdges i DAG{..} = case M.lookup i nodeMap of
Nothing -> error "ingoingEdges: incorrect ID"
Just Node{..} -> S.toAscList ingoSet
-- | The list of outgoint edges from the given node, in ascending order. | 259 | ingoingEdges :: NodeID -> DAG a b -> [EdgeID]
ingoingEdges i DAG{..} = case M.lookup i nodeMap of
Nothing -> error "ingoingEdges: incorrect ID"
Just Node{..} -> S.toAscList ingoSet
-- | The list of outgoint edges from the given node, in ascending order. | 259 | ingoingEdges i DAG{..} = case M.lookup i nodeMap of
Nothing -> error "ingoingEdges: incorrect ID"
Just Node{..} -> S.toAscList ingoSet
-- | The list of outgoint edges from the given node, in ascending order. | 213 | false | true | 3 | 7 | 48 | 76 | 37 | 39 | null | null |
joashc/cryptodiner | network/DcPeerIO.hs | gpl-3.0 | peerIOInterpreter :: DcPeerOperator (DcPeerIO next) -> DcPeerIO next
peerIOInterpreter (InitState next) = do
state <- get
-- Generate private key
randNum <- liftIO $ systemRandomNum 768
let priv = PrivateKey randNum gp
-- Generate nonce
randBytes <- liftIO $ systemRandomBytes 256
-- Get port number
port... | 597 | peerIOInterpreter :: DcPeerOperator (DcPeerIO next) -> DcPeerIO next
peerIOInterpreter (InitState next) = do
state <- get
-- Generate private key
randNum <- liftIO $ systemRandomNum 768
let priv = PrivateKey randNum gp
-- Generate nonce
randBytes <- liftIO $ systemRandomBytes 256
-- Get port number
port... | 597 | peerIOInterpreter (InitState next) = do
state <- get
-- Generate private key
randNum <- liftIO $ systemRandomNum 768
let priv = PrivateKey randNum gp
-- Generate nonce
randBytes <- liftIO $ systemRandomBytes 256
-- Get port number
port <- liftIO getPortNumber
-- Start listening on port
socket <- lif... | 528 | false | true | 0 | 12 | 112 | 183 | 85 | 98 | null | null |
dylex/aeson-better-errors | src/Data/Aeson/BetterErrors/Utils.hs | mit | -- | A version of catchJust from "Control.Exception.Base", except for any
-- instance of 'MonadError'.
catchJust :: MonadError e m
=> (e -> Maybe b) -- ^ Predicate to select exceptions
-> m a -- ^ Computation to run
-> (b -> m a) -- ^ Handler
-> m a
catchJust p act handler = catchError act handle... | 454 | catchJust :: MonadError e m
=> (e -> Maybe b) -- ^ Predicate to select exceptions
-> m a -- ^ Computation to run
-> (b -> m a) -- ^ Handler
-> m a
catchJust p act handler = catchError act handle
where
handle e =
case p e of
Nothing -> throwError e
Just b -> handler b
-- Value... | 351 | catchJust p act handler = catchError act handle
where
handle e =
case p e of
Nothing -> throwError e
Just b -> handler b
-- Value-level patterns for json values | 181 | true | true | 0 | 12 | 124 | 116 | 56 | 60 | null | null |
grzegorzbalcerek/orgmode | Render.hs | bsd-2-clause | multiColumnAlignment ('¦':cs) = '|' : multiColumnAlignment cs | 61 | multiColumnAlignment ('¦':cs) = '|' : multiColumnAlignment cs | 61 | multiColumnAlignment ('¦':cs) = '|' : multiColumnAlignment cs | 61 | false | false | 0 | 7 | 6 | 23 | 11 | 12 | null | null |
mbakke/ganeti | src/Ganeti/Constants.hs | bsd-2-clause | ddmModify :: String
ddmModify = Types.ddmFullToRaw DdmFullModify | 64 | ddmModify :: String
ddmModify = Types.ddmFullToRaw DdmFullModify | 64 | ddmModify = Types.ddmFullToRaw DdmFullModify | 44 | false | true | 0 | 6 | 6 | 16 | 8 | 8 | null | null |
ArnoVanLumig/chesshs | ChessTest.hs | bsd-3-clause | kingcastlepos = "8/8/8/8/8/8/8/4K2R w KQkq - " | 46 | kingcastlepos = "8/8/8/8/8/8/8/4K2R w KQkq - " | 46 | kingcastlepos = "8/8/8/8/8/8/8/4K2R w KQkq - " | 46 | false | false | 0 | 4 | 6 | 6 | 3 | 3 | null | null |
Teaspot-Studio/arhelk-lexer | app/Language/Russian.hs | bsd-3-clause | -- | Definition for Russian language lexer
russianLanguage :: LexerLanguage ()
russianLanguage = defaultLexer {
lexerPunctuation = [
char '.' >> return EndSentence
, char ',' >> return Comma
, char ':' >> return Citation
, char ';' >> return Semicolon
, char '!' >> return Exclamatio... | 451 | russianLanguage :: LexerLanguage ()
russianLanguage = defaultLexer {
lexerPunctuation = [
char '.' >> return EndSentence
, char ',' >> return Comma
, char ':' >> return Citation
, char ';' >> return Semicolon
, char '!' >> return ExclamationMark
, char '?' >> return QuestionMa... | 408 | russianLanguage = defaultLexer {
lexerPunctuation = [
char '.' >> return EndSentence
, char ',' >> return Comma
, char ':' >> return Citation
, char ';' >> return Semicolon
, char '!' >> return ExclamationMark
, char '?' >> return QuestionMark
, (string "—" <|> try (stri... | 372 | true | true | 0 | 15 | 125 | 148 | 69 | 79 | null | null |
Trdonja/Zastonjski-izreki | Primeri.hs | gpl-3.0 | -- | Konkatenacija.
tConcat :: (String, String)
tConcat = ("[[a]] -> [a]", "concat") | 84 | tConcat :: (String, String)
tConcat = ("[[a]] -> [a]", "concat") | 64 | tConcat = ("[[a]] -> [a]", "concat") | 36 | true | true | 0 | 7 | 12 | 31 | 16 | 15 | null | null |
valderman/lambnyaa | Network/LambNyaa/Monad.hs | bsd-3-clause | source :: ItemLike a => IO [a] -> Nyaa [a]
source m = do
env <- getEnv
xs <- liftIO m
liftIO $ mapM (asItemM (fillFields $ envConn env)) xs
-- | Fill in the itmSeenBefore and itmIdentifier fields of an Item. | 214 | source :: ItemLike a => IO [a] -> Nyaa [a]
source m = do
env <- getEnv
xs <- liftIO m
liftIO $ mapM (asItemM (fillFields $ envConn env)) xs
-- | Fill in the itmSeenBefore and itmIdentifier fields of an Item. | 214 | source m = do
env <- getEnv
xs <- liftIO m
liftIO $ mapM (asItemM (fillFields $ envConn env)) xs
-- | Fill in the itmSeenBefore and itmIdentifier fields of an Item. | 171 | false | true | 0 | 13 | 48 | 83 | 39 | 44 | null | null |
h8gi/Open-usp-Tukubai | COMMANDS.HS/marume.hs | mit | cutFrac '0' (n,(a:b)) = if read [a] < 5 then read n else 1 + read n | 68 | cutFrac '0' (n,(a:b)) = if read [a] < 5 then read n else 1 + read n | 68 | cutFrac '0' (n,(a:b)) = if read [a] < 5 then read n else 1 + read n | 68 | false | false | 0 | 8 | 17 | 54 | 27 | 27 | null | null |
caioariede/tpll | src/Tpll/Tags.hs | mit | -- | Constructs the `Tags` containing template tags and filters.
tags :: [(String, Tag)] -> [(String, Filter)] -> Tags
tags tags' filters' =
Tags (fromList tags', fromList filters') | 185 | tags :: [(String, Tag)] -> [(String, Filter)] -> Tags
tags tags' filters' =
Tags (fromList tags', fromList filters') | 120 | tags tags' filters' =
Tags (fromList tags', fromList filters') | 66 | true | true | 0 | 8 | 31 | 58 | 32 | 26 | null | null |
sebcrozet/falling | Physics/Falling/Constraint/Solver/SecondOrderWorldAccumulatedImpulse.hs | bsd-3-clause | secondOrderIntegrate :: (Dynamic rb t lv av ii, UV.Unbox lv, UV.Unbox av) =>
Double -> [ (Int, rb) ] -> UV.Vector lv -> UV.Vector av -> Int -> [ (Int, rb) ]
secondOrderIntegrate dt bodies linImpVect angImpVect shift =
map applyBodyImpulses bodies
where
applyBodyImpu... | 760 | secondOrderIntegrate :: (Dynamic rb t lv av ii, UV.Unbox lv, UV.Unbox av) =>
Double -> [ (Int, rb) ] -> UV.Vector lv -> UV.Vector av -> Int -> [ (Int, rb) ]
secondOrderIntegrate dt bodies linImpVect angImpVect shift =
map applyBodyImpulses bodies
where
applyBodyImpu... | 760 | secondOrderIntegrate dt bodies linImpVect angImpVect shift =
map applyBodyImpulses bodies
where
applyBodyImpulses (i, rb) =
let idx = i + shift in
let linImp = linImpVect UV.! idx in
let angImp = angImpVect UV.! idx in
let rb' = setVelo... | 579 | false | true | 0 | 21 | 305 | 236 | 118 | 118 | null | null |
HaliteChallenge/Halite-II | airesources/Haskell/Hlt/Entity.hs | mit | -- | Checks if a Ship is within docking range of Planet.
canDock :: Ship -> Planet -> Bool
canDock s p = distance s p <= radius p + dockRadius + shipRadius | 155 | canDock :: Ship -> Planet -> Bool
canDock s p = distance s p <= radius p + dockRadius + shipRadius | 98 | canDock s p = distance s p <= radius p + dockRadius + shipRadius | 64 | true | true | 0 | 8 | 32 | 45 | 22 | 23 | null | null |
adinapoli/xmonad-contrib | XMonad/Layout/ImageButtonDecoration.hs | bsd-3-clause | closeButtonOffset :: Int
closeButtonOffset = 4 | 46 | closeButtonOffset :: Int
closeButtonOffset = 4 | 46 | closeButtonOffset = 4 | 21 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
shlevy/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | enumFromToName = varQual gHC_ENUM (fsLit "enumFromTo") enumFromToClassOpKey | 83 | enumFromToName = varQual gHC_ENUM (fsLit "enumFromTo") enumFromToClassOpKey | 83 | enumFromToName = varQual gHC_ENUM (fsLit "enumFromTo") enumFromToClassOpKey | 83 | false | false | 0 | 7 | 14 | 19 | 9 | 10 | null | null |
CementTheBlock/.vim | vim/bundle/ghcmod-vim/test/data/with-cabal/src/Foo.hs | mit | foo = bar ++ "" | 15 | foo = bar ++ "" | 15 | foo = bar ++ "" | 15 | false | false | 3 | 5 | 4 | 15 | 5 | 10 | null | null |
bts/mtsbs | Transformers.hs | mit | eval6 :: Exp -> Eval6 Value
eval6 (Lit i) = do tick
liftIO $ print i
return $ IntVal i | 124 | eval6 :: Exp -> Eval6 Value
eval6 (Lit i) = do tick
liftIO $ print i
return $ IntVal i | 124 | eval6 (Lit i) = do tick
liftIO $ print i
return $ IntVal i | 96 | false | true | 0 | 8 | 57 | 54 | 23 | 31 | null | null |
supermario/stack | src/Stack/Options.hs | bsd-3-clause | abstractResolverOptsParser :: Parser AbstractResolver
abstractResolverOptsParser =
option readAbstractResolver
(long "resolver" <>
metavar "RESOLVER" <>
help "Override resolver in project file") | 224 | abstractResolverOptsParser :: Parser AbstractResolver
abstractResolverOptsParser =
option readAbstractResolver
(long "resolver" <>
metavar "RESOLVER" <>
help "Override resolver in project file") | 224 | abstractResolverOptsParser =
option readAbstractResolver
(long "resolver" <>
metavar "RESOLVER" <>
help "Override resolver in project file") | 170 | false | true | 0 | 9 | 49 | 39 | 18 | 21 | null | null |
iblech/blaze-html | tests/Util/Tests.hs | bsd-3-clause | -- | Simple sanitize test case
--
sanitize2 :: Assertion
sanitize2 = "httpEquiv" @=? sanitize "http-equiv" | 106 | sanitize2 :: Assertion
sanitize2 = "httpEquiv" @=? sanitize "http-equiv" | 72 | sanitize2 = "httpEquiv" @=? sanitize "http-equiv" | 49 | true | true | 0 | 6 | 15 | 20 | 11 | 9 | null | null |
lingxiao/GoodGreatIntensity | test/PatternCompilerTest.hs | bsd-3-clause | {-----------------------------------------------------------------------------
Compiler test
------------------------------------------------------------------------------}
tcompile :: Test
tcompile = let p1 = (compile "* or *" ) (S "good") (S "great")
in let p2 = (compile "or * or *" ... | 1,264 | tcompile :: Test
tcompile = let p1 = (compile "* or *" ) (S "good") (S "great")
in let p2 = (compile "or * or *" ) (S "good") (S "great")
in let p3 = (compile "* (and/or) *" ) (S "good") (S "great")
in let p4 = (compile "* or *" ) Star Star
... | 1,087 | tcompile = let p1 = (compile "* or *" ) (S "good") (S "great")
in let p2 = (compile "or * or *" ) (S "good") (S "great")
in let p3 = (compile "* (and/or) *" ) (S "good") (S "great")
in let p4 = (compile "* or *" ) Star Star
in "comp... | 1,070 | true | true | 0 | 18 | 505 | 313 | 148 | 165 | null | null |
picca/hkl | contrib/haskell/src/Hkl/D2AM/XRD.hs | gpl-3.0 | threshold :: Threshold
threshold = Threshold 5000 | 49 | threshold :: Threshold
threshold = Threshold 5000 | 49 | threshold = Threshold 5000 | 26 | false | true | 0 | 6 | 6 | 20 | 8 | 12 | null | null |
burnicane/Awaywox | Awaywox.hs | agpl-3.0 | responseToTraitors res =
case jks of
Nothing -> Nothing
Just kms -> return (
foldl max 0 $ map killID $ kms
, concat $ map getTraitors $ kms
)
where parsed = parseXMLDoc (responseBody res)
jks = parsed >>= xmlemToKillmails | 288 | responseToTraitors res =
case jks of
Nothing -> Nothing
Just kms -> return (
foldl max 0 $ map killID $ kms
, concat $ map getTraitors $ kms
)
where parsed = parseXMLDoc (responseBody res)
jks = parsed >>= xmlemToKillmails | 288 | responseToTraitors res =
case jks of
Nothing -> Nothing
Just kms -> return (
foldl max 0 $ map killID $ kms
, concat $ map getTraitors $ kms
)
where parsed = parseXMLDoc (responseBody res)
jks = parsed >>= xmlemToKillmails | 288 | false | false | 1 | 12 | 106 | 93 | 43 | 50 | null | null |
Helium4Haskell/helium | test/typeClasses/ClassInstaneError1.hs | gpl-3.0 | main = f 3 | 10 | main = f 3 | 10 | main = f 3 | 10 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
HIPERFIT/futhark | src/Futhark/CodeGen/Backends/SequentialPython.hs | isc | copySequentialMemory :: GenericPython.Copy Imp.Sequential ()
copySequentialMemory destmem destidx DefaultSpace srcmem srcidx DefaultSpace nbytes _bt =
GenericPython.copyMemoryDefaultSpace destmem destidx srcmem srcidx nbytes | 226 | copySequentialMemory :: GenericPython.Copy Imp.Sequential ()
copySequentialMemory destmem destidx DefaultSpace srcmem srcidx DefaultSpace nbytes _bt =
GenericPython.copyMemoryDefaultSpace destmem destidx srcmem srcidx nbytes | 226 | copySequentialMemory destmem destidx DefaultSpace srcmem srcidx DefaultSpace nbytes _bt =
GenericPython.copyMemoryDefaultSpace destmem destidx srcmem srcidx nbytes | 165 | false | true | 1 | 6 | 22 | 56 | 25 | 31 | null | null |
forste/haReFork | refactorer/RefacDupTrans.hs | bsd-3-clause | getStmtList2 (Exp (HsDo s))
= return [last $ getStmtList s] | 61 | getStmtList2 (Exp (HsDo s))
= return [last $ getStmtList s] | 61 | getStmtList2 (Exp (HsDo s))
= return [last $ getStmtList s] | 61 | false | false | 0 | 8 | 11 | 35 | 16 | 19 | null | null |
faylang/fay-server | src/Client/API.hs | bsd-3-clause | -- | Call a command.
call :: (Record a,Foreign a) => (Returns a -> Command) -> (a -> Fay ()) -> Fay ()
call f g = ajaxCommand (f Returns) g | 139 | call :: (Record a,Foreign a) => (Returns a -> Command) -> (a -> Fay ()) -> Fay ()
call f g = ajaxCommand (f Returns) g | 118 | call f g = ajaxCommand (f Returns) g | 36 | true | true | 0 | 11 | 30 | 82 | 40 | 42 | null | null |
nakamuray/htig | HTIG/Action.hs | bsd-3-clause | screenName :: Parser String
screenName = many1 $ letter <|> digit <|> char '_' | 78 | screenName :: Parser String
screenName = many1 $ letter <|> digit <|> char '_' | 78 | screenName = many1 $ letter <|> digit <|> char '_' | 50 | false | true | 0 | 7 | 13 | 29 | 14 | 15 | null | null |
a143753/AOJ | 3101.hs | apache-2.0 | pack [] _ = [] | 14 | pack [] _ = [] | 14 | pack [] _ = [] | 14 | false | false | 0 | 5 | 4 | 17 | 7 | 10 | null | null |
martin-kolinek/some-board-game-rules | test/Workplaces/DigCave.hs | mit | digCaveTests :: TestTree
digCaveTests = localOption (QuickCheckMaxRatio 500) $ testGroup "Dig cave tests" $ [
testProperty "Starting working makes correct buildings available" $ movingWorkerProperty $ do
(playerId, _, _) <- startWorkingInDigCave
buildings <- getsUniverse currentlyBuiltBuildings <*> ... | 3,199 | digCaveTests :: TestTree
digCaveTests = localOption (QuickCheckMaxRatio 500) $ testGroup "Dig cave tests" $ [
testProperty "Starting working makes correct buildings available" $ movingWorkerProperty $ do
(playerId, _, _) <- startWorkingInDigCave
buildings <- getsUniverse currentlyBuiltBuildings <*> ... | 3,199 | digCaveTests = localOption (QuickCheckMaxRatio 500) $ testGroup "Dig cave tests" $ [
testProperty "Starting working makes correct buildings available" $ movingWorkerProperty $ do
(playerId, _, _) <- startWorkingInDigCave
buildings <- getsUniverse currentlyBuiltBuildings <*> pure playerId
ass... | 3,174 | false | true | 0 | 15 | 631 | 713 | 341 | 372 | null | null |
brendanhay/gogol | gogol-doubleclick-search/gen/Network/Google/DoubleClickSearch/Types/Product.hs | mpl-2.0 | -- | Inclusive date in YYYY-MM-DD format. When provided, this overrides the
-- overall time range of the report for this column only. Must be provided
-- together with \`endDate\`.
racsStartDate :: Lens' ReportAPIColumnSpec (Maybe Text)
racsStartDate
= lens _racsStartDate
(\ s a -> s{_racsStartDate = a}) | 313 | racsStartDate :: Lens' ReportAPIColumnSpec (Maybe Text)
racsStartDate
= lens _racsStartDate
(\ s a -> s{_racsStartDate = a}) | 132 | racsStartDate
= lens _racsStartDate
(\ s a -> s{_racsStartDate = a}) | 76 | true | true | 0 | 9 | 54 | 50 | 27 | 23 | null | null |
kmilner/tamarin-prover | src/Web/Types.hs | gpl-3.0 | getEitherTheoryIndex (Diff i) = (dtiIndex i) | 44 | getEitherTheoryIndex (Diff i) = (dtiIndex i) | 44 | getEitherTheoryIndex (Diff i) = (dtiIndex i) | 44 | false | false | 0 | 7 | 5 | 21 | 10 | 11 | null | null |
HJvT/hdirect | src/Parser.hs | bsd-3-clause | action_322 (96#) = happyGoto action_220 | 39 | action_322 (96#) = happyGoto action_220 | 39 | action_322 (96#) = happyGoto action_220 | 39 | false | false | 0 | 6 | 4 | 15 | 7 | 8 | null | null |
gridaphobe/target | examples/MapTests.hs | mit | join'_bad kx x Tip r = insertMin kx x r | 40 | join'_bad kx x Tip r = insertMin kx x r | 40 | join'_bad kx x Tip r = insertMin kx x r | 40 | false | false | 0 | 5 | 10 | 22 | 10 | 12 | null | null |
olsner/ghc | compiler/utils/Bag.hs | bsd-3-clause | listToBag vs = ListBag vs | 25 | listToBag vs = ListBag vs | 25 | listToBag vs = ListBag vs | 25 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
kolmodin/cabal | Cabal/Distribution/PackageDescription/Check.hs | bsd-3-clause | repoTypeDirname Bazaar = [".bzr"] | 37 | repoTypeDirname Bazaar = [".bzr"] | 37 | repoTypeDirname Bazaar = [".bzr"] | 37 | false | false | 0 | 5 | 7 | 13 | 6 | 7 | null | null |
tpsinnem/Idris-dev | src/Idris/AbsSyntaxTree.hs | bsd-3-clause | toplevel :: ElabInfo
toplevel = EInfo [] emptyContext id [] Nothing "(toplevel)" 0 id (\_ _ _ -> fail "Not implemented") | 120 | toplevel :: ElabInfo
toplevel = EInfo [] emptyContext id [] Nothing "(toplevel)" 0 id (\_ _ _ -> fail "Not implemented") | 120 | toplevel = EInfo [] emptyContext id [] Nothing "(toplevel)" 0 id (\_ _ _ -> fail "Not implemented") | 99 | false | true | 0 | 8 | 20 | 49 | 25 | 24 | null | null |
MichaelBurge/ToxicSludgeDB | Tests/Database/Toxic/Query/Interpreter.hs | mit | interpreterTests :: Test.Framework.Test
interpreterTests =
testGroup "Interpreter" [
testCase "Boolean select" test_booleanSelect,
testCase "Rename" test_rename,
testCase "Case when(value)" test_case_when_value,
testCase "Case when(null)" test_case_when_null,
testCase "Case when else" test_case_wh... | 777 | interpreterTests :: Test.Framework.Test
interpreterTests =
testGroup "Interpreter" [
testCase "Boolean select" test_booleanSelect,
testCase "Rename" test_rename,
testCase "Case when(value)" test_case_when_value,
testCase "Case when(null)" test_case_when_null,
testCase "Case when else" test_case_wh... | 777 | interpreterTests =
testGroup "Interpreter" [
testCase "Boolean select" test_booleanSelect,
testCase "Rename" test_rename,
testCase "Case when(value)" test_case_when_value,
testCase "Case when(null)" test_case_when_null,
testCase "Case when else" test_case_when_else,
testCase "Case when when" t... | 737 | false | true | 0 | 7 | 130 | 139 | 70 | 69 | null | null |
akc/sym | tests/ListStat.hs | bsd-3-clause | cyc :: [Int] -> Int
cyc w = length $ orbits (w!!) w
where
orbit f x = y : takeWhile (/=y) ys where (y:ys) = iterate f x
orbits _ [] = []
orbits f (x:xs) = ys : orbits f (xs\\ys) where ys = orbit f x | 220 | cyc :: [Int] -> Int
cyc w = length $ orbits (w!!) w
where
orbit f x = y : takeWhile (/=y) ys where (y:ys) = iterate f x
orbits _ [] = []
orbits f (x:xs) = ys : orbits f (xs\\ys) where ys = orbit f x | 220 | cyc w = length $ orbits (w!!) w
where
orbit f x = y : takeWhile (/=y) ys where (y:ys) = iterate f x
orbits _ [] = []
orbits f (x:xs) = ys : orbits f (xs\\ys) where ys = orbit f x | 200 | false | true | 0 | 10 | 70 | 138 | 71 | 67 | null | null |
sgillespie/ghc | compiler/prelude/TysWiredIn.hs | bsd-3-clause | -- The corresponding DataCon does not have a known-key name
cTupleTyConNames :: [Name]
cTupleTyConNames = map cTupleTyConName (0 : [2..mAX_CTUPLE_SIZE]) | 153 | cTupleTyConNames :: [Name]
cTupleTyConNames = map cTupleTyConName (0 : [2..mAX_CTUPLE_SIZE]) | 92 | cTupleTyConNames = map cTupleTyConName (0 : [2..mAX_CTUPLE_SIZE]) | 65 | true | true | 0 | 8 | 20 | 32 | 18 | 14 | null | null |
teuffy/min-var-ci | src/FP/ImportWizard/Wizard.hs | mit | _getState
:: (MonadHandler handler)
=> WizardT data_ page handler result (WizardState data_ page)
_getState = get | 123 | _getState
:: (MonadHandler handler)
=> WizardT data_ page handler result (WizardState data_ page)
_getState = get | 123 | _getState = get | 15 | false | true | 0 | 8 | 25 | 43 | 21 | 22 | null | null |
TomMD/cryptol | src/Cryptol/TypeCheck/Solver/InfNat.hs | bsd-3-clause | nAdd _ Inf = Inf | 26 | nAdd _ Inf = Inf | 26 | nAdd _ Inf = Inf | 26 | false | false | 1 | 5 | 14 | 13 | 5 | 8 | null | null |
michalkonecny/aern | aern-real/src/Numeric/AERN/RealArithmetic/RefinementOrderRounding/ElementaryFromFieldOps/SineCosine.hs | bsd-3-clause | sineCosineTaylorAt0 ::
(ArithInOut.RoundedAdd real,
ArithInOut.RoundedMultiply real,
ArithInOut.RoundedPowerToNonnegInt real,
HasOne real,
ArithInOut.RoundedReal coeff,
ArithInOut.Convertible real coeff,
ArithInOut.RoundedMixedAdd real coeff,
ArithInOut.RoundedMixedMultiply real c... | 2,294 | sineCosineTaylorAt0 ::
(ArithInOut.RoundedAdd real,
ArithInOut.RoundedMultiply real,
ArithInOut.RoundedPowerToNonnegInt real,
HasOne real,
ArithInOut.RoundedReal coeff,
ArithInOut.Convertible real coeff,
ArithInOut.RoundedMixedAdd real coeff,
ArithInOut.RoundedMixedMultiply real c... | 2,266 | sineCosineTaylorAt0 isSine eff sampleCoeff x =
-- | xTooBig || xTooLow = (neg $ one sampleRes) </\> (one sampleRes) -- = [-1,1]
-- trace
-- (
-- "sineTaylor: "
-- ++ "\n x = " ++ show x
-- ++ "\n ranLargerEndpoint = " ++ show ranLargerEndpoint
-- ++ "\n ... | 1,683 | true | true | 0 | 13 | 780 | 369 | 195 | 174 | null | null |
axnion/playground | random/haskell/syntaxInFunctions.hs | mit | tell (x:[]) = "The list has one element: " ++ show x | 52 | tell (x:[]) = "The list has one element: " ++ show x | 52 | tell (x:[]) = "The list has one element: " ++ show x | 52 | false | false | 0 | 8 | 11 | 25 | 12 | 13 | null | null |
vTurbine/ghc | compiler/cmm/CLabel.hs | bsd-3-clause | underscorePrefix :: Bool -- leading underscore on assembler labels?
underscorePrefix = (cLeadingUnderscore == "YES") | 118 | underscorePrefix :: Bool
underscorePrefix = (cLeadingUnderscore == "YES") | 73 | underscorePrefix = (cLeadingUnderscore == "YES") | 48 | true | true | 0 | 7 | 15 | 26 | 12 | 14 | null | null |
zeekay/lambdabot | Plugin/Instances.hs | mit | stdMdls :: [ModuleName]
stdMdls = controls
where monads = map ("Monad."++)
[ "Cont", "Error", "Fix", "Reader", "RWS", "ST",
"State", "Trans", "Writer" ]
controls = map ("Control." ++) $ monads ++ ["Arrow"]
-- | Main processing function for \@instances. Ta... | 413 | stdMdls :: [ModuleName]
stdMdls = controls
where monads = map ("Monad."++)
[ "Cont", "Error", "Fix", "Reader", "RWS", "ST",
"State", "Trans", "Writer" ]
controls = map ("Control." ++) $ monads ++ ["Arrow"]
-- | Main processing function for \@instances. Ta... | 413 | stdMdls = controls
where monads = map ("Monad."++)
[ "Cont", "Error", "Fix", "Reader", "RWS", "ST",
"State", "Trans", "Writer" ]
controls = map ("Control." ++) $ monads ++ ["Arrow"]
-- | Main processing function for \@instances. Takes a class name and
-- ... | 389 | false | true | 0 | 10 | 123 | 82 | 50 | 32 | null | null |
anwb/fp-one-on-one | wadler-essence-02-position.hs | mit | findin :: Name -> Environment -> P Value
findin x [] = errorP ("unbound variable: " ++ x) | 115 | findin :: Name -> Environment -> P Value
findin x [] = errorP ("unbound variable: " ++ x) | 115 | findin x [] = errorP ("unbound variable: " ++ x) | 59 | false | true | 0 | 7 | 43 | 39 | 19 | 20 | null | null |
spechub/Hets | CASL/SimplifySen.hs | gpl-2.0 | anaFormula :: (FormExtension f, TermExtension f)
=> Min f e -> (Sign f e -> f -> f) -> Sign f e -> FORMULA f -> FORMULA f
anaFormula minF simpF sign form1 =
let minForm = maybeResult . minExpFORMULA minF sign
simplifyTermC = simplifyTerm minF simpF sign
simpForm = case form1 of
Equatio... | 1,365 | anaFormula :: (FormExtension f, TermExtension f)
=> Min f e -> (Sign f e -> f -> f) -> Sign f e -> FORMULA f -> FORMULA f
anaFormula minF simpF sign form1 =
let minForm = maybeResult . minExpFORMULA minF sign
simplifyTermC = simplifyTerm minF simpF sign
simpForm = case form1 of
Equatio... | 1,365 | anaFormula minF simpF sign form1 =
let minForm = maybeResult . minExpFORMULA minF sign
simplifyTermC = simplifyTerm minF simpF sign
simpForm = case form1 of
Equation t1 e t2 pos -> Equation
(simplifyTermC t1) e (simplifyTermC t2) pos
_ -> error "anaFormula1"
... | 1,241 | false | true | 0 | 17 | 511 | 454 | 217 | 237 | null | null |
facebookincubator/duckling | Duckling/Time/AR/Rules.hs | bsd-3-clause | ruleTimezone :: Rule
ruleTimezone = Rule
{ name = "<time> timezone"
, pattern =
[ Predicate $ and . sequence [isNotLatent, isATimeOfDay]
, regex "(بتوقيت |)?\\b(YEKT|YEKST|YAKT|YAKST|WITA|WIT|WIB|WGT|WGST|WFT|WET|WEST|WAT|WAST|VUT|VLAT|VLAST|VET|UZT|UYT|UYST|UTC|ULAT|TVT|TMT|TLT|TKT|TJT|TFT|TAHT|SST|SRT|SGT... | 1,122 | ruleTimezone :: Rule
ruleTimezone = Rule
{ name = "<time> timezone"
, pattern =
[ Predicate $ and . sequence [isNotLatent, isATimeOfDay]
, regex "(بتوقيت |)?\\b(YEKT|YEKST|YAKT|YAKST|WITA|WIT|WIB|WGT|WGST|WFT|WET|WEST|WAT|WAST|VUT|VLAT|VLAST|VET|UZT|UYT|UYST|UTC|ULAT|TVT|TMT|TLT|TKT|TJT|TFT|TAHT|SST|SRT|SGT... | 1,122 | ruleTimezone = Rule
{ name = "<time> timezone"
, pattern =
[ Predicate $ and . sequence [isNotLatent, isATimeOfDay]
, regex "(بتوقيت |)?\\b(YEKT|YEKST|YAKT|YAKST|WITA|WIT|WIB|WGT|WGST|WFT|WET|WEST|WAT|WAST|VUT|VLAT|VLAST|VET|UZT|UYT|UYST|UTC|ULAT|TVT|TMT|TLT|TKT|TJT|TFT|TAHT|SST|SRT|SGT|SCT|SBT|SAST|SAMT|RE... | 1,101 | false | true | 0 | 20 | 100 | 140 | 73 | 67 | null | null |
Mokosha/Lambency | lib/Lambency/Shader/Expr.hs | mit | scale3f :: Expr (V3 Float) -> Expr Float -> Expr (V3 Float)
scale3f = binaryExpr (BinaryInfixOp Mult) | 101 | scale3f :: Expr (V3 Float) -> Expr Float -> Expr (V3 Float)
scale3f = binaryExpr (BinaryInfixOp Mult) | 101 | scale3f = binaryExpr (BinaryInfixOp Mult) | 41 | false | true | 0 | 9 | 16 | 49 | 23 | 26 | null | null |
PaulGustafson/stringnet | LocalMoves.hs | mit | ontractHelper :: Edge -> State Stringnet InteriorVertex
contractHelper contractedEdge = undefined
| 98 | contractHelper :: Edge -> State Stringnet InteriorVertex
contractHelper contractedEdge = undefined | 98 | contractHelper contractedEdge = undefined | 41 | false | true | 0 | 6 | 11 | 23 | 11 | 12 | null | null |
sherwoodwang/wxHaskell | wx/src/Graphics/UI/WX/Draw.hs | lgpl-2.1 | -- | Draw a single point.
drawPoint :: DC a -> Point -> [Prop (DC a)] -> IO ()
drawPoint dc center props
= dcWith dc props (dcDrawPoint dc center) | 149 | drawPoint :: DC a -> Point -> [Prop (DC a)] -> IO ()
drawPoint dc center props
= dcWith dc props (dcDrawPoint dc center) | 122 | drawPoint dc center props
= dcWith dc props (dcDrawPoint dc center) | 69 | true | true | 0 | 11 | 32 | 66 | 32 | 34 | null | null |
ComputationWithBoundedResources/ara-inference | doc/tpdb_trs/Haskell/basic_haskell/range_2.hs | mit | primMinusNat :: Nat -> Nat -> MyInt;
primMinusNat Zero Zero = Pos Zero | 74 | primMinusNat :: Nat -> Nat -> MyInt
primMinusNat Zero Zero = Pos Zero | 73 | primMinusNat Zero Zero = Pos Zero | 33 | false | true | 0 | 6 | 16 | 28 | 14 | 14 | null | null |
trskop/cabal | cabal-install/Distribution/Client/Config.hs | bsd-3-clause | -- We do per-user installs by default on all platforms. We used to default to
-- global installs on Windows but that no longer works on Windows Vista or 7.
defaultRemoteRepo :: RemoteRepo
defaultRemoteRepo = RemoteRepo name uri () False
where
name = "hackage.haskell.org"
uri = URI "http:" (Just (URIAuth "" ... | 1,096 | defaultRemoteRepo :: RemoteRepo
defaultRemoteRepo = RemoteRepo name uri () False
where
name = "hackage.haskell.org"
uri = URI "http:" (Just (URIAuth "" name "")) "/" "" ""
-- Note that lots of old ~/.cabal/config files will have the old url
-- http://hackage.haskell.org/packages/archive
-- but ne... | 939 | defaultRemoteRepo = RemoteRepo name uri () False
where
name = "hackage.haskell.org"
uri = URI "http:" (Just (URIAuth "" name "")) "/" "" ""
-- Note that lots of old ~/.cabal/config files will have the old url
-- http://hackage.haskell.org/packages/archive
-- but new config files can use the new u... | 907 | true | true | 1 | 9 | 228 | 79 | 47 | 32 | null | null |
Tener/HaNS | src/Hans/Layer.hs | bsd-3-clause | removeHandler :: (Ord k, ProvidesHandlers i k a) => k -> Layer i ()
removeHandler k = do
state <- get
let hs' = Map.delete k (getHandlers state)
hs' `seq` set (setHandlers hs' state) | 188 | removeHandler :: (Ord k, ProvidesHandlers i k a) => k -> Layer i ()
removeHandler k = do
state <- get
let hs' = Map.delete k (getHandlers state)
hs' `seq` set (setHandlers hs' state) | 188 | removeHandler k = do
state <- get
let hs' = Map.delete k (getHandlers state)
hs' `seq` set (setHandlers hs' state) | 120 | false | true | 0 | 12 | 39 | 93 | 45 | 48 | null | null |
DavidAlphaFox/ghc | libraries/Cabal/cabal-install/Main.hs | bsd-3-clause | unpackAction :: GetFlags -> [String] -> GlobalFlags -> IO ()
unpackAction getFlags extraArgs globalFlags = do
getAction getFlags extraArgs globalFlags | 152 | unpackAction :: GetFlags -> [String] -> GlobalFlags -> IO ()
unpackAction getFlags extraArgs globalFlags = do
getAction getFlags extraArgs globalFlags | 152 | unpackAction getFlags extraArgs globalFlags = do
getAction getFlags extraArgs globalFlags | 91 | false | true | 0 | 9 | 21 | 48 | 23 | 25 | null | null |
dmpots/fibon | tools/fibon-run/Fibon/Run/BenchmarkBundle.hs | bsd-3-clause | mkBundle :: RunConfig
-> FibonBenchmark
-> FilePath -- ^ working directory
-> FilePath -- ^ benchmarks directory
-> String -- ^ unique id
-> InputSize
-> TuneSetting
-> [(String, String)] -- ^ Environment variables
-> BenchmarkBundle
mkBundle rc ... | 897 | mkBundle :: RunConfig
-> FibonBenchmark
-> FilePath -- ^ working directory
-> FilePath -- ^ benchmarks directory
-> String -- ^ unique id
-> InputSize
-> TuneSetting
-> [(String, String)] -- ^ Environment variables
-> BenchmarkBundle
mkBundle rc ... | 897 | mkBundle rc bm wd bmsDir uniq size tune progEnv =
BenchmarkBundle {
benchmark = bm
, workDir = wd
, benchDir = bmsDir
, unique = uniq
, iters = (iterations rc)
, tuneSetting = tune
, inputSize = size
, fullFlags = flags configuration
, benc... | 589 | false | true | 0 | 14 | 300 | 201 | 114 | 87 | null | null |
olsner/m3 | CppToken.hs | bsd-3-clause | postfixOperators =
[("--",Decrement)
,("++",Increment)] | 63 | postfixOperators =
[("--",Decrement)
,("++",Increment)] | 63 | postfixOperators =
[("--",Decrement)
,("++",Increment)] | 63 | false | false | 0 | 6 | 11 | 24 | 15 | 9 | null | null |
christiaanb/ghc | compiler/coreSyn/CoreTidy.hs | bsd-3-clause | ------------ Case alternatives --------------
tidyAlt :: CoreBndr -> TidyEnv -> CoreAlt -> CoreAlt
tidyAlt _case_bndr env (con, vs, rhs)
= tidyBndrs env vs =: \ (env', vs) ->
(con, vs, tidyExpr env' rhs) | 214 | tidyAlt :: CoreBndr -> TidyEnv -> CoreAlt -> CoreAlt
tidyAlt _case_bndr env (con, vs, rhs)
= tidyBndrs env vs =: \ (env', vs) ->
(con, vs, tidyExpr env' rhs) | 166 | tidyAlt _case_bndr env (con, vs, rhs)
= tidyBndrs env vs =: \ (env', vs) ->
(con, vs, tidyExpr env' rhs) | 113 | true | true | 2 | 10 | 43 | 86 | 43 | 43 | null | null |
TC1211/TCP | src/3a/tester-src/Data/IterIO/Parse.hs | apache-2.0 | -
-- | @orI@ is a version of '<|>' with infinite backtracking, allowing
-- LL(*) instead of LL(1) parsing. @orI a b@ executes @a@, keeping a
-- copy of all input consumed. If @a@ throws an exception of class
-- 'IterNoParse' (e.g., by calling 'expectedI' or 'throwEOFI'), then
-- @b@ is executed on the same input.
--
... | 1,286 | orEmpty :: (ChunkData t, Monad m, Monoid b) =>
Iter t m a -> (a -> Iter t m b) -> Iter t m b
orEmpty = (\/ return mempty) | 132 | orEmpty = (\/ return mempty) | 28 | true | true | 1 | 10 | 292 | 186 | 110 | 76 | null | null |
alphaHeavy/cabal | cabal-install/Distribution/Client/Setup.hs | bsd-3-clause | parseRepo :: Parse.ReadP r RemoteRepo
parseRepo = do
name <- Parse.munch1 (\c -> isAlphaNum c || c `elem` "_-.")
_ <- Parse.char ':'
uriStr <- Parse.munch1 (\c -> isAlphaNum c || c `elem` "+-=._/*()@'$:;&!?~")
uri <- maybe Parse.pfail return (parseAbsoluteURI uriStr)
return $ RemoteRepo {
remoteRepoName =... | 355 | parseRepo :: Parse.ReadP r RemoteRepo
parseRepo = do
name <- Parse.munch1 (\c -> isAlphaNum c || c `elem` "_-.")
_ <- Parse.char ':'
uriStr <- Parse.munch1 (\c -> isAlphaNum c || c `elem` "+-=._/*()@'$:;&!?~")
uri <- maybe Parse.pfail return (parseAbsoluteURI uriStr)
return $ RemoteRepo {
remoteRepoName =... | 355 | parseRepo = do
name <- Parse.munch1 (\c -> isAlphaNum c || c `elem` "_-.")
_ <- Parse.char ':'
uriStr <- Parse.munch1 (\c -> isAlphaNum c || c `elem` "+-=._/*()@'$:;&!?~")
uri <- maybe Parse.pfail return (parseAbsoluteURI uriStr)
return $ RemoteRepo {
remoteRepoName = name,
remoteRepoURI = uri
} | 317 | false | true | 0 | 13 | 72 | 139 | 70 | 69 | null | null |
urbanslug/ghc | compiler/typecheck/TcGenDeriv.hs | bsd-3-clause | leDouble_RDR = varQual_RDR gHC_PRIM (fsLit "<=##") | 53 | leDouble_RDR = varQual_RDR gHC_PRIM (fsLit "<=##") | 53 | leDouble_RDR = varQual_RDR gHC_PRIM (fsLit "<=##") | 53 | false | false | 0 | 7 | 8 | 17 | 8 | 9 | null | null |
vTurbine/ghc | compiler/cmm/PprC.hs | bsd-3-clause | wordShift :: DynFlags -> Int
wordShift dflags = widthInLog (wordWidth dflags) | 77 | wordShift :: DynFlags -> Int
wordShift dflags = widthInLog (wordWidth dflags) | 77 | wordShift dflags = widthInLog (wordWidth dflags) | 48 | false | true | 0 | 7 | 10 | 27 | 13 | 14 | null | null |
christiaanb/Idris-dev | src/IRTS/LParser.hs | bsd-3-clause | whiteSpace= PTok.whiteSpace lexer | 33 | whiteSpace= PTok.whiteSpace lexer | 33 | whiteSpace= PTok.whiteSpace lexer | 33 | false | false | 0 | 6 | 2 | 11 | 5 | 6 | null | null |
bixuanzju/fcore | lib/Inliner.hs | bsd-2-clause | inliner (JNew name es) = JNew name (map inliner es) | 51 | inliner (JNew name es) = JNew name (map inliner es) | 51 | inliner (JNew name es) = JNew name (map inliner es) | 51 | false | false | 0 | 7 | 9 | 30 | 14 | 16 | null | null |
Numberartificial/workflow | haskell-first-principles/haskell-programming-from-first-principles-master/src/Addition.hs | mit | dividedBy :: Integral a => a -> a -> (a, a)
dividedBy num denom = go num denom 0
where go n d count | n < d = (count, n)
| otherwise = go (n - d) d (count + 1) | 199 | dividedBy :: Integral a => a -> a -> (a, a)
dividedBy num denom = go num denom 0
where go n d count | n < d = (count, n)
| otherwise = go (n - d) d (count + 1) | 199 | dividedBy num denom = go num denom 0
where go n d count | n < d = (count, n)
| otherwise = go (n - d) d (count + 1) | 155 | false | true | 0 | 10 | 81 | 117 | 55 | 62 | null | null |
nushio3/ghc | compiler/types/Coercion.hs | bsd-3-clause | coercionSize (AxiomInstCo _ _ args) = 1 + sum (map coercionSize args) | 69 | coercionSize (AxiomInstCo _ _ args) = 1 + sum (map coercionSize args) | 69 | coercionSize (AxiomInstCo _ _ args) = 1 + sum (map coercionSize args) | 69 | false | false | 0 | 8 | 11 | 34 | 16 | 18 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.