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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rabipelais/record-gl
|
src/Graphics/RecordGL/Uniforms.hs
|
bsd-3-clause
|
-- | Set GLSL uniform parameters from a 'Record'. A check is
-- performed to verify that /all/ uniforms used by a program are
-- represented by the record type. In other words, the record is a
-- superset of the parameters used by the program.
setAllUniforms :: forall record. UniformFields record
=> ShaderProgram -> record -> IO ()
setAllUniforms s r = case checks of
Left msg -> error msg
Right _ -> setUniformFields locs r
where
fnames = fieldNames r
checks = do
namesCheck "record" (M.keys $ uniforms s) fnames
typesCheck True (snd <$> uniforms s) fieldTypes
fieldTypes = M.fromList $ zip fnames (fieldGLTypes r)
locs = map (fmap fst . (`M.lookup` uniforms s)) fnames
-- | Set GLSL uniform parameters form a `Record` representing
-- a subset of all uniform parameters used by a program.
| 878 |
setAllUniforms :: forall record. UniformFields record
=> ShaderProgram -> record -> IO ()
setAllUniforms s r = case checks of
Left msg -> error msg
Right _ -> setUniformFields locs r
where
fnames = fieldNames r
checks = do
namesCheck "record" (M.keys $ uniforms s) fnames
typesCheck True (snd <$> uniforms s) fieldTypes
fieldTypes = M.fromList $ zip fnames (fieldGLTypes r)
locs = map (fmap fst . (`M.lookup` uniforms s)) fnames
-- | Set GLSL uniform parameters form a `Record` representing
-- a subset of all uniform parameters used by a program.
| 634 |
setAllUniforms s r = case checks of
Left msg -> error msg
Right _ -> setUniformFields locs r
where
fnames = fieldNames r
checks = do
namesCheck "record" (M.keys $ uniforms s) fnames
typesCheck True (snd <$> uniforms s) fieldTypes
fieldTypes = M.fromList $ zip fnames (fieldGLTypes r)
locs = map (fmap fst . (`M.lookup` uniforms s)) fnames
-- | Set GLSL uniform parameters form a `Record` representing
-- a subset of all uniform parameters used by a program.
| 532 | true | true | 0 | 10 | 224 | 188 | 94 | 94 | null | null |
cmc-haskell-2016/checkers
|
src/GraphicsProcessing.hs
|
bsd-3-clause
|
-- just a constant
stepsPerSecond :: Int
stepsPerSecond = 2
| 59 |
stepsPerSecond :: Int
stepsPerSecond = 2
| 40 |
stepsPerSecond = 2
| 18 | true | true | 0 | 4 | 9 | 12 | 7 | 5 | null | null |
lukexi/ghc
|
libraries/base/Data/Maybe.hs
|
bsd-3-clause
|
-- | The 'listToMaybe' function returns 'Nothing' on an empty list
-- or @'Just' a@ where @a@ is the first element of the list.
listToMaybe :: [a] -> Maybe a
listToMaybe [] = Nothing
| 200 |
listToMaybe :: [a] -> Maybe a
listToMaybe [] = Nothing
| 72 |
listToMaybe [] = Nothing
| 32 | true | true | 0 | 8 | 51 | 33 | 16 | 17 | null | null |
fros1y/umbral
|
src/Color.hs
|
bsd-3-clause
|
byName "rosy brown" = fromTuple (188,143,143)
| 45 |
byName "rosy brown" = fromTuple (188,143,143)
| 45 |
byName "rosy brown" = fromTuple (188,143,143)
| 45 | false | false | 1 | 6 | 5 | 24 | 11 | 13 | null | null |
TueHaulund/ROOPLC
|
src/CodeGenerator.hs
|
mit
|
cgStatement (LocalCall m args) = cgLocalCall m args
| 51 |
cgStatement (LocalCall m args) = cgLocalCall m args
| 51 |
cgStatement (LocalCall m args) = cgLocalCall m args
| 51 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
CindyLinz/GCryptDrive
|
src/My/Serialize.hs
|
mit
|
decodeDir :: (MonadThrow m, MonadIO m) => Entry -> Conduit B.ByteString m Entry
decodeDir entry = go decoder0 where
decoder0 = runGetIncremental (decodeEntry (entryVer entry))
go decoder = do
await >>= \case
Just seg -> case pushChunk decoder seg of
Fail _ _ _ -> throwM UnrecognizeFormatException
Done remain _ entry -> do
yield entry
leftover remain
go decoder0
next -> go next
_ -> return ()
| 468 |
decodeDir :: (MonadThrow m, MonadIO m) => Entry -> Conduit B.ByteString m Entry
decodeDir entry = go decoder0 where
decoder0 = runGetIncremental (decodeEntry (entryVer entry))
go decoder = do
await >>= \case
Just seg -> case pushChunk decoder seg of
Fail _ _ _ -> throwM UnrecognizeFormatException
Done remain _ entry -> do
yield entry
leftover remain
go decoder0
next -> go next
_ -> return ()
| 468 |
decodeDir entry = go decoder0 where
decoder0 = runGetIncremental (decodeEntry (entryVer entry))
go decoder = do
await >>= \case
Just seg -> case pushChunk decoder seg of
Fail _ _ _ -> throwM UnrecognizeFormatException
Done remain _ entry -> do
yield entry
leftover remain
go decoder0
next -> go next
_ -> return ()
| 388 | false | true | 2 | 17 | 140 | 181 | 78 | 103 | null | null |
sheganinans/authy
|
src/Authy.hs
|
mit
|
-------------------------------------------------------------------------------
newUserResponseParser :: Value -> Parser (Either (String, [String]) Int)
newUserResponseParser = withObject "new user response" $ \obj -> do
success <- obj .: "success"
case success of
True -> do
user <- obj .: "user"
user_id <- user .: "id"
return $ Right user_id
False -> do
message <- obj .: "message"
errors <- obj .: "errors" :: Parser Object
let invalid = [unpack key | (key, valid) <- zip keys (map (`HM.member` errors) keys), valid]
return $ Left (message, invalid)
where
keys = ["email", "cellphone", "country_code"]
-- | Enable two-factor authentication on a user.
| 786 |
newUserResponseParser :: Value -> Parser (Either (String, [String]) Int)
newUserResponseParser = withObject "new user response" $ \obj -> do
success <- obj .: "success"
case success of
True -> do
user <- obj .: "user"
user_id <- user .: "id"
return $ Right user_id
False -> do
message <- obj .: "message"
errors <- obj .: "errors" :: Parser Object
let invalid = [unpack key | (key, valid) <- zip keys (map (`HM.member` errors) keys), valid]
return $ Left (message, invalid)
where
keys = ["email", "cellphone", "country_code"]
-- | Enable two-factor authentication on a user.
| 705 |
newUserResponseParser = withObject "new user response" $ \obj -> do
success <- obj .: "success"
case success of
True -> do
user <- obj .: "user"
user_id <- user .: "id"
return $ Right user_id
False -> do
message <- obj .: "message"
errors <- obj .: "errors" :: Parser Object
let invalid = [unpack key | (key, valid) <- zip keys (map (`HM.member` errors) keys), valid]
return $ Left (message, invalid)
where
keys = ["email", "cellphone", "country_code"]
-- | Enable two-factor authentication on a user.
| 632 | true | true | 0 | 25 | 227 | 234 | 116 | 118 | null | null |
d-day/relation
|
include/pointfree-style/pointfree-1.0.4.3/Plugin/Pl/Rules.hs
|
bsd-3-clause
|
nilE = Quote $ Var Pref "[]"
| 34 |
nilE = Quote $ Var Pref "[]"
| 34 |
nilE = Quote $ Var Pref "[]"
| 34 | false | false | 0 | 6 | 12 | 15 | 7 | 8 | null | null |
alexander-at-github/eta
|
compiler/ETA/Prelude/PrimOp.hs
|
bsd-3-clause
|
primOpInfo ResizeMutableByteArrayOp_Char = mkGenPrimOp (fsLit "resizeMutableByteArray#") [deltaTyVar] [mkMutableByteArrayPrimTy deltaTy, intPrimTy, mkStatePrimTy deltaTy] ((mkTupleTy UnboxedTuple [mkStatePrimTy deltaTy, mkMutableByteArrayPrimTy deltaTy]))
| 256 |
primOpInfo ResizeMutableByteArrayOp_Char = mkGenPrimOp (fsLit "resizeMutableByteArray#") [deltaTyVar] [mkMutableByteArrayPrimTy deltaTy, intPrimTy, mkStatePrimTy deltaTy] ((mkTupleTy UnboxedTuple [mkStatePrimTy deltaTy, mkMutableByteArrayPrimTy deltaTy]))
| 256 |
primOpInfo ResizeMutableByteArrayOp_Char = mkGenPrimOp (fsLit "resizeMutableByteArray#") [deltaTyVar] [mkMutableByteArrayPrimTy deltaTy, intPrimTy, mkStatePrimTy deltaTy] ((mkTupleTy UnboxedTuple [mkStatePrimTy deltaTy, mkMutableByteArrayPrimTy deltaTy]))
| 256 | false | false | 0 | 10 | 18 | 65 | 33 | 32 | null | null |
cjp256/manager
|
xenmgr/Vm/Queries.hs
|
gpl-2.0
|
getRunningHDX :: Rpc [Uuid]
getRunningHDX = do
filterM isRunning =<< getVmsBy isHDX
where
isHDX uuid = getVmGraphics uuid >>= return . (== HDX)
| 157 |
getRunningHDX :: Rpc [Uuid]
getRunningHDX = do
filterM isRunning =<< getVmsBy isHDX
where
isHDX uuid = getVmGraphics uuid >>= return . (== HDX)
| 157 |
getRunningHDX = do
filterM isRunning =<< getVmsBy isHDX
where
isHDX uuid = getVmGraphics uuid >>= return . (== HDX)
| 129 | false | true | 1 | 8 | 36 | 65 | 28 | 37 | null | null |
alexander-at-github/eta
|
compiler/ETA/CodeGen/Expr.hs
|
bsd-3-clause
|
cgExpr (StgLit lit) = emitReturn [mkLocDirect False $ cgLit lit]
| 64 |
cgExpr (StgLit lit) = emitReturn [mkLocDirect False $ cgLit lit]
| 64 |
cgExpr (StgLit lit) = emitReturn [mkLocDirect False $ cgLit lit]
| 64 | false | false | 0 | 8 | 9 | 32 | 14 | 18 | null | null |
jvilar/hrows
|
lib/Model/Field.hs
|
gpl-2.0
|
nmap _ op (ADouble d _) = toField $ op d
| 40 |
nmap _ op (ADouble d _) = toField $ op d
| 40 |
nmap _ op (ADouble d _) = toField $ op d
| 40 | false | false | 1 | 7 | 10 | 30 | 13 | 17 | null | null |
shlevy/ghc
|
libraries/base/GHC/IO/Handle.hs
|
bsd-3-clause
|
hGetEncoding :: Handle -> IO (Maybe TextEncoding)
hGetEncoding hdl =
withHandle_ "hGetEncoding" hdl $ \h_@Handle__{..} -> return haCodec
| 138 |
hGetEncoding :: Handle -> IO (Maybe TextEncoding)
hGetEncoding hdl =
withHandle_ "hGetEncoding" hdl $ \h_@Handle__{..} -> return haCodec
| 138 |
hGetEncoding hdl =
withHandle_ "hGetEncoding" hdl $ \h_@Handle__{..} -> return haCodec
| 88 | false | true | 0 | 9 | 19 | 58 | 27 | 31 | null | null |
hvr/jhc
|
src/GenUtil.hs
|
mit
|
chunk :: Int -> [a] -> [[a]]
chunk 0 _ = repeat []
| 51 |
chunk :: Int -> [a] -> [[a]]
chunk 0 _ = repeat []
| 51 |
chunk 0 _ = repeat []
| 22 | false | true | 0 | 8 | 13 | 38 | 20 | 18 | null | null |
ku-fpg/marked-pretty
|
src/Text/PrettyPrint/MarkedHughesPJ.hs
|
bsd-3-clause
|
mkNest 0 p = p
| 30 |
mkNest 0 p = p
| 30 |
mkNest 0 p = p
| 30 | false | false | 0 | 5 | 20 | 11 | 5 | 6 | null | null |
AshyIsMe/osxmonad
|
OSXMonad/Keys.hs
|
bsd-3-clause
|
-- TODO: 0x3F
osxKeyToX11 0x40 = xK_F17
| 39 |
osxKeyToX11 0x40 = xK_F17
| 25 |
osxKeyToX11 0x40 = xK_F17
| 25 | true | false | 0 | 5 | 6 | 10 | 5 | 5 | null | null |
markcwhitfield/nunavut
|
test/Nunavut/Layer/WeightsSpec.hs
|
mit
|
spec :: Spec
spec = do
let doBackprop w e datum conf =
let pData = PData [datum] []
rws = backpropW w e
in case evalRWST rws conf ([], pData) of
Right (res, _) -> res `seq` True
_ -> False
describe "propW" $ do
isTotal2 (\w sig -> isRight . fmap fst $ evalRWST (propW w sig) () ())
it "suceeds on dimension match" $ property $
\(MatchMV w sig) -> isRight . fmap fst $ evalRWST (propW w sig) () ()
describe "backpropW" $ do
isTotal4 doBackprop
it "succeeds on dimension match" $ property $
\(MatchVM (MatchVV datum e) w) conf ->
doBackprop w e datum conf
| 657 |
spec :: Spec
spec = do
let doBackprop w e datum conf =
let pData = PData [datum] []
rws = backpropW w e
in case evalRWST rws conf ([], pData) of
Right (res, _) -> res `seq` True
_ -> False
describe "propW" $ do
isTotal2 (\w sig -> isRight . fmap fst $ evalRWST (propW w sig) () ())
it "suceeds on dimension match" $ property $
\(MatchMV w sig) -> isRight . fmap fst $ evalRWST (propW w sig) () ()
describe "backpropW" $ do
isTotal4 doBackprop
it "succeeds on dimension match" $ property $
\(MatchVM (MatchVV datum e) w) conf ->
doBackprop w e datum conf
| 657 |
spec = do
let doBackprop w e datum conf =
let pData = PData [datum] []
rws = backpropW w e
in case evalRWST rws conf ([], pData) of
Right (res, _) -> res `seq` True
_ -> False
describe "propW" $ do
isTotal2 (\w sig -> isRight . fmap fst $ evalRWST (propW w sig) () ())
it "suceeds on dimension match" $ property $
\(MatchMV w sig) -> isRight . fmap fst $ evalRWST (propW w sig) () ()
describe "backpropW" $ do
isTotal4 doBackprop
it "succeeds on dimension match" $ property $
\(MatchVM (MatchVV datum e) w) conf ->
doBackprop w e datum conf
| 644 | false | true | 0 | 16 | 213 | 281 | 135 | 146 | null | null |
ltfschoen/HelloHaskell
|
src/Chapter2/Section2/Countdown.hs
|
mit
|
showtime :: Integer -> String
showtime t = showFFloat (Just 3)
(fromIntegral t / (10^12)) " seconds"
| 181 |
showtime :: Integer -> String
showtime t = showFFloat (Just 3)
(fromIntegral t / (10^12)) " seconds"
| 179 |
showtime t = showFFloat (Just 3)
(fromIntegral t / (10^12)) " seconds"
| 128 | false | true | 0 | 9 | 97 | 48 | 24 | 24 | null | null |
nickgeoca/idris-py
|
src/IRTS/CodegenPython.hs
|
bsd-3-clause
|
cgExp tailPos (DLet n v e) = do
emit . cgAssignN n =<< cgExp False v
cgExp tailPos e
| 92 |
cgExp tailPos (DLet n v e) = do
emit . cgAssignN n =<< cgExp False v
cgExp tailPos e
| 92 |
cgExp tailPos (DLet n v e) = do
emit . cgAssignN n =<< cgExp False v
cgExp tailPos e
| 92 | false | false | 0 | 9 | 26 | 48 | 21 | 27 | null | null |
mreid/papersite
|
src/exec/MainJournal.hs
|
mit
|
where expandRegex v = [v++"/", v++".bib"]
| 41 |
where expandRegex v = [v++"/", v++".bib"]
| 41 |
where expandRegex v = [v++"/", v++".bib"]
| 41 | false | false | 0 | 6 | 5 | 25 | 13 | 12 | null | null |
google/haskell-indexer
|
haskell-indexer-backend-ghc/testdata/basic/TypeClassRef.hs
|
apache-2.0
|
called x = x
| 12 |
called x = x
| 12 |
called x = x
| 12 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
mimi1vx/gtk2hs
|
tools/apiGen/src/Api.hs
|
gpl-3.0
|
extractBoxed _ = Nothing
| 24 |
extractBoxed _ = Nothing
| 24 |
extractBoxed _ = Nothing
| 24 | false | false | 0 | 4 | 3 | 10 | 4 | 6 | null | null |
ezyang/ghc
|
compiler/simplCore/OccurAnal.hs
|
bsd-3-clause
|
-- effectively sets to noOccInfo
lookupDetails :: UsageDetails -> Id -> OccInfo
lookupDetails ud id
= case lookupVarEnv (ud_env ud) id of
Just occ -> doZapping ud id occ
Nothing -> IAmDead
| 204 |
lookupDetails :: UsageDetails -> Id -> OccInfo
lookupDetails ud id
= case lookupVarEnv (ud_env ud) id of
Just occ -> doZapping ud id occ
Nothing -> IAmDead
| 170 |
lookupDetails ud id
= case lookupVarEnv (ud_env ud) id of
Just occ -> doZapping ud id occ
Nothing -> IAmDead
| 123 | true | true | 0 | 8 | 47 | 62 | 30 | 32 | null | null |
felipeZ/Dynamics
|
src/ParsecText.hs
|
bsd-3-clause
|
-- Parse a blank line as a whole into a string
blankLine :: MyParser st String
blankLine = manyTill space newline
| 113 |
blankLine :: MyParser st String
blankLine = manyTill space newline
| 66 |
blankLine = manyTill space newline
| 34 | true | true | 0 | 5 | 20 | 22 | 11 | 11 | null | null |
jwiegley/ghc-release
|
libraries/Cabal/cabal/Distribution/Simple/Setup.hs
|
gpl-3.0
|
replCommand :: ProgramConfiguration -> CommandUI ReplFlags
replCommand progConf = CommandUI {
commandName = "repl",
commandSynopsis = "Open an interpreter session for the given target.",
commandDescription = Just $ \pname ->
"Examples:\n"
++ " " ++ pname ++ " repl "
++ " The first component in the package\n"
++ " " ++ pname ++ " repl foo "
++ " A named component (i.e. lib, exe, test suite)\n",
--TODO: re-enable once we have support for module/file targets
-- ++ " " ++ pname ++ " repl Foo.Bar "
-- ++ " A module\n"
-- ++ " " ++ pname ++ " repl Foo/Bar.hs"
-- ++ " A file\n\n"
-- ++ "If a target is ambigious it can be qualified with the component "
-- ++ "name, e.g.\n"
-- ++ " " ++ pname ++ " repl foo:Foo.Bar\n"
-- ++ " " ++ pname ++ " repl testsuite1:Foo/Bar.hs\n"
commandUsage = \pname -> "Usage: " ++ pname ++ " repl [FILENAME] [FLAGS]\n",
commandDefaultFlags = defaultReplFlags,
commandOptions = \showOrParseArgs ->
optionVerbosity replVerbosity (\v flags -> flags { replVerbosity = v })
: optionDistPref
replDistPref (\d flags -> flags { replDistPref = d })
showOrParseArgs
: programConfigurationPaths progConf showOrParseArgs
replProgramPaths (\v flags -> flags { replProgramPaths = v})
++ programConfigurationOption progConf showOrParseArgs
replProgramArgs (\v flags -> flags { replProgramArgs = v})
++ programConfigurationOptions progConf showOrParseArgs
replProgramArgs (\v flags -> flags { replProgramArgs = v})
++ case showOrParseArgs of
ParseArgs ->
[ option "" ["reload"]
"Used from within an interpreter to update files."
replReload (\v flags -> flags { replReload = v })
trueArg
]
_ -> []
}
| 1,960 |
replCommand :: ProgramConfiguration -> CommandUI ReplFlags
replCommand progConf = CommandUI {
commandName = "repl",
commandSynopsis = "Open an interpreter session for the given target.",
commandDescription = Just $ \pname ->
"Examples:\n"
++ " " ++ pname ++ " repl "
++ " The first component in the package\n"
++ " " ++ pname ++ " repl foo "
++ " A named component (i.e. lib, exe, test suite)\n",
--TODO: re-enable once we have support for module/file targets
-- ++ " " ++ pname ++ " repl Foo.Bar "
-- ++ " A module\n"
-- ++ " " ++ pname ++ " repl Foo/Bar.hs"
-- ++ " A file\n\n"
-- ++ "If a target is ambigious it can be qualified with the component "
-- ++ "name, e.g.\n"
-- ++ " " ++ pname ++ " repl foo:Foo.Bar\n"
-- ++ " " ++ pname ++ " repl testsuite1:Foo/Bar.hs\n"
commandUsage = \pname -> "Usage: " ++ pname ++ " repl [FILENAME] [FLAGS]\n",
commandDefaultFlags = defaultReplFlags,
commandOptions = \showOrParseArgs ->
optionVerbosity replVerbosity (\v flags -> flags { replVerbosity = v })
: optionDistPref
replDistPref (\d flags -> flags { replDistPref = d })
showOrParseArgs
: programConfigurationPaths progConf showOrParseArgs
replProgramPaths (\v flags -> flags { replProgramPaths = v})
++ programConfigurationOption progConf showOrParseArgs
replProgramArgs (\v flags -> flags { replProgramArgs = v})
++ programConfigurationOptions progConf showOrParseArgs
replProgramArgs (\v flags -> flags { replProgramArgs = v})
++ case showOrParseArgs of
ParseArgs ->
[ option "" ["reload"]
"Used from within an interpreter to update files."
replReload (\v flags -> flags { replReload = v })
trueArg
]
_ -> []
}
| 1,960 |
replCommand progConf = CommandUI {
commandName = "repl",
commandSynopsis = "Open an interpreter session for the given target.",
commandDescription = Just $ \pname ->
"Examples:\n"
++ " " ++ pname ++ " repl "
++ " The first component in the package\n"
++ " " ++ pname ++ " repl foo "
++ " A named component (i.e. lib, exe, test suite)\n",
--TODO: re-enable once we have support for module/file targets
-- ++ " " ++ pname ++ " repl Foo.Bar "
-- ++ " A module\n"
-- ++ " " ++ pname ++ " repl Foo/Bar.hs"
-- ++ " A file\n\n"
-- ++ "If a target is ambigious it can be qualified with the component "
-- ++ "name, e.g.\n"
-- ++ " " ++ pname ++ " repl foo:Foo.Bar\n"
-- ++ " " ++ pname ++ " repl testsuite1:Foo/Bar.hs\n"
commandUsage = \pname -> "Usage: " ++ pname ++ " repl [FILENAME] [FLAGS]\n",
commandDefaultFlags = defaultReplFlags,
commandOptions = \showOrParseArgs ->
optionVerbosity replVerbosity (\v flags -> flags { replVerbosity = v })
: optionDistPref
replDistPref (\d flags -> flags { replDistPref = d })
showOrParseArgs
: programConfigurationPaths progConf showOrParseArgs
replProgramPaths (\v flags -> flags { replProgramPaths = v})
++ programConfigurationOption progConf showOrParseArgs
replProgramArgs (\v flags -> flags { replProgramArgs = v})
++ programConfigurationOptions progConf showOrParseArgs
replProgramArgs (\v flags -> flags { replProgramArgs = v})
++ case showOrParseArgs of
ParseArgs ->
[ option "" ["reload"]
"Used from within an interpreter to update files."
replReload (\v flags -> flags { replReload = v })
trueArg
]
_ -> []
}
| 1,901 | false | true | 0 | 17 | 612 | 331 | 187 | 144 | null | null |
mfpi/OpenGLRaw
|
src/Graphics/Rendering/OpenGL/Raw/Core31/Tokens.hs
|
bsd-3-clause
|
gl_RGBA16 :: GLenum
gl_RGBA16 = 0x805B
| 38 |
gl_RGBA16 :: GLenum
gl_RGBA16 = 0x805B
| 38 |
gl_RGBA16 = 0x805B
| 18 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
fmapfmapfmap/amazonka
|
amazonka-ecs/gen/Network/AWS/ECS/ListTaskDefinitions.hs
|
mpl-2.0
|
-- | Creates a value of 'ListTaskDefinitionsResponse' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'ltdrsTaskDefinitionARNs'
--
-- * 'ltdrsNextToken'
--
-- * 'ltdrsResponseStatus'
listTaskDefinitionsResponse
:: Int -- ^ 'ltdrsResponseStatus'
-> ListTaskDefinitionsResponse
listTaskDefinitionsResponse pResponseStatus_ =
ListTaskDefinitionsResponse'
{ _ltdrsTaskDefinitionARNs = Nothing
, _ltdrsNextToken = Nothing
, _ltdrsResponseStatus = pResponseStatus_
}
| 573 |
listTaskDefinitionsResponse
:: Int -- ^ 'ltdrsResponseStatus'
-> ListTaskDefinitionsResponse
listTaskDefinitionsResponse pResponseStatus_ =
ListTaskDefinitionsResponse'
{ _ltdrsTaskDefinitionARNs = Nothing
, _ltdrsNextToken = Nothing
, _ltdrsResponseStatus = pResponseStatus_
}
| 305 |
listTaskDefinitionsResponse pResponseStatus_ =
ListTaskDefinitionsResponse'
{ _ltdrsTaskDefinitionARNs = Nothing
, _ltdrsNextToken = Nothing
, _ltdrsResponseStatus = pResponseStatus_
}
| 204 | true | true | 0 | 7 | 94 | 57 | 34 | 23 | null | null |
GaloisInc/mistral
|
src/Mistral/CodeGen/LambdaLift.hs
|
bsd-3-clause
|
paramClosure :: [Param] -> Closure
paramClosure ps = Map.fromList [ (n,ty) | Param n ty <- ps ]
| 95 |
paramClosure :: [Param] -> Closure
paramClosure ps = Map.fromList [ (n,ty) | Param n ty <- ps ]
| 95 |
paramClosure ps = Map.fromList [ (n,ty) | Param n ty <- ps ]
| 60 | false | true | 0 | 9 | 17 | 48 | 25 | 23 | null | null |
alessandroleite/hephaestus-pl
|
src/meta-hephaestus/HplDrivers/BuildCodeProduct.hs
|
lgpl-3.0
|
main = buildHpl fcDtmc
where
fcDtmc = FeatureConfiguration
$ Root
(f { fId = "HephaestusPL-Code" })
[
Root
(f { fId = "SPLAsset" }) [Leaf $ f { fId = "Code" }]
]
-- To turn off warnings
f = Feature {
fId = undefined,
fName = undefined,
fType = undefined,
groupType = undefined,
properties = undefined
}
| 398 |
main = buildHpl fcDtmc
where
fcDtmc = FeatureConfiguration
$ Root
(f { fId = "HephaestusPL-Code" })
[
Root
(f { fId = "SPLAsset" }) [Leaf $ f { fId = "Code" }]
]
-- To turn off warnings
f = Feature {
fId = undefined,
fName = undefined,
fType = undefined,
groupType = undefined,
properties = undefined
}
| 398 |
main = buildHpl fcDtmc
where
fcDtmc = FeatureConfiguration
$ Root
(f { fId = "HephaestusPL-Code" })
[
Root
(f { fId = "SPLAsset" }) [Leaf $ f { fId = "Code" }]
]
-- To turn off warnings
f = Feature {
fId = undefined,
fName = undefined,
fType = undefined,
groupType = undefined,
properties = undefined
}
| 398 | false | false | 0 | 12 | 153 | 109 | 64 | 45 | null | null |
sbditto85/parsedsltest
|
test/Generators.hs
|
apache-2.0
|
genStrConcatToParsed (StrConcat str rest) = StrConcat (trimQuotes $ replaceSlash str) (genStrConcatToParsed rest)
| 113 |
genStrConcatToParsed (StrConcat str rest) = StrConcat (trimQuotes $ replaceSlash str) (genStrConcatToParsed rest)
| 113 |
genStrConcatToParsed (StrConcat str rest) = StrConcat (trimQuotes $ replaceSlash str) (genStrConcatToParsed rest)
| 113 | false | false | 0 | 8 | 11 | 38 | 18 | 20 | null | null |
gafiatulin/codewars
|
src/7 kyu/AddingParameters.hs
|
mit
|
add :: Num a => [a] -> a
add = fst . foldl (\(s, m) v -> (s + m * v, m + 1) ) (0, 1)
| 85 |
add :: Num a => [a] -> a
add = fst . foldl (\(s, m) v -> (s + m * v, m + 1) ) (0, 1)
| 85 |
add = fst . foldl (\(s, m) v -> (s + m * v, m + 1) ) (0, 1)
| 60 | false | true | 1 | 10 | 28 | 82 | 42 | 40 | null | null |
jgoerzen/hslogger
|
src/System/Log/Handler/Growl.hs
|
bsd-3-clause
|
-- Takes a Service record and generates a network packet
-- representing the service.
buildRegistration :: GrowlHandler -> String
buildRegistration s = concat fields
where fields = [ ['\x1', '\x4'],
emitLen16 (appName s),
emitLen8 appNotes,
emitLen8 appNotes,
appName s,
foldl packIt [] appNotes,
['\x0' .. (chr (length appNotes - 1))] ]
packIt a b = a ++ (emitLen16 b) ++ b
appNotes = [ nmGeneralMsg, nmClosingMsg ]
emitLen8 v = [chr $ length v]
{- | Adds a remote machine's address to the list of targets that will
receive log messages. Calling this function sends a registration
packet to the machine. This function will throw an exception if
the host name cannot be found. -}
| 856 |
buildRegistration :: GrowlHandler -> String
buildRegistration s = concat fields
where fields = [ ['\x1', '\x4'],
emitLen16 (appName s),
emitLen8 appNotes,
emitLen8 appNotes,
appName s,
foldl packIt [] appNotes,
['\x0' .. (chr (length appNotes - 1))] ]
packIt a b = a ++ (emitLen16 b) ++ b
appNotes = [ nmGeneralMsg, nmClosingMsg ]
emitLen8 v = [chr $ length v]
{- | Adds a remote machine's address to the list of targets that will
receive log messages. Calling this function sends a registration
packet to the machine. This function will throw an exception if
the host name cannot be found. -}
| 769 |
buildRegistration s = concat fields
where fields = [ ['\x1', '\x4'],
emitLen16 (appName s),
emitLen8 appNotes,
emitLen8 appNotes,
appName s,
foldl packIt [] appNotes,
['\x0' .. (chr (length appNotes - 1))] ]
packIt a b = a ++ (emitLen16 b) ++ b
appNotes = [ nmGeneralMsg, nmClosingMsg ]
emitLen8 v = [chr $ length v]
{- | Adds a remote machine's address to the list of targets that will
receive log messages. Calling this function sends a registration
packet to the machine. This function will throw an exception if
the host name cannot be found. -}
| 725 | true | true | 6 | 11 | 291 | 181 | 87 | 94 | null | null |
urbanslug/ghc
|
testsuite/tests/typecheck/should_fail/T9858b.hs
|
bsd-3-clause
|
test = typeRep (Proxy :: Proxy (Eq Int => Int))
| 47 |
test = typeRep (Proxy :: Proxy (Eq Int => Int))
| 47 |
test = typeRep (Proxy :: Proxy (Eq Int => Int))
| 47 | false | false | 1 | 9 | 9 | 31 | 14 | 17 | null | null |
katydid/nwe
|
src/Grammar.hs
|
bsd-3-clause
|
nullable refs (Concat l r) = nullable refs l && nullable refs r
| 63 |
nullable refs (Concat l r) = nullable refs l && nullable refs r
| 63 |
nullable refs (Concat l r) = nullable refs l && nullable refs r
| 63 | false | false | 0 | 7 | 12 | 33 | 15 | 18 | null | null |
Danten/lejf
|
src/Types/Rules.hs
|
bsd-3-clause
|
tcArg :: Arg -> NType -> TC NType
tcArg (Push v) n_orig = do
(p, n) <- unpackNeg _Fun n_orig $ PushArgumentToNoFun v
tcVal v p
pure n
| 139 |
tcArg :: Arg -> NType -> TC NType
tcArg (Push v) n_orig = do
(p, n) <- unpackNeg _Fun n_orig $ PushArgumentToNoFun v
tcVal v p
pure n
| 139 |
tcArg (Push v) n_orig = do
(p, n) <- unpackNeg _Fun n_orig $ PushArgumentToNoFun v
tcVal v p
pure n
| 105 | false | true | 0 | 9 | 33 | 72 | 33 | 39 | null | null |
gridaphobe/target
|
bench/MapBench.hs
|
mit
|
prop_difference_lsc :: Int -> M -> M -> Bool
prop_difference_lsc d x y = (hasDepth d x || hasDepth d y) && valid x && valid y
LSC.==> (unsafePerformIO $
case valid z && keys z == (keys x L.\\ keys y) of
True -> LSC.decValidCounter >> return True
False -> return False
)
where z = difference x y
| 315 |
prop_difference_lsc :: Int -> M -> M -> Bool
prop_difference_lsc d x y = (hasDepth d x || hasDepth d y) && valid x && valid y
LSC.==> (unsafePerformIO $
case valid z && keys z == (keys x L.\\ keys y) of
True -> LSC.decValidCounter >> return True
False -> return False
)
where z = difference x y
| 315 |
prop_difference_lsc d x y = (hasDepth d x || hasDepth d y) && valid x && valid y
LSC.==> (unsafePerformIO $
case valid z && keys z == (keys x L.\\ keys y) of
True -> LSC.decValidCounter >> return True
False -> return False
)
where z = difference x y
| 270 | false | true | 1 | 11 | 80 | 145 | 69 | 76 | null | null |
ekmett/wxHaskell
|
wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs
|
lgpl-2.1
|
wxHATCHSTYLE_HORIZONTAL :: Int
wxHATCHSTYLE_HORIZONTAL = wxHATCHSTYLE_CROSS + 1
| 79 |
wxHATCHSTYLE_HORIZONTAL :: Int
wxHATCHSTYLE_HORIZONTAL = wxHATCHSTYLE_CROSS + 1
| 79 |
wxHATCHSTYLE_HORIZONTAL = wxHATCHSTYLE_CROSS + 1
| 48 | false | true | 0 | 6 | 7 | 22 | 9 | 13 | null | null |
beni55/base-compat
|
test/System/Environment/CompatSpec.hs
|
mit
|
withEnv :: String -> String -> IO a -> IO a
withEnv k v action = E.bracket save restore $ \_ -> do
setEnv k v >> action
where
save = lookupEnv k
restore = maybe (unsetEnv k) (setEnv k)
| 199 |
withEnv :: String -> String -> IO a -> IO a
withEnv k v action = E.bracket save restore $ \_ -> do
setEnv k v >> action
where
save = lookupEnv k
restore = maybe (unsetEnv k) (setEnv k)
| 199 |
withEnv k v action = E.bracket save restore $ \_ -> do
setEnv k v >> action
where
save = lookupEnv k
restore = maybe (unsetEnv k) (setEnv k)
| 155 | false | true | 1 | 10 | 54 | 97 | 46 | 51 | null | null |
chwarr/bond
|
compiler/tests/Tests/Syntax/JSON.hs
|
mit
|
-- | A placeholder user-defined type
anyType :: Type
anyType = BT_UserDefined
(Struct
{ declNamespaces = [Namespace { nsLanguage = Nothing, nsName = ["any"] }]
, declAttributes = []
, declName = "anyTypeName"
, declParams = []
, structBase = Nothing
, structFields = [Field { fieldAttributes = [], fieldOrdinal = 0, fieldModifier = Optional, fieldType = BT_Int16, fieldName = "anyField", fieldDefault = Nothing }] })
[]
| 535 |
anyType :: Type
anyType = BT_UserDefined
(Struct
{ declNamespaces = [Namespace { nsLanguage = Nothing, nsName = ["any"] }]
, declAttributes = []
, declName = "anyTypeName"
, declParams = []
, structBase = Nothing
, structFields = [Field { fieldAttributes = [], fieldOrdinal = 0, fieldModifier = Optional, fieldType = BT_Int16, fieldName = "anyField", fieldDefault = Nothing }] })
[]
| 498 |
anyType = BT_UserDefined
(Struct
{ declNamespaces = [Namespace { nsLanguage = Nothing, nsName = ["any"] }]
, declAttributes = []
, declName = "anyTypeName"
, declParams = []
, structBase = Nothing
, structFields = [Field { fieldAttributes = [], fieldOrdinal = 0, fieldModifier = Optional, fieldType = BT_Int16, fieldName = "anyField", fieldDefault = Nothing }] })
[]
| 482 | true | true | 0 | 11 | 182 | 135 | 81 | 54 | null | null |
joelburget/tapl
|
llvm.hs
|
bsd-3-clause
|
mAbs :: CodeGenModule (Function (Int32 -> IO Int32))
mAbs = createFunction ExternalLinkage $ \x -> do
top <- getCurrentBasicBlock
xneg <- newBasicBlock
xpos <- newBasicBlock
t <- cmp CmpLT x (0::Int32)
condBr t xneg xpos
defineBasicBlock xneg
x' <- sub (0::Int32) x
br xpos
defineBasicBlock xpos
r <- phi [(x, top), (x', xneg)]
r1 <- add r (1::Int32)
ret r1
| 407 |
mAbs :: CodeGenModule (Function (Int32 -> IO Int32))
mAbs = createFunction ExternalLinkage $ \x -> do
top <- getCurrentBasicBlock
xneg <- newBasicBlock
xpos <- newBasicBlock
t <- cmp CmpLT x (0::Int32)
condBr t xneg xpos
defineBasicBlock xneg
x' <- sub (0::Int32) x
br xpos
defineBasicBlock xpos
r <- phi [(x, top), (x', xneg)]
r1 <- add r (1::Int32)
ret r1
| 407 |
mAbs = createFunction ExternalLinkage $ \x -> do
top <- getCurrentBasicBlock
xneg <- newBasicBlock
xpos <- newBasicBlock
t <- cmp CmpLT x (0::Int32)
condBr t xneg xpos
defineBasicBlock xneg
x' <- sub (0::Int32) x
br xpos
defineBasicBlock xpos
r <- phi [(x, top), (x', xneg)]
r1 <- add r (1::Int32)
ret r1
| 354 | false | true | 1 | 13 | 109 | 185 | 86 | 99 | null | null |
tejon/diagrams-contrib
|
src/Diagrams/TwoD/Tilings.hs
|
bsd-3-clause
|
polySides Square = 4
| 23 |
polySides Square = 4
| 23 |
polySides Square = 4
| 23 | false | false | 0 | 4 | 6 | 10 | 4 | 6 | null | null |
Enamex/Idris-dev
|
src/Idris/Core/TT.hs
|
bsd-3-clause
|
mkApp f (a:as) = mkApp (App MaybeHoles f a) as
| 46 |
mkApp f (a:as) = mkApp (App MaybeHoles f a) as
| 46 |
mkApp f (a:as) = mkApp (App MaybeHoles f a) as
| 46 | false | false | 0 | 7 | 9 | 35 | 16 | 19 | null | null |
cutsea110/aop
|
src/FixPrime.hs
|
bsd-3-clause
|
-- paramorphism
para :: Functor f => (f (Fix f, t) -> t) -> Fix f -> t
para phi = phi . fmap (pair (id, para phi)) . out
| 120 |
para :: Functor f => (f (Fix f, t) -> t) -> Fix f -> t
para phi = phi . fmap (pair (id, para phi)) . out
| 104 |
para phi = phi . fmap (pair (id, para phi)) . out
| 49 | true | true | 0 | 11 | 29 | 78 | 39 | 39 | null | null |
HIPERFIT/futhark
|
src/Futhark/Construct.hs
|
isc
|
-- | As 'eIf', but an 'IfSort' can be given.
eIf' ::
(MonadBuilder m, BranchType (Rep m) ~ ExtType) =>
m (Exp (Rep m)) ->
m (Body (Rep m)) ->
m (Body (Rep m)) ->
IfSort ->
m (Exp (Rep m))
eIf' ce te fe if_sort = do
ce' <- letSubExp "cond" =<< ce
te' <- insertStmsM te
fe' <- insertStmsM fe
-- We need to construct the context.
ts <- generaliseExtTypes <$> bodyExtType te' <*> bodyExtType fe'
te'' <- addContextForBranch ts te'
fe'' <- addContextForBranch ts fe'
let ts' = replicate (length (shapeContext ts)) (Prim int64) ++ ts
return $ If ce' te'' fe'' $ IfDec ts' if_sort
where
addContextForBranch ts (Body _ stms val_res) = do
body_ts <- extendedScope (traverse subExpResType val_res) stmsscope
let ctx_res =
map snd $ sortOn fst $ M.toList $ shapeExtMapping ts body_ts
mkBodyM stms $ subExpsRes ctx_res ++ val_res
where
stmsscope = scopeOf stms
-- The type of a body. Watch out: this only works for the degenerate
-- case where the body does not already return its context.
| 1,059 |
eIf' ::
(MonadBuilder m, BranchType (Rep m) ~ ExtType) =>
m (Exp (Rep m)) ->
m (Body (Rep m)) ->
m (Body (Rep m)) ->
IfSort ->
m (Exp (Rep m))
eIf' ce te fe if_sort = do
ce' <- letSubExp "cond" =<< ce
te' <- insertStmsM te
fe' <- insertStmsM fe
-- We need to construct the context.
ts <- generaliseExtTypes <$> bodyExtType te' <*> bodyExtType fe'
te'' <- addContextForBranch ts te'
fe'' <- addContextForBranch ts fe'
let ts' = replicate (length (shapeContext ts)) (Prim int64) ++ ts
return $ If ce' te'' fe'' $ IfDec ts' if_sort
where
addContextForBranch ts (Body _ stms val_res) = do
body_ts <- extendedScope (traverse subExpResType val_res) stmsscope
let ctx_res =
map snd $ sortOn fst $ M.toList $ shapeExtMapping ts body_ts
mkBodyM stms $ subExpsRes ctx_res ++ val_res
where
stmsscope = scopeOf stms
-- The type of a body. Watch out: this only works for the degenerate
-- case where the body does not already return its context.
| 1,014 |
eIf' ce te fe if_sort = do
ce' <- letSubExp "cond" =<< ce
te' <- insertStmsM te
fe' <- insertStmsM fe
-- We need to construct the context.
ts <- generaliseExtTypes <$> bodyExtType te' <*> bodyExtType fe'
te'' <- addContextForBranch ts te'
fe'' <- addContextForBranch ts fe'
let ts' = replicate (length (shapeContext ts)) (Prim int64) ++ ts
return $ If ce' te'' fe'' $ IfDec ts' if_sort
where
addContextForBranch ts (Body _ stms val_res) = do
body_ts <- extendedScope (traverse subExpResType val_res) stmsscope
let ctx_res =
map snd $ sortOn fst $ M.toList $ shapeExtMapping ts body_ts
mkBodyM stms $ subExpsRes ctx_res ++ val_res
where
stmsscope = scopeOf stms
-- The type of a body. Watch out: this only works for the degenerate
-- case where the body does not already return its context.
| 859 | true | true | 0 | 15 | 257 | 373 | 171 | 202 | null | null |
sgillespie/ghc
|
compiler/prelude/PrelNames.hs
|
bsd-3-clause
|
bcoPrimTyConKey = mkPreludeTyConUnique 74
| 65 |
bcoPrimTyConKey = mkPreludeTyConUnique 74
| 65 |
bcoPrimTyConKey = mkPreludeTyConUnique 74
| 65 | false | false | 0 | 5 | 27 | 9 | 4 | 5 | null | null |
haroldcarr/learn-haskell-coq-ml-etc
|
haskell/playpen/blockchain/2018-06-maurice-herlihy-blockchains-from-distributed-computing-perspective/src/X02_LedgerWithPool.hs
|
unlicense
|
runLedgerWithPool :: IO ()
runLedgerWithPool = do
l <- createLedgerCAS (return Nothing) TE.decodeUtf8
q <- Q.newQ
let e = defaultConfig
txHandler tx = do
Q.pushL q tx
Log.infoM lMINER ("POOLED: " <> show tx)
committer = lCommit l e
Async.replicateConcurrently_ (cNumMiners (getConfig e)) (miner q committer)
`Async.concurrently_`
runServerAndClients e l txHandler
| 405 |
runLedgerWithPool :: IO ()
runLedgerWithPool = do
l <- createLedgerCAS (return Nothing) TE.decodeUtf8
q <- Q.newQ
let e = defaultConfig
txHandler tx = do
Q.pushL q tx
Log.infoM lMINER ("POOLED: " <> show tx)
committer = lCommit l e
Async.replicateConcurrently_ (cNumMiners (getConfig e)) (miner q committer)
`Async.concurrently_`
runServerAndClients e l txHandler
| 405 |
runLedgerWithPool = do
l <- createLedgerCAS (return Nothing) TE.decodeUtf8
q <- Q.newQ
let e = defaultConfig
txHandler tx = do
Q.pushL q tx
Log.infoM lMINER ("POOLED: " <> show tx)
committer = lCommit l e
Async.replicateConcurrently_ (cNumMiners (getConfig e)) (miner q committer)
`Async.concurrently_`
runServerAndClients e l txHandler
| 378 | false | true | 0 | 15 | 92 | 147 | 69 | 78 | null | null |
thulishuang/Compiler
|
src/lib.hs
|
bsd-3-clause
|
parseField :: String -> ParserI String
parseField f = do
parseFlag f
args <- get
case args of
[] -> Control.Applicative.empty
(arg : args') -> do
put args'
return arg
| 218 |
parseField :: String -> ParserI String
parseField f = do
parseFlag f
args <- get
case args of
[] -> Control.Applicative.empty
(arg : args') -> do
put args'
return arg
| 218 |
parseField f = do
parseFlag f
args <- get
case args of
[] -> Control.Applicative.empty
(arg : args') -> do
put args'
return arg
| 179 | false | true | 0 | 12 | 81 | 77 | 35 | 42 | null | null |
luzhuomi/xhaskell-regex-deriv
|
Text/Regex/Deriv/ByteString/BitCode.hs
|
bsd-3-clause
|
logger io = unsafePerformIO io
| 30 |
logger io = unsafePerformIO io
| 30 |
logger io = unsafePerformIO io
| 30 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
d3zd3z/sudoku
|
Sudoku/Simple.hs
|
bsd-3-clause
|
-- Return a list of the cells in the blockSize*blockSize subblock containing
-- the argument.
blockOf :: Coord -> [Coord]
blockOf (px, py) = [(x, y) | x <- [xbase .. xbase + blockSize - 1],
y <- [ybase .. ybase + blockSize - 1]]
where
xbase = px - ((px - 1) `mod` blockSize)
ybase = py - ((py - 1) `mod` blockSize)
-- Memoized version of the above. Profiling indicates that the
-- program spends about 25% of it's time recomputing the groups.
| 479 |
blockOf :: Coord -> [Coord]
blockOf (px, py) = [(x, y) | x <- [xbase .. xbase + blockSize - 1],
y <- [ybase .. ybase + blockSize - 1]]
where
xbase = px - ((px - 1) `mod` blockSize)
ybase = py - ((py - 1) `mod` blockSize)
-- Memoized version of the above. Profiling indicates that the
-- program spends about 25% of it's time recomputing the groups.
| 385 |
blockOf (px, py) = [(x, y) | x <- [xbase .. xbase + blockSize - 1],
y <- [ybase .. ybase + blockSize - 1]]
where
xbase = px - ((px - 1) `mod` blockSize)
ybase = py - ((py - 1) `mod` blockSize)
-- Memoized version of the above. Profiling indicates that the
-- program spends about 25% of it's time recomputing the groups.
| 357 | true | true | 0 | 10 | 121 | 137 | 80 | 57 | null | null |
felixsch/drivingthesky
|
src/Block.hs
|
gpl-2.0
|
blockType :: Block -> BlockRenderType
blockType (Start _ _ t) = t
| 66 |
blockType :: Block -> BlockRenderType
blockType (Start _ _ t) = t
| 66 |
blockType (Start _ _ t) = t
| 28 | false | true | 0 | 9 | 12 | 34 | 15 | 19 | null | null |
creichert/persistent
|
persistent-sqlite/Database/Sqlite.hs
|
mit
|
decodeError 10 = ErrorIO
| 24 |
decodeError 10 = ErrorIO
| 24 |
decodeError 10 = ErrorIO
| 24 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
denibertovic/haskell
|
kubernetes/lib/Kubernetes/OpenAPI/ModelLens.hs
|
bsd-3-clause
|
-- | 'v1beta1ReplicaSetStatusConditions' Lens
v1beta1ReplicaSetStatusConditionsL :: Lens_' V1beta1ReplicaSetStatus (Maybe [V1beta1ReplicaSetCondition])
v1beta1ReplicaSetStatusConditionsL f V1beta1ReplicaSetStatus{..} = (\v1beta1ReplicaSetStatusConditions -> V1beta1ReplicaSetStatus { v1beta1ReplicaSetStatusConditions, ..} ) <$> f v1beta1ReplicaSetStatusConditions
| 364 |
v1beta1ReplicaSetStatusConditionsL :: Lens_' V1beta1ReplicaSetStatus (Maybe [V1beta1ReplicaSetCondition])
v1beta1ReplicaSetStatusConditionsL f V1beta1ReplicaSetStatus{..} = (\v1beta1ReplicaSetStatusConditions -> V1beta1ReplicaSetStatus { v1beta1ReplicaSetStatusConditions, ..} ) <$> f v1beta1ReplicaSetStatusConditions
| 318 |
v1beta1ReplicaSetStatusConditionsL f V1beta1ReplicaSetStatus{..} = (\v1beta1ReplicaSetStatusConditions -> V1beta1ReplicaSetStatus { v1beta1ReplicaSetStatusConditions, ..} ) <$> f v1beta1ReplicaSetStatusConditions
| 212 | true | true | 0 | 8 | 23 | 60 | 32 | 28 | null | null |
kuribas/cubicbezier
|
Geom2D/CubicBezier/tosvg.hs
|
bsd-3-clause
|
setAction hm (YStructRem c) =
Just [i|{id: ${fromJust $ H.lookup c hm}, set: false, class: "ystruct"}|]
| 105 |
setAction hm (YStructRem c) =
Just [i|{id: ${fromJust $ H.lookup c hm}, set: false, class: "ystruct"}|]
| 105 |
setAction hm (YStructRem c) =
Just [i|{id: ${fromJust $ H.lookup c hm}, set: false, class: "ystruct"}|]
| 105 | false | false | 0 | 7 | 17 | 24 | 13 | 11 | null | null |
mfpi/OpenGLRaw
|
src/Graphics/Rendering/OpenGL/Raw/NV/FragmentProgram2.hs
|
bsd-3-clause
|
gl_MAX_PROGRAM_CALL_DEPTH :: GLenum
gl_MAX_PROGRAM_CALL_DEPTH = 0x88F5
| 70 |
gl_MAX_PROGRAM_CALL_DEPTH :: GLenum
gl_MAX_PROGRAM_CALL_DEPTH = 0x88F5
| 70 |
gl_MAX_PROGRAM_CALL_DEPTH = 0x88F5
| 34 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
AndreasVoellmy/openflow
|
src/Network/Data/OF13/Message.hs
|
bsd-3-clause
|
portConfigCodeMap :: [(Int, PortConfigFlag)]
portConfigCodeMap = [ (0, PortDown)
, (2, NoRecv)
, (5, NoFwd)
, (6, NoPacketIn)
]
| 207 |
portConfigCodeMap :: [(Int, PortConfigFlag)]
portConfigCodeMap = [ (0, PortDown)
, (2, NoRecv)
, (5, NoFwd)
, (6, NoPacketIn)
]
| 207 |
portConfigCodeMap = [ (0, PortDown)
, (2, NoRecv)
, (5, NoFwd)
, (6, NoPacketIn)
]
| 162 | false | true | 0 | 6 | 98 | 56 | 36 | 20 | null | null |
Erdwolf/autotool-bonn
|
test/src/Report.hs
|
gpl-2.0
|
colorResult :: TestResult -> String
colorResult (TestResult p g f s) = let
t = fromIntegral (p + g + f + s)
yy = fromIntegral g / t
rr = fromIntegral f / t
gg = fromIntegral p / t
gh = fromIntegral s / t
in let
r = cc $ yy + rr + 0.5*gh
g = cc $ yy + gg + 0.5*gh
b = cc $ 0.5*gh
cc :: Double -> Int
cc c = round (255 * c)
in
printf "#%02x%02x%02x" r g b
| 411 |
colorResult :: TestResult -> String
colorResult (TestResult p g f s) = let
t = fromIntegral (p + g + f + s)
yy = fromIntegral g / t
rr = fromIntegral f / t
gg = fromIntegral p / t
gh = fromIntegral s / t
in let
r = cc $ yy + rr + 0.5*gh
g = cc $ yy + gg + 0.5*gh
b = cc $ 0.5*gh
cc :: Double -> Int
cc c = round (255 * c)
in
printf "#%02x%02x%02x" r g b
| 411 |
colorResult (TestResult p g f s) = let
t = fromIntegral (p + g + f + s)
yy = fromIntegral g / t
rr = fromIntegral f / t
gg = fromIntegral p / t
gh = fromIntegral s / t
in let
r = cc $ yy + rr + 0.5*gh
g = cc $ yy + gg + 0.5*gh
b = cc $ 0.5*gh
cc :: Double -> Int
cc c = round (255 * c)
in
printf "#%02x%02x%02x" r g b
| 375 | false | true | 0 | 14 | 147 | 204 | 102 | 102 | null | null |
wolftune/snowbot
|
Main.hs
|
gpl-3.0
|
realName :: ByteString
realName = "Snowdrift bot - development"
| 63 |
realName :: ByteString
realName = "Snowdrift bot - development"
| 63 |
realName = "Snowdrift bot - development"
| 40 | false | true | 0 | 4 | 8 | 11 | 6 | 5 | null | null |
Philonous/pontarius-xmpp
|
source/Network/Xmpp/IM/Roster.hs
|
bsd-3-clause
|
xpQuery :: PU [Node] Query
xpQuery = xpWrap (\(ver_, items_) -> Query ver_ items_ )
(\(Query ver_ items_) -> (ver_, items_)) $
xpElem "{jabber:iq:roster}query"
(xpAttribute' "ver" xpText)
xpItems
| 246 |
xpQuery :: PU [Node] Query
xpQuery = xpWrap (\(ver_, items_) -> Query ver_ items_ )
(\(Query ver_ items_) -> (ver_, items_)) $
xpElem "{jabber:iq:roster}query"
(xpAttribute' "ver" xpText)
xpItems
| 246 |
xpQuery = xpWrap (\(ver_, items_) -> Query ver_ items_ )
(\(Query ver_ items_) -> (ver_, items_)) $
xpElem "{jabber:iq:roster}query"
(xpAttribute' "ver" xpText)
xpItems
| 219 | false | true | 0 | 10 | 78 | 84 | 45 | 39 | null | null |
DanielSchuessler/hstri
|
Math/Groups/Tests.hs
|
gpl-3.0
|
prop_sort3WithPermutation :: (Int, Int, Int) -> Property
prop_sort3WithPermutation (xs :: (Int,Int,Int)) =
case sort3WithPermutation xs of
(xs'@(x0,x1,x2),g) ->
x0 <= x1 .&.
x1 <= x2 .&.
xs .=. xs' *. g
| 264 |
prop_sort3WithPermutation :: (Int, Int, Int) -> Property
prop_sort3WithPermutation (xs :: (Int,Int,Int)) =
case sort3WithPermutation xs of
(xs'@(x0,x1,x2),g) ->
x0 <= x1 .&.
x1 <= x2 .&.
xs .=. xs' *. g
| 264 |
prop_sort3WithPermutation (xs :: (Int,Int,Int)) =
case sort3WithPermutation xs of
(xs'@(x0,x1,x2),g) ->
x0 <= x1 .&.
x1 <= x2 .&.
xs .=. xs' *. g
| 207 | false | true | 0 | 13 | 92 | 98 | 55 | 43 | null | null |
jml/hazard
|
tests/GamesTest.hs
|
apache-2.0
|
addPlayers :: Int -> GameSlot -> Gen GameSlot
addPlayers n g =
iterate (>>= addPlayer) (return g) !! n
where
addPlayer g' = do
p <- arbitrary `suchThat` (`notElem` players g')
deck <- arbitrary
return $ snd $ assertRight' (runSlotAction (joinSlot deck p) g')
| 284 |
addPlayers :: Int -> GameSlot -> Gen GameSlot
addPlayers n g =
iterate (>>= addPlayer) (return g) !! n
where
addPlayer g' = do
p <- arbitrary `suchThat` (`notElem` players g')
deck <- arbitrary
return $ snd $ assertRight' (runSlotAction (joinSlot deck p) g')
| 284 |
addPlayers n g =
iterate (>>= addPlayer) (return g) !! n
where
addPlayer g' = do
p <- arbitrary `suchThat` (`notElem` players g')
deck <- arbitrary
return $ snd $ assertRight' (runSlotAction (joinSlot deck p) g')
| 238 | false | true | 1 | 13 | 69 | 125 | 59 | 66 | null | null |
ublubu/tile-rider
|
src/TileRider/SlidingGrid.hs
|
mit
|
toFixedTile :: Tile a -> Tile a
toFixedTile (SlidingTile a) = FixedTile a
| 73 |
toFixedTile :: Tile a -> Tile a
toFixedTile (SlidingTile a) = FixedTile a
| 73 |
toFixedTile (SlidingTile a) = FixedTile a
| 41 | false | true | 0 | 7 | 12 | 33 | 15 | 18 | null | null |
kosmoskatten/nats-client
|
tests/Network/Nats/MessageProps.hs
|
mit
|
posInt :: Gen Int
posInt = choose (0, maxBound)
| 47 |
posInt :: Gen Int
posInt = choose (0, maxBound)
| 47 |
posInt = choose (0, maxBound)
| 29 | false | true | 0 | 6 | 8 | 23 | 12 | 11 | null | null |
72636c/correct-fizz-buzz
|
src/FizzBuzz.hs
|
mit
|
readCount :: Arguments -> Natural
readCount args = listToMaybe args >>= readMaybe & fromMaybe defaultCount
| 106 |
readCount :: Arguments -> Natural
readCount args = listToMaybe args >>= readMaybe & fromMaybe defaultCount
| 106 |
readCount args = listToMaybe args >>= readMaybe & fromMaybe defaultCount
| 72 | false | true | 0 | 7 | 14 | 32 | 15 | 17 | null | null |
wxwxwwxxx/ghc
|
compiler/nativeGen/PPC/Instr.hs
|
bsd-3-clause
|
ppc_jumpDestsOfInstr :: Instr -> [BlockId]
ppc_jumpDestsOfInstr insn
= case insn of
BCC _ id -> [id]
BCCFAR _ id -> [id]
BCTR targets _ -> [id | Just id <- targets]
_ -> []
-- | Change the destination of this jump instruction.
-- Used in the linear allocator when adding fixup blocks for join
-- points.
| 365 |
ppc_jumpDestsOfInstr :: Instr -> [BlockId]
ppc_jumpDestsOfInstr insn
= case insn of
BCC _ id -> [id]
BCCFAR _ id -> [id]
BCTR targets _ -> [id | Just id <- targets]
_ -> []
-- | Change the destination of this jump instruction.
-- Used in the linear allocator when adding fixup blocks for join
-- points.
| 365 |
ppc_jumpDestsOfInstr insn
= case insn of
BCC _ id -> [id]
BCCFAR _ id -> [id]
BCTR targets _ -> [id | Just id <- targets]
_ -> []
-- | Change the destination of this jump instruction.
-- Used in the linear allocator when adding fixup blocks for join
-- points.
| 322 | false | true | 0 | 11 | 118 | 89 | 46 | 43 | null | null |
icyfork/shellcheck
|
ShellCheck/Parser.hs
|
gpl-3.0
|
prop_readSimpleCommand6 = isOk readSimpleCommand "time -p ( ls -l; )"
| 69 |
prop_readSimpleCommand6 = isOk readSimpleCommand "time -p ( ls -l; )"
| 69 |
prop_readSimpleCommand6 = isOk readSimpleCommand "time -p ( ls -l; )"
| 69 | false | false | 0 | 5 | 9 | 11 | 5 | 6 | null | null |
kishoredbn/barrelfish
|
tools/flounder/Local.hs
|
mit
|
can_send_fn_def :: String -> C.Unit
can_send_fn_def ifn =
C.FunctionDef C.Static (C.TypeName "bool") (can_send_fn_name drvname ifn) params [
C.Return $ C.Variable "true"]
where
params = [ C.Param (C.Ptr $ C.Struct $ intf_bind_type ifn) "b" ]
| 265 |
can_send_fn_def :: String -> C.Unit
can_send_fn_def ifn =
C.FunctionDef C.Static (C.TypeName "bool") (can_send_fn_name drvname ifn) params [
C.Return $ C.Variable "true"]
where
params = [ C.Param (C.Ptr $ C.Struct $ intf_bind_type ifn) "b" ]
| 265 |
can_send_fn_def ifn =
C.FunctionDef C.Static (C.TypeName "bool") (can_send_fn_name drvname ifn) params [
C.Return $ C.Variable "true"]
where
params = [ C.Param (C.Ptr $ C.Struct $ intf_bind_type ifn) "b" ]
| 229 | false | true | 0 | 12 | 57 | 100 | 50 | 50 | null | null |
kmels/hledger
|
hledger-lib/Hledger/Read.hs
|
gpl-3.0
|
-- | Read a journal from the given string, trying all known formats, or simply throw an error.
readJournal' :: String -> IO Journal
readJournal' s = readJournal Nothing Nothing True Nothing s >>= either error' return
| 216 |
readJournal' :: String -> IO Journal
readJournal' s = readJournal Nothing Nothing True Nothing s >>= either error' return
| 121 |
readJournal' s = readJournal Nothing Nothing True Nothing s >>= either error' return
| 84 | true | true | 0 | 7 | 36 | 48 | 21 | 27 | null | null |
haskell-opengl/OpenGLRaw
|
RegistryProcessor/src/Main.hs
|
bsd-3-clause
|
capitalize :: String -> String
capitalize str = C.toUpper (head str) : map C.toLower (tail str)
| 95 |
capitalize :: String -> String
capitalize str = C.toUpper (head str) : map C.toLower (tail str)
| 95 |
capitalize str = C.toUpper (head str) : map C.toLower (tail str)
| 64 | false | true | 0 | 8 | 15 | 46 | 22 | 24 | null | null |
bjpop/haskell-mpi
|
test/examples/speed/Bandwidth.hs
|
bsd-3-clause
|
max_req_num = 1000
| 18 |
max_req_num = 1000
| 18 |
max_req_num = 1000
| 18 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
edwardwas/haskellRogue
|
src/Game.hs
|
mit
|
----------
movePlayer :: V2 Int -> WorldUpdate
movePlayer v = MobUpdate (player.pos +~ v) player
| 97 |
movePlayer :: V2 Int -> WorldUpdate
movePlayer v = MobUpdate (player.pos +~ v) player
| 85 |
movePlayer v = MobUpdate (player.pos +~ v) player
| 49 | true | true | 0 | 8 | 15 | 36 | 18 | 18 | null | null |
keitax/lupo
|
src/Lupo/Backends/View/Views.hs
|
lgpl-3.0
|
renderAdmin :: ( h ~ H.HeistT (Handler b b) (Handler b b), SH.HasHeist b, GetLupoConfig h, U.HasURLMapper h) => ViewRep (Handler b b) -> Handler b v ()
renderAdmin v = SH.heistLocal bindSplices $ SH.render "admin-frame" where
bindSplices = H.bindSplices
[ ("lupo:page-title", H.textSplice =<< makePageTitle v)
, ("lupo:site-title", H.textSplice =<< refLupoConfig lcSiteTitle)
, ("lupo:style-sheet", U.urlSplice $ U.cssPath "admin.css")
, ("lupo:admin-url", U.urlSplice U.adminPath)
, ("lupo:footer-body", refLupoConfig lcFooterBody)
]
. H.bindSplice "lupo:main-body" (viewSplice v)
| 611 |
renderAdmin :: ( h ~ H.HeistT (Handler b b) (Handler b b), SH.HasHeist b, GetLupoConfig h, U.HasURLMapper h) => ViewRep (Handler b b) -> Handler b v ()
renderAdmin v = SH.heistLocal bindSplices $ SH.render "admin-frame" where
bindSplices = H.bindSplices
[ ("lupo:page-title", H.textSplice =<< makePageTitle v)
, ("lupo:site-title", H.textSplice =<< refLupoConfig lcSiteTitle)
, ("lupo:style-sheet", U.urlSplice $ U.cssPath "admin.css")
, ("lupo:admin-url", U.urlSplice U.adminPath)
, ("lupo:footer-body", refLupoConfig lcFooterBody)
]
. H.bindSplice "lupo:main-body" (viewSplice v)
| 611 |
renderAdmin v = SH.heistLocal bindSplices $ SH.render "admin-frame" where
bindSplices = H.bindSplices
[ ("lupo:page-title", H.textSplice =<< makePageTitle v)
, ("lupo:site-title", H.textSplice =<< refLupoConfig lcSiteTitle)
, ("lupo:style-sheet", U.urlSplice $ U.cssPath "admin.css")
, ("lupo:admin-url", U.urlSplice U.adminPath)
, ("lupo:footer-body", refLupoConfig lcFooterBody)
]
. H.bindSplice "lupo:main-body" (viewSplice v)
| 459 | false | true | 0 | 11 | 101 | 220 | 113 | 107 | null | null |
brodyberg/Notes
|
ProjectRosalind.hsproj/LearnHaskell/lib/ProjectRosalind/Window.hs
|
mit
|
-- https://stackoverflow.com/questions/27726739/implementing-an-efficient-sliding-window-algorithm-in-haskell
-- https://hackage.haskell.org/package/base-4.15.0.0/docs/Prelude.html#v:sequenceA
--ZipList 1
windows :: Int -> [a] -> [[a]]
windows m = transpose' . take m . tails
| 278 |
windows :: Int -> [a] -> [[a]]
windows m = transpose' . take m . tails
| 70 |
windows m = transpose' . take m . tails
| 39 | true | true | 0 | 8 | 24 | 45 | 25 | 20 | null | null |
timtian090/Playground
|
Haskell/simpleJSON/src/Prettify.hs
|
mit
|
text s = Text s
| 16 |
text s = Text s
| 16 |
text s = Text s
| 16 | false | false | 0 | 5 | 5 | 12 | 5 | 7 | null | null |
wavewave/hoodle-render
|
src/Graphics/Hoodle/Render/Type/HitTest.hs
|
bsd-2-clause
|
-- |
takeLastFromHitted :: RItemHitted -> RItemHitted
takeLastFromHitted Empty = Empty
| 88 |
takeLastFromHitted :: RItemHitted -> RItemHitted
takeLastFromHitted Empty = Empty
| 81 |
takeLastFromHitted Empty = Empty
| 32 | true | true | 0 | 5 | 12 | 19 | 10 | 9 | null | null |
JPMoresmau/HJVM
|
src/Language/Java/JVM/API.hs
|
bsd-3-clause
|
withField :: (WithJava m) => Field -> (JFieldPtr -> m a) -> m a
withField mp f=do
fid<-findField mp
when (fid==nullPtr) (liftIO $ ioError $ userError $ printf "field %s not found" $ show mp)
f fid
| 221 |
withField :: (WithJava m) => Field -> (JFieldPtr -> m a) -> m a
withField mp f=do
fid<-findField mp
when (fid==nullPtr) (liftIO $ ioError $ userError $ printf "field %s not found" $ show mp)
f fid
| 221 |
withField mp f=do
fid<-findField mp
when (fid==nullPtr) (liftIO $ ioError $ userError $ printf "field %s not found" $ show mp)
f fid
| 156 | false | true | 0 | 12 | 61 | 102 | 48 | 54 | null | null |
christiaanb/vhdl
|
Language/VHDL/AST/Ppr.hs
|
bsd-3-clause
|
-- Relational Operators
pprExprPrec p e (e1 :=: e2) = pprExprPrecInfix p e relationalPrec e1 "=" e2
| 101 |
pprExprPrec p e (e1 :=: e2) = pprExprPrecInfix p e relationalPrec e1 "=" e2
| 77 |
pprExprPrec p e (e1 :=: e2) = pprExprPrecInfix p e relationalPrec e1 "=" e2
| 77 | true | false | 0 | 6 | 18 | 37 | 17 | 20 | null | null |
941design/bs-gen
|
src/Main.hs
|
gpl-3.0
|
site :: Snap ()
site = route [ ("", method GET $ bsHandler) ]
| 61 |
site :: Snap ()
site = route [ ("", method GET $ bsHandler) ]
| 61 |
site = route [ ("", method GET $ bsHandler) ]
| 45 | false | true | 0 | 9 | 13 | 35 | 18 | 17 | null | null |
ribag/ganeti-experiments
|
src/Ganeti/Constants.hs
|
gpl-2.0
|
ndOvsName :: String
ndOvsName = "ovs_name"
| 42 |
ndOvsName :: String
ndOvsName = "ovs_name"
| 42 |
ndOvsName = "ovs_name"
| 22 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
NightRa/Idris-dev
|
src/Idris/Core/ProofState.hs
|
bsd-3-clause
|
solve_unified :: RunTactic
solve_unified ctxt env tm =
do ps <- get
let (_, ns) = unified ps
let unify = dropGiven (dontunify ps) ns (holes ps)
action (\ps -> ps { holes = traceWhen (unifylog ps) ("Dropping holes " ++ show (map fst unify)) $
holes ps \\ map fst unify,
recents = recents ps ++ map fst unify })
action (\ps -> ps { pterm = updateSolved unify (pterm ps) })
return (updateSolvedTerm unify tm)
| 508 |
solve_unified :: RunTactic
solve_unified ctxt env tm =
do ps <- get
let (_, ns) = unified ps
let unify = dropGiven (dontunify ps) ns (holes ps)
action (\ps -> ps { holes = traceWhen (unifylog ps) ("Dropping holes " ++ show (map fst unify)) $
holes ps \\ map fst unify,
recents = recents ps ++ map fst unify })
action (\ps -> ps { pterm = updateSolved unify (pterm ps) })
return (updateSolvedTerm unify tm)
| 508 |
solve_unified ctxt env tm =
do ps <- get
let (_, ns) = unified ps
let unify = dropGiven (dontunify ps) ns (holes ps)
action (\ps -> ps { holes = traceWhen (unifylog ps) ("Dropping holes " ++ show (map fst unify)) $
holes ps \\ map fst unify,
recents = recents ps ++ map fst unify })
action (\ps -> ps { pterm = updateSolved unify (pterm ps) })
return (updateSolvedTerm unify tm)
| 481 | false | true | 0 | 19 | 179 | 204 | 99 | 105 | null | null |
acowley/ghc
|
compiler/utils/Outputable.hs
|
bsd-3-clause
|
arrowtt = unicodeSyntax (char '⤜') (docToSDoc $ Pretty.ptext (sLit ">>-"))
| 77 |
arrowtt = unicodeSyntax (char '⤜') (docToSDoc $ Pretty.ptext (sLit ">>-"))
| 77 |
arrowtt = unicodeSyntax (char '⤜') (docToSDoc $ Pretty.ptext (sLit ">>-"))
| 77 | false | false | 0 | 10 | 12 | 35 | 17 | 18 | null | null |
mruegenberg/Delaunay
|
Graphics/Triangulation/Delaunay.hs
|
bsd-3-clause
|
----------- Toplevel helpers -----------
-- remove points that are in the triangulation only due to the baseTriangulation
removeHelperPoints :: [Pt] -> Triangulation -> Triangulation
removeHelperPoints pts trig = removeHelperPoints' ((HMap.keys trig) \\ pts) trig
where
removeHelperPoints' [] trig' = trig'
removeHelperPoints' (p:ps) trig' = case HMap.lookup p trig' of
Just nbors -> removeHelperPoints' ps $
HMap.delete p $
HSet.foldl'
(\trig'' (UPair nbor1 nbor2) -> HMap.adjust (HSet.filter (not . (p `pElem`))) nbor1 $
HMap.adjust (HSet.filter (not . (p `pElem`))) nbor2 $
trig'')
trig' nbors
Nothing -> removeHelperPoints' ps trig' -- shouldn't happen
-- build a triangulation that covers all the points
| 939 |
removeHelperPoints :: [Pt] -> Triangulation -> Triangulation
removeHelperPoints pts trig = removeHelperPoints' ((HMap.keys trig) \\ pts) trig
where
removeHelperPoints' [] trig' = trig'
removeHelperPoints' (p:ps) trig' = case HMap.lookup p trig' of
Just nbors -> removeHelperPoints' ps $
HMap.delete p $
HSet.foldl'
(\trig'' (UPair nbor1 nbor2) -> HMap.adjust (HSet.filter (not . (p `pElem`))) nbor1 $
HMap.adjust (HSet.filter (not . (p `pElem`))) nbor2 $
trig'')
trig' nbors
Nothing -> removeHelperPoints' ps trig' -- shouldn't happen
-- build a triangulation that covers all the points
| 814 |
removeHelperPoints pts trig = removeHelperPoints' ((HMap.keys trig) \\ pts) trig
where
removeHelperPoints' [] trig' = trig'
removeHelperPoints' (p:ps) trig' = case HMap.lookup p trig' of
Just nbors -> removeHelperPoints' ps $
HMap.delete p $
HSet.foldl'
(\trig'' (UPair nbor1 nbor2) -> HMap.adjust (HSet.filter (not . (p `pElem`))) nbor1 $
HMap.adjust (HSet.filter (not . (p `pElem`))) nbor2 $
trig'')
trig' nbors
Nothing -> removeHelperPoints' ps trig' -- shouldn't happen
-- build a triangulation that covers all the points
| 753 | true | true | 1 | 20 | 330 | 221 | 115 | 106 | null | null |
ivan-m/theseus
|
utils/comparison.hs
|
mit
|
genBenchData :: Int -> ([BenchWord], [ByteString])
genBenchData count =
unzip $ map (\ x -> (mkBenchWord x, mkBenchBS x)) [ 1 .. count ]
where
mkBenchWord i =
BenchWord (fromIntegral $ 137 * i) (fromIntegral $ 231 * i)
(fromIntegral $ 51 * i) (fromIntegral $ 71 * i)
(fromIntegral $ 3 * i) (fromIntegral $ 5 * i)
(fromIntegral i) (fromIntegral $ i + 1)
-- Number (30 in this case) needs to be the same as the packed size.
mkBenchBS i = CBS.replicate benchWordSize (chr i)
| 558 |
genBenchData :: Int -> ([BenchWord], [ByteString])
genBenchData count =
unzip $ map (\ x -> (mkBenchWord x, mkBenchBS x)) [ 1 .. count ]
where
mkBenchWord i =
BenchWord (fromIntegral $ 137 * i) (fromIntegral $ 231 * i)
(fromIntegral $ 51 * i) (fromIntegral $ 71 * i)
(fromIntegral $ 3 * i) (fromIntegral $ 5 * i)
(fromIntegral i) (fromIntegral $ i + 1)
-- Number (30 in this case) needs to be the same as the packed size.
mkBenchBS i = CBS.replicate benchWordSize (chr i)
| 558 |
genBenchData count =
unzip $ map (\ x -> (mkBenchWord x, mkBenchBS x)) [ 1 .. count ]
where
mkBenchWord i =
BenchWord (fromIntegral $ 137 * i) (fromIntegral $ 231 * i)
(fromIntegral $ 51 * i) (fromIntegral $ 71 * i)
(fromIntegral $ 3 * i) (fromIntegral $ 5 * i)
(fromIntegral i) (fromIntegral $ i + 1)
-- Number (30 in this case) needs to be the same as the packed size.
mkBenchBS i = CBS.replicate benchWordSize (chr i)
| 507 | false | true | 1 | 10 | 174 | 196 | 105 | 91 | null | null |
plaprade/aeson
|
Data/Aeson/Types/Internal.hs
|
bsd-3-clause
|
-- | Add JSON Path context to a parser
--
-- When parsing complex structure it helps to annotate (sub)parsers
-- with context so that if error occurs you can find it's location.
--
-- > withObject "Person" $ \o ->
-- > Person
-- > <$> o .: "name" <?> Key "name"
-- > <*> o .: "age" <?> Key "age"
--
-- (except for standard methods like '(.:)' already do that)
--
-- After that in case of error you will get a JSON Path location of that error.
--
-- Since 0.9
(<?>) :: Parser a -> JSONPathElement -> Parser a
p <?> pathElem = Parser $ \path kf ks -> runParser p (pathElem:path) kf ks
| 593 |
(<?>) :: Parser a -> JSONPathElement -> Parser a
p <?> pathElem = Parser $ \path kf ks -> runParser p (pathElem:path) kf ks
| 123 |
p <?> pathElem = Parser $ \path kf ks -> runParser p (pathElem:path) kf ks
| 74 | true | true | 0 | 9 | 129 | 77 | 46 | 31 | null | null |
dsorokin/aivika-lattice
|
tests/TraversingMachRep1.hs
|
bsd-3-clause
|
pecs = Specs { spcStartTime = 0.0,
spcStopTime = 1000.0,
spcDT = 0.1,
spcMethod = RungeKutta4,
spcGeneratorType = SimpleGenerator }
| 196 |
specs = Specs { spcStartTime = 0.0,
spcStopTime = 1000.0,
spcDT = 0.1,
spcMethod = RungeKutta4,
spcGeneratorType = SimpleGenerator }
| 196 |
specs = Specs { spcStartTime = 0.0,
spcStopTime = 1000.0,
spcDT = 0.1,
spcMethod = RungeKutta4,
spcGeneratorType = SimpleGenerator }
| 196 | false | false | 0 | 6 | 84 | 38 | 24 | 14 | null | null |
tittoassini/flat
|
benchmarks/TestAlternatives.hs
|
bsd-3-clause
|
-- import Data.List.Util
t = main
| 34 |
t = main
| 8 |
t = main
| 8 | true | false | 1 | 5 | 6 | 11 | 4 | 7 | null | null |
abhean/phffp-examples
|
src/Words.hs
|
bsd-3-clause
|
mkWord :: String -> Maybe Word'
mkWord s
| length s <= ((*2) . length . filter (`elem` vowels) $ s) = Just . Word' $ s
| otherwise = Nothing
| 144 |
mkWord :: String -> Maybe Word'
mkWord s
| length s <= ((*2) . length . filter (`elem` vowels) $ s) = Just . Word' $ s
| otherwise = Nothing
| 144 |
mkWord s
| length s <= ((*2) . length . filter (`elem` vowels) $ s) = Just . Word' $ s
| otherwise = Nothing
| 112 | false | true | 1 | 13 | 34 | 78 | 40 | 38 | null | null |
joeyadams/haskell-iocp
|
IOCP/PSQ.hs
|
bsd-3-clause
|
-- | /O(log n)/ Retrieve the binding with the least priority, and the
-- rest of the queue stripped of that binding.
minView :: PSQ a -> Maybe (Elem a, PSQ a)
minView Void = Nothing
| 191 |
minView :: PSQ a -> Maybe (Elem a, PSQ a)
minView Void = Nothing
| 74 |
minView Void = Nothing
| 32 | true | true | 0 | 8 | 45 | 38 | 19 | 19 | null | null |
sumitsahrawat/plot-lab
|
src/Main.hs
|
gpl-2.0
|
mainWindow :: FilePath -> FilePath -> IO ()
mainWindow mainGlade plotGlade = do
_ <- initGUI
builder <- builderNew
builderAddFromFile builder mainGlade
window <- builderGetObject builder castToWindow "Main Window"
button <- builderGetObject builder castToButton "Plot Button"
_ <- onDestroy window mainQuit
widgetShowAll window
s <- giveSettings defaultFigureSettings
_ <- onClicked button $ do
settings <- newIORef s
let mu1 = aSetRange (-5.00) (-5.00) 5.00
sigma1 = aSetRange 1.00 0.01 6.00
mu2 = aSetRange 0.00 (-5.00) 5.00
sigma2 = aSetRange 1.00 0.01 6.00
plotWindow plotGlade settings [sigma2, mu2, sigma1, mu1] g
mainGUI
--------------------------------------------------------------------------------
-- xs = linspace ln (-2.5, 2.5) :: Vector Double
-- ys = ln |> [exp (-x ** 2) | x <- [(-2.5),(-2.475)..2.5] :: [Double]]
-- figure = buildFigure (domain, [point (ys, xs) (Cross, red),
-- line f1 red, line f2 green,
-- line f3 blue, line f4 black]) default_fset
-- export = writeFigure SVG "plot.svg" (1000,1000) $ buildFigure dset fset
--------------------------------------------------------------------------------
| 1,361 |
mainWindow :: FilePath -> FilePath -> IO ()
mainWindow mainGlade plotGlade = do
_ <- initGUI
builder <- builderNew
builderAddFromFile builder mainGlade
window <- builderGetObject builder castToWindow "Main Window"
button <- builderGetObject builder castToButton "Plot Button"
_ <- onDestroy window mainQuit
widgetShowAll window
s <- giveSettings defaultFigureSettings
_ <- onClicked button $ do
settings <- newIORef s
let mu1 = aSetRange (-5.00) (-5.00) 5.00
sigma1 = aSetRange 1.00 0.01 6.00
mu2 = aSetRange 0.00 (-5.00) 5.00
sigma2 = aSetRange 1.00 0.01 6.00
plotWindow plotGlade settings [sigma2, mu2, sigma1, mu1] g
mainGUI
--------------------------------------------------------------------------------
-- xs = linspace ln (-2.5, 2.5) :: Vector Double
-- ys = ln |> [exp (-x ** 2) | x <- [(-2.5),(-2.475)..2.5] :: [Double]]
-- figure = buildFigure (domain, [point (ys, xs) (Cross, red),
-- line f1 red, line f2 green,
-- line f3 blue, line f4 black]) default_fset
-- export = writeFigure SVG "plot.svg" (1000,1000) $ buildFigure dset fset
--------------------------------------------------------------------------------
| 1,361 |
mainWindow mainGlade plotGlade = do
_ <- initGUI
builder <- builderNew
builderAddFromFile builder mainGlade
window <- builderGetObject builder castToWindow "Main Window"
button <- builderGetObject builder castToButton "Plot Button"
_ <- onDestroy window mainQuit
widgetShowAll window
s <- giveSettings defaultFigureSettings
_ <- onClicked button $ do
settings <- newIORef s
let mu1 = aSetRange (-5.00) (-5.00) 5.00
sigma1 = aSetRange 1.00 0.01 6.00
mu2 = aSetRange 0.00 (-5.00) 5.00
sigma2 = aSetRange 1.00 0.01 6.00
plotWindow plotGlade settings [sigma2, mu2, sigma1, mu1] g
mainGUI
--------------------------------------------------------------------------------
-- xs = linspace ln (-2.5, 2.5) :: Vector Double
-- ys = ln |> [exp (-x ** 2) | x <- [(-2.5),(-2.475)..2.5] :: [Double]]
-- figure = buildFigure (domain, [point (ys, xs) (Cross, red),
-- line f1 red, line f2 green,
-- line f3 blue, line f4 black]) default_fset
-- export = writeFigure SVG "plot.svg" (1000,1000) $ buildFigure dset fset
--------------------------------------------------------------------------------
| 1,317 | false | true | 0 | 16 | 389 | 233 | 112 | 121 | null | null |
nfjinjing/moe
|
src/Text/HTML/Moe2/Element.hs
|
bsd-3-clause
|
prim_bytestring x = tell - singleton - Prim x
| 46 |
prim_bytestring x = tell - singleton - Prim x
| 46 |
prim_bytestring x = tell - singleton - Prim x
| 46 | false | false | 0 | 6 | 9 | 20 | 9 | 11 | null | null |
mrakgr/futhark
|
src/Futhark/CodeGen/Backends/GenericC.hs
|
bsd-3-clause
|
envAllocate :: CompilerEnv op s -> Allocate op s
envAllocate = opsAllocate . envOperations
| 90 |
envAllocate :: CompilerEnv op s -> Allocate op s
envAllocate = opsAllocate . envOperations
| 90 |
envAllocate = opsAllocate . envOperations
| 41 | false | true | 0 | 6 | 13 | 29 | 14 | 15 | null | null |
stevejb71/xhaskell
|
space-age/example.hs
|
mit
|
secondsPerYear :: Planet -> Seconds
secondsPerYear planet = earthYear * case planet of
Mercury -> 0.2408467
Venus -> 0.61519726
Earth -> 1
Mars -> 1.8808158
Jupiter -> 11.862615
Saturn -> 29.447498
Uranus -> 84.016846
Neptune -> 164.79132
where earthYear = 365.25 * 24 * 60 * 60
| 305 |
secondsPerYear :: Planet -> Seconds
secondsPerYear planet = earthYear * case planet of
Mercury -> 0.2408467
Venus -> 0.61519726
Earth -> 1
Mars -> 1.8808158
Jupiter -> 11.862615
Saturn -> 29.447498
Uranus -> 84.016846
Neptune -> 164.79132
where earthYear = 365.25 * 24 * 60 * 60
| 305 |
secondsPerYear planet = earthYear * case planet of
Mercury -> 0.2408467
Venus -> 0.61519726
Earth -> 1
Mars -> 1.8808158
Jupiter -> 11.862615
Saturn -> 29.447498
Uranus -> 84.016846
Neptune -> 164.79132
where earthYear = 365.25 * 24 * 60 * 60
| 269 | false | true | 0 | 8 | 73 | 94 | 47 | 47 | null | null |
futtetennista/IntroductionToFunctionalProgramming
|
RWH/src/Ch27/SyslogUDPServer.hs
|
mit
|
serveLog :: Port -> HandlerFunc -> IO ()
serveLog port handlerfunc =
withSocketsDo $ do
addrInfos <- getAddrInfo (Just addrInfo) Nothing (Just (Strict.unpack port))
let
serverAddr =
head addrInfos
sock <- socket (addrFamily serverAddr) Datagram defaultProtocol
bind sock (addrAddress serverAddr)
procMessages sock
where
addrInfo =
defaultHints {addrFlags = [AI_PASSIVE]}
procMessages sock = do
(msg, addr) <- recvFrom sock 1024
handlerfunc addr msg
procMessages sock
-- A simple handler that prints incoming packets
| 616 |
serveLog :: Port -> HandlerFunc -> IO ()
serveLog port handlerfunc =
withSocketsDo $ do
addrInfos <- getAddrInfo (Just addrInfo) Nothing (Just (Strict.unpack port))
let
serverAddr =
head addrInfos
sock <- socket (addrFamily serverAddr) Datagram defaultProtocol
bind sock (addrAddress serverAddr)
procMessages sock
where
addrInfo =
defaultHints {addrFlags = [AI_PASSIVE]}
procMessages sock = do
(msg, addr) <- recvFrom sock 1024
handlerfunc addr msg
procMessages sock
-- A simple handler that prints incoming packets
| 616 |
serveLog port handlerfunc =
withSocketsDo $ do
addrInfos <- getAddrInfo (Just addrInfo) Nothing (Just (Strict.unpack port))
let
serverAddr =
head addrInfos
sock <- socket (addrFamily serverAddr) Datagram defaultProtocol
bind sock (addrAddress serverAddr)
procMessages sock
where
addrInfo =
defaultHints {addrFlags = [AI_PASSIVE]}
procMessages sock = do
(msg, addr) <- recvFrom sock 1024
handlerfunc addr msg
procMessages sock
-- A simple handler that prints incoming packets
| 575 | false | true | 0 | 14 | 172 | 184 | 85 | 99 | null | null |
ben-schulz/Idris-dev
|
src/Idris/Primitives.hs
|
bsd-3-clause
|
sext ITBig _ _ = Nothing
| 31 |
sext ITBig _ _ = Nothing
| 31 |
sext ITBig _ _ = Nothing
| 31 | false | false | 0 | 5 | 12 | 13 | 6 | 7 | null | null |
elieux/ghc
|
compiler/types/Type.hs
|
bsd-3-clause
|
typeRepArity :: Arity -> Type -> RepArity
typeRepArity 0 _ = 0
| 62 |
typeRepArity :: Arity -> Type -> RepArity
typeRepArity 0 _ = 0
| 62 |
typeRepArity 0 _ = 0
| 20 | false | true | 0 | 6 | 11 | 24 | 12 | 12 | null | null |
lynnard/cocos2d-hs
|
src/Graphics/UI/Cocos2d/Layer.hs
|
bsd-3-clause
|
castLayerMultiplexToConst (LayerMultiplexGc fptr' ptr') = LayerMultiplexConstGc fptr' $ HoppyF.castPtr ptr'
| 107 |
castLayerMultiplexToConst (LayerMultiplexGc fptr' ptr') = LayerMultiplexConstGc fptr' $ HoppyF.castPtr ptr'
| 107 |
castLayerMultiplexToConst (LayerMultiplexGc fptr' ptr') = LayerMultiplexConstGc fptr' $ HoppyF.castPtr ptr'
| 107 | false | false | 0 | 7 | 9 | 29 | 13 | 16 | null | null |
nevrenato/Hets_Fork
|
CASL/QuickCheck.hs
|
gpl-2.0
|
ternaryAnd (Result d1 (Just True), _) (b2, x2) =
(Result d1 (Just ()) >> b2, x2)
| 82 |
ternaryAnd (Result d1 (Just True), _) (b2, x2) =
(Result d1 (Just ()) >> b2, x2)
| 82 |
ternaryAnd (Result d1 (Just True), _) (b2, x2) =
(Result d1 (Just ()) >> b2, x2)
| 82 | false | false | 1 | 11 | 17 | 62 | 30 | 32 | null | null |
ingemaradahl/bilder
|
src/Compiler.hs
|
lgpl-3.0
|
-- Adding argument and exit point conversion to pixelwise functions
pixelMode ∷ Shader → Shader
pixelMode s = s { functions = Map.map (\f → runReader (pixelModeF f) (f, s)) (functions s) }
| 188 |
pixelMode ∷ Shader → Shader
pixelMode s = s { functions = Map.map (\f → runReader (pixelModeF f) (f, s)) (functions s) }
| 120 |
pixelMode s = s { functions = Map.map (\f → runReader (pixelModeF f) (f, s)) (functions s) }
| 92 | true | true | 0 | 12 | 32 | 65 | 35 | 30 | null | null |
cocreature/leksah
|
src/IDE/ImportTool.hs
|
gpl-2.0
|
identifier = T.pack <$> P.identifier lexer
| 42 |
identifier = T.pack <$> P.identifier lexer
| 42 |
identifier = T.pack <$> P.identifier lexer
| 42 | false | false | 3 | 6 | 5 | 21 | 8 | 13 | null | null |
rgleichman/glance
|
gui/GuiInternals.hs
|
gpl-3.0
|
abort :: AppState -> AppState
abort state@AppState {_asHistory, _asUndoPosition} =
state {_asUndoPosition = _asHistory}
| 121 |
abort :: AppState -> AppState
abort state@AppState {_asHistory, _asUndoPosition} =
state {_asUndoPosition = _asHistory}
| 121 |
abort state@AppState {_asHistory, _asUndoPosition} =
state {_asUndoPosition = _asHistory}
| 91 | false | true | 5 | 5 | 15 | 35 | 19 | 16 | null | null |
toish/Pico
|
src/Helpers.hs
|
gpl-3.0
|
compareBrackets ('<':arg) c p t f = ifLT arg c p t f
| 52 |
compareBrackets ('<':arg) c p t f = ifLT arg c p t f
| 52 |
compareBrackets ('<':arg) c p t f = ifLT arg c p t f
| 52 | false | false | 0 | 7 | 12 | 35 | 17 | 18 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.