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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
zc1036/Compiler-project | src/Analyzer.hs | gpl-3.0 | defaultSymTable :: SymbolTable
defaultSymTable = makeMap [("int", (Type intType, globalScope)),
("float", (Type floatType, globalScope)),
("char", (Type charType, globalScope)),
("void", (Type voidType, globalScope)),
... | 440 | defaultSymTable :: SymbolTable
defaultSymTable = makeMap [("int", (Type intType, globalScope)),
("float", (Type floatType, globalScope)),
("char", (Type charType, globalScope)),
("void", (Type voidType, globalScope)),
... | 440 | defaultSymTable = makeMap [("int", (Type intType, globalScope)),
("float", (Type floatType, globalScope)),
("char", (Type charType, globalScope)),
("void", (Type voidType, globalScope)),
("string", (Type stringTy... | 409 | false | true | 0 | 9 | 164 | 122 | 73 | 49 | null | null |
CBMM/petersonfaces | petersonfaces-frontend/src/Canvas2D.hs | bsd-3-clause | save :: MonadIO m => CanvasRenderingContext2D -> m ()
save = error "save only available in ghcjs" | 97 | save :: MonadIO m => CanvasRenderingContext2D -> m ()
save = error "save only available in ghcjs" | 97 | save = error "save only available in ghcjs" | 43 | false | true | 0 | 9 | 16 | 36 | 15 | 21 | null | null |
ocharles/hadoom | hadoom/Hadoom/GL/World.hs | bsd-3-clause | compile :: PWorld l -> IO (GLInterpretation l)
compile (PWorld levelExpr) = go levelExpr
where go :: WorldExpr GLInterpretation t -> IO (GLInterpretation t)
go (Let bindings in_) =
go . in_ =<<
mfix (ttraverse go . bindings)
go (Var x) = return x
go (Vertex v) = return (GLV... | 12,595 | compile :: PWorld l -> IO (GLInterpretation l)
compile (PWorld levelExpr) = go levelExpr
where go :: WorldExpr GLInterpretation t -> IO (GLInterpretation t)
go (Let bindings in_) =
go . in_ =<<
mfix (ttraverse go . bindings)
go (Var x) = return x
go (Vertex v) = return (GLV... | 12,595 | compile (PWorld levelExpr) = go levelExpr
where go :: WorldExpr GLInterpretation t -> IO (GLInterpretation t)
go (Let bindings in_) =
go . in_ =<<
mfix (ttraverse go . bindings)
go (Var x) = return x
go (Vertex v) = return (GLVertex v)
go (Texture path colorSpace) =... | 12,548 | false | true | 10 | 32 | 6,909 | 2,574 | 1,270 | 1,304 | null | null |
LudvikGalois/USBGame | src/Main.hs | mit | handleEvent (KeyboardEvent _ _ _ s r k) = do
use windowSurf >>= (liftIO . \s -> (fillRect s nullPtr 0xffabcdef))
return () | 126 | handleEvent (KeyboardEvent _ _ _ s r k) = do
use windowSurf >>= (liftIO . \s -> (fillRect s nullPtr 0xffabcdef))
return () | 126 | handleEvent (KeyboardEvent _ _ _ s r k) = do
use windowSurf >>= (liftIO . \s -> (fillRect s nullPtr 0xffabcdef))
return () | 126 | false | false | 0 | 12 | 26 | 65 | 31 | 34 | null | null |
gamelost/pcgen-rules | src/Bonus.hs | apache-2.0 | parseBonusFeat :: PParser Formula
parseBonusFeat = bonusTag "FEAT|POOL" >> parseFormula | 87 | parseBonusFeat :: PParser Formula
parseBonusFeat = bonusTag "FEAT|POOL" >> parseFormula | 87 | parseBonusFeat = bonusTag "FEAT|POOL" >> parseFormula | 53 | false | true | 0 | 6 | 9 | 21 | 10 | 11 | null | null |
AshyIsMe/lambdatwit | Main.hs | mit | evalExpr :: String -> IO String
evalExpr e =
case getOptions ["--expression", e] of
Left t@(b, e) -> return $ show t
Right opts -> do
r <- runInterpreter (interpreter opts)
case r of
Left err -> return $ show err
Right (e,et,val) -> do (out, b) <- ge... | 379 | evalExpr :: String -> IO String
evalExpr e =
case getOptions ["--expression", e] of
Left t@(b, e) -> return $ show t
Right opts -> do
r <- runInterpreter (interpreter opts)
case r of
Left err -> return $ show err
Right (e,et,val) -> do (out, b) <- ge... | 379 | evalExpr e =
case getOptions ["--expression", e] of
Left t@(b, e) -> return $ show t
Right opts -> do
r <- runInterpreter (interpreter opts)
case r of
Left err -> return $ show err
Right (e,et,val) -> do (out, b) <- getResult val
... | 347 | false | true | 0 | 16 | 158 | 147 | 71 | 76 | null | null |
Gonzih/hayoo-cli | Main.hs | mit | printResponse (Opts True _) HayooResponse{ result = (res:_) } = printResultFull res | 84 | printResponse (Opts True _) HayooResponse{ result = (res:_) } = printResultFull res | 84 | printResponse (Opts True _) HayooResponse{ result = (res:_) } = printResultFull res | 84 | false | false | 1 | 9 | 12 | 39 | 19 | 20 | null | null |
slcz/gomoku | src/Ai.hs | apache-2.0 | generateScanList :: Dimension -> [Scan]
generateScanList d = zipWith build [hScan, vScan, diagRScan, diagLScan]
[hIdx, vIdx, diagRIdx, diagLIdx ] where
build x y = Scan (fromList $ map fromList x) y
(h', w', w) = (snd d, fst d, wi d)
hScan = map (\x -> take w' $ iterate... | 1,007 | generateScanList :: Dimension -> [Scan]
generateScanList d = zipWith build [hScan, vScan, diagRScan, diagLScan]
[hIdx, vIdx, diagRIdx, diagLIdx ] where
build x y = Scan (fromList $ map fromList x) y
(h', w', w) = (snd d, fst d, wi d)
hScan = map (\x -> take w' $ iterate... | 1,007 | generateScanList d = zipWith build [hScan, vScan, diagRScan, diagLScan]
[hIdx, vIdx, diagRIdx, diagLIdx ] where
build x y = Scan (fromList $ map fromList x) y
(h', w', w) = (snd d, fst d, wi d)
hScan = map (\x -> take w' $ iterate (+1) $ x * w + w') [0..h'-1]
vScan ... | 967 | false | true | 14 | 13 | 311 | 572 | 281 | 291 | null | null |
ducis/haAni | hs/common/Graphics/UI/GLUT/GameMode.hs | gpl-2.0 | --------------------------------------------------------------------------------
-- | Return 'Just' the mode which would be tried by the next call to
-- 'enterGameMode'. Returns 'Nothing' if the mode requested by the current value
-- of 'gameModeCapabilities' is not possible, in which case 'enterGameMode'
-- would sim... | 927 | gameModeInfo :: GettableStateVar (Maybe GameModeInfo)
gameModeInfo = makeGettableStateVar $ do
possible <- getBool glut_GAME_MODE_POSSIBLE
if possible
then do
w <- glutGameModeGet glut_GAME_MODE_WIDTH
h <- glutGameModeGet glut_GAME_MODE_HEIGHT
let size = Size (fromIntegral w) (fro... | 550 | gameModeInfo = makeGettableStateVar $ do
possible <- getBool glut_GAME_MODE_POSSIBLE
if possible
then do
w <- glutGameModeGet glut_GAME_MODE_WIDTH
h <- glutGameModeGet glut_GAME_MODE_HEIGHT
let size = Size (fromIntegral w) (fromIntegral h)
b <- glutGameModeGet glut_GAME_M... | 496 | true | true | 0 | 16 | 178 | 149 | 70 | 79 | null | null |
kajigor/uKanren_transformations | src/TaglessFinal/EvalState.hs | bsd-3-clause | updateSubst :: (Subst.Subst Var -> Subst.Subst Var) -> State EvalState (Subst.Subst Var)
updateSubst f = do
state <- get
let varState = getVarState state
let newSubst = f (getSubst state)
put $ EvalState { getVarState = varState, getSubst = newSubst }
return newSubst | 277 | updateSubst :: (Subst.Subst Var -> Subst.Subst Var) -> State EvalState (Subst.Subst Var)
updateSubst f = do
state <- get
let varState = getVarState state
let newSubst = f (getSubst state)
put $ EvalState { getVarState = varState, getSubst = newSubst }
return newSubst | 277 | updateSubst f = do
state <- get
let varState = getVarState state
let newSubst = f (getSubst state)
put $ EvalState { getVarState = varState, getSubst = newSubst }
return newSubst | 188 | false | true | 0 | 12 | 52 | 112 | 53 | 59 | null | null |
frontrowed/esqueleto | src/Database/Esqueleto/Internal/Sql.hs | bsd-3-clause | from5P :: Proxy (a,b,c,d,e) -> Proxy ((a,b),(c,d),e)
from5P = const Proxy | 73 | from5P :: Proxy (a,b,c,d,e) -> Proxy ((a,b),(c,d),e)
from5P = const Proxy | 73 | from5P = const Proxy | 20 | false | true | 0 | 8 | 10 | 60 | 35 | 25 | null | null |
kim/amazonka | amazonka-ec2/gen/Network/AWS/EC2/Types.hs | mpl-2.0 | -- | 'InstanceNetworkInterfaceAttachment' constructor.
--
-- The fields accessible through corresponding lenses are:
--
-- * 'iniaAttachTime' @::@ 'Maybe' 'UTCTime'
--
-- * 'iniaAttachmentId' @::@ 'Maybe' 'Text'
--
-- * 'iniaDeleteOnTermination' @::@ 'Maybe' 'Bool'
--
-- * 'iniaDeviceIndex' @::@ 'Maybe' 'Int'
--
-- * '... | 722 | instanceNetworkInterfaceAttachment :: InstanceNetworkInterfaceAttachment
instanceNetworkInterfaceAttachment = InstanceNetworkInterfaceAttachment
{ _iniaAttachmentId = Nothing
, _iniaDeviceIndex = Nothing
, _iniaStatus = Nothing
, _iniaAttachTime = Nothing
, _inia... | 355 | instanceNetworkInterfaceAttachment = InstanceNetworkInterfaceAttachment
{ _iniaAttachmentId = Nothing
, _iniaDeviceIndex = Nothing
, _iniaStatus = Nothing
, _iniaAttachTime = Nothing
, _iniaDeleteOnTermination = Nothing
} | 282 | true | true | 0 | 7 | 136 | 67 | 43 | 24 | null | null |
lambda-11235/pure-hlisp | src/Parse.hs | gpl-2.0 | -- | Parses a string into a series of list objects.
lispParse :: Parser a -> String -> [LexOut] -> Either ParseError a
lispParse p name toks = runParser (p <* eof) () name toks | 176 | lispParse :: Parser a -> String -> [LexOut] -> Either ParseError a
lispParse p name toks = runParser (p <* eof) () name toks | 124 | lispParse p name toks = runParser (p <* eof) () name toks | 57 | true | true | 0 | 8 | 34 | 60 | 30 | 30 | null | null |
acowley/roshask | src/Ros/Internal/DepFinder.hs | bsd-3-clause | catkinBuildDeps :: String -> Maybe [Package]
catkinBuildDeps = fmap (map strContent . findChildren dep) . parseXMLDoc
where dep = QName "build_depend" Nothing Nothing
-- The given path is a possible package path root, as are all of its
-- subdirectories that are stacks (indicated by the presence of a
-- stack.xml fi... | 363 | catkinBuildDeps :: String -> Maybe [Package]
catkinBuildDeps = fmap (map strContent . findChildren dep) . parseXMLDoc
where dep = QName "build_depend" Nothing Nothing
-- The given path is a possible package path root, as are all of its
-- subdirectories that are stacks (indicated by the presence of a
-- stack.xml fi... | 363 | catkinBuildDeps = fmap (map strContent . findChildren dep) . parseXMLDoc
where dep = QName "build_depend" Nothing Nothing
-- The given path is a possible package path root, as are all of its
-- subdirectories that are stacks (indicated by the presence of a
-- stack.xml file). Returns a list of package directories. | 318 | false | true | 0 | 9 | 60 | 59 | 30 | 29 | null | null |
vikraman/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | isCharTy = is_tc charTyConKey | 35 | isCharTy = is_tc charTyConKey | 35 | isCharTy = is_tc charTyConKey | 35 | false | false | 1 | 5 | 9 | 13 | 4 | 9 | null | null |
sdiehl/ghc | compiler/deSugar/Coverage.hs | bsd-3-clause | addTickHsExpr (HsPragE _ HsPragTick{} (L pos e0)) = do
e2 <- allocTickBox (ExpBox False) False False pos $
addTickHsExpr e0
return $ unLoc e2 | 165 | addTickHsExpr (HsPragE _ HsPragTick{} (L pos e0)) = do
e2 <- allocTickBox (ExpBox False) False False pos $
addTickHsExpr e0
return $ unLoc e2 | 165 | addTickHsExpr (HsPragE _ HsPragTick{} (L pos e0)) = do
e2 <- allocTickBox (ExpBox False) False False pos $
addTickHsExpr e0
return $ unLoc e2 | 165 | false | false | 0 | 11 | 47 | 70 | 32 | 38 | null | null |
diminishedprime/.org | reading-list/haskell_programming_from_first_principles/11_05.hs | mit | doge = Plane PapuAir | 20 | doge = Plane PapuAir | 20 | doge = Plane PapuAir | 20 | false | false | 1 | 5 | 3 | 12 | 4 | 8 | null | null |
caasi/spj-book-student-1992 | src/TiState.hs | bsd-3-clause | primitives :: ASSOC Name Primitive
primitives = [ ("negate", Neg)
, ("+", Add), ("-", Sub)
, ("*", Mul), ("/", Div)
, ("if", If)
, (">", Greater)
, (">=", GreaterEq)
, ("<", Less)
, ("<=", LessEq)
, ("==", Eq)
... | 535 | primitives :: ASSOC Name Primitive
primitives = [ ("negate", Neg)
, ("+", Add), ("-", Sub)
, ("*", Mul), ("/", Div)
, ("if", If)
, (">", Greater)
, (">=", GreaterEq)
, ("<", Less)
, ("<=", LessEq)
, ("==", Eq)
... | 535 | primitives = [ ("negate", Neg)
, ("+", Add), ("-", Sub)
, ("*", Mul), ("/", Div)
, ("if", If)
, (">", Greater)
, (">=", GreaterEq)
, ("<", Less)
, ("<=", LessEq)
, ("==", Eq)
, ("~=", NotEq)
... | 500 | false | true | 1 | 7 | 251 | 173 | 110 | 63 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/prelude/PrelNames.hs | bsd-3-clause | int16TyConKey = mkPreludeTyConUnique 17 | 65 | int16TyConKey = mkPreludeTyConUnique 17 | 65 | int16TyConKey = mkPreludeTyConUnique 17 | 65 | false | false | 0 | 5 | 29 | 9 | 4 | 5 | null | null |
alexander-at-github/eta | compiler/ETA/DeSugar/DsArrows.hs | bsd-3-clause | collectPatsBinders :: [LPat Id] -> [Id]
collectPatsBinders pats = foldr collectl [] pats | 88 | collectPatsBinders :: [LPat Id] -> [Id]
collectPatsBinders pats = foldr collectl [] pats | 88 | collectPatsBinders pats = foldr collectl [] pats | 48 | false | true | 0 | 8 | 12 | 41 | 19 | 22 | null | null |
gorkinovich/Haskell | Others/Fibonacci.hs | mit | heavyFibonacci 1 = 1 | 20 | heavyFibonacci 1 = 1 | 20 | heavyFibonacci 1 = 1 | 20 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
thoughtpolice/vacuum | src/GHC/Vacuum/Types.hs | lgpl-3.0 | nodeMod = snd3 . itabName . nodeInfo | 38 | nodeMod = snd3 . itabName . nodeInfo | 38 | nodeMod = snd3 . itabName . nodeInfo | 38 | false | false | 2 | 5 | 8 | 18 | 7 | 11 | null | null |
snowmantw/Frag | src/PhysicalDimensions.hs | gpl-2.0 | -- The resulting heading is in the interval [-pi, pi).
normalizeHeading :: Heading -> Heading
normalizeHeading = normalizeAngle | 128 | normalizeHeading :: Heading -> Heading
normalizeHeading = normalizeAngle | 73 | normalizeHeading = normalizeAngle | 34 | true | true | 0 | 5 | 18 | 16 | 9 | 7 | null | null |
urbanslug/ghc | compiler/coreSyn/CoreSyn.hs | bsd-3-clause | -- | Returns true if 'IsOrphan' is orphan.
isOrphan :: IsOrphan -> Bool
isOrphan IsOrphan = True | 96 | isOrphan :: IsOrphan -> Bool
isOrphan IsOrphan = True | 53 | isOrphan IsOrphan = True | 24 | true | true | 0 | 7 | 16 | 25 | 11 | 14 | null | null |
noschinl/cyp | src/Test/Info2/Cyp/Term.hs | mit | isFree _ = False | 16 | isFree _ = False | 16 | isFree _ = False | 16 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
nrolland/react-flux | src/React/Flux/DOM.hs | bsd-3-clause | del_ :: Term eventHandler arg result => arg -> result; del_ = term "del" | 72 | del_ :: Term eventHandler arg result => arg -> result
del_ = term "del" | 71 | del_ = term "del" | 17 | false | true | 0 | 6 | 13 | 30 | 15 | 15 | null | null |
parsonsmatt/gol | src/Life.hs | bsd-3-clause | genericMove :: (z a -> z a) -> (z a -> z a) -> z a -> Zipper (z a)
genericMove a b z =
Zipper (tails $ iterate' a z) z (tails $ iterate' b z) | 143 | genericMove :: (z a -> z a) -> (z a -> z a) -> z a -> Zipper (z a)
genericMove a b z =
Zipper (tails $ iterate' a z) z (tails $ iterate' b z) | 143 | genericMove a b z =
Zipper (tails $ iterate' a z) z (tails $ iterate' b z) | 76 | false | true | 0 | 11 | 38 | 104 | 48 | 56 | null | null |
DavidAlphaFox/ghc | libraries/Cabal/cabal-install/Distribution/Client/Sandbox/Index.hs | bsd-3-clause | defaultIndexFileName :: FilePath
defaultIndexFileName = "00-index.tar" | 70 | defaultIndexFileName :: FilePath
defaultIndexFileName = "00-index.tar" | 70 | defaultIndexFileName = "00-index.tar" | 37 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
rahulmutt/ghcvm | compiler/Eta/Main/DriverPhases.hs | bsd-3-clause | startPhase "cmmcpp" = Cmm | 27 | startPhase "cmmcpp" = Cmm | 27 | startPhase "cmmcpp" = Cmm | 27 | false | false | 1 | 5 | 5 | 13 | 4 | 9 | null | null |
brendanhay/gogol | gogol-cloudfunctions/gen/Network/Google/Resource/CloudFunctions/Projects/Locations/Functions/List.hs | mpl-2.0 | -- | The project and location from which the function should be listed,
-- specified in the format \`projects\/*\/locations\/*\` If you want to
-- list functions in all locations, use \"-\" in place of a location. When
-- listing functions in all locations, if one or more location(s) are
-- unreachable, the response wi... | 541 | plflParent :: Lens' ProjectsLocationsFunctionsList Text
plflParent
= lens _plflParent (\ s a -> s{_plflParent = a}) | 117 | plflParent
= lens _plflParent (\ s a -> s{_plflParent = a}) | 61 | true | true | 1 | 9 | 86 | 51 | 27 | 24 | null | null |
Forkk/ChatCore | ChatCore/Util/Parsec.hs | mit | -- | Reads characters into a Text until the given character is read.
charsUntil :: Char -> Parser T.Text
charsUntil stop = T.pack <$> charsUntilStr stop | 152 | charsUntil :: Char -> Parser T.Text
charsUntil stop = T.pack <$> charsUntilStr stop | 83 | charsUntil stop = T.pack <$> charsUntilStr stop | 47 | true | true | 0 | 7 | 25 | 33 | 16 | 17 | null | null |
cessationoftime/leksah | src/IDE/TextEditor/CodeMirror.hs | gpl-2.0 | className = js "className" | 35 | className = js "className" | 35 | className = js "className" | 35 | false | false | 0 | 5 | 12 | 9 | 4 | 5 | null | null |
CulpaBS/wbBach | src/Futhark/Analysis/AlgSimplify.hs | bsd-3-clause | linearForm :: VName -> NNumExp -> AlgSimplifyM (Maybe (NNumExp, NNumExp))
linearForm _ (NProd [] _) =
badAlgSimplifyM "linearForm: empty Prod!" | 147 | linearForm :: VName -> NNumExp -> AlgSimplifyM (Maybe (NNumExp, NNumExp))
linearForm _ (NProd [] _) =
badAlgSimplifyM "linearForm: empty Prod!" | 147 | linearForm _ (NProd [] _) =
badAlgSimplifyM "linearForm: empty Prod!" | 73 | false | true | 0 | 10 | 23 | 52 | 26 | 26 | null | null |
elliottt/din | src/Options.hs | bsd-3-clause | displayUsage :: [String] -> IO ()
displayUsage errs = do
prog <- getProgName
let banner = unlines (errs ++ ["usage: " ++ prog ++ " [OPTIONS]"])
putStrLn (usageInfo banner options) | 185 | displayUsage :: [String] -> IO ()
displayUsage errs = do
prog <- getProgName
let banner = unlines (errs ++ ["usage: " ++ prog ++ " [OPTIONS]"])
putStrLn (usageInfo banner options) | 185 | displayUsage errs = do
prog <- getProgName
let banner = unlines (errs ++ ["usage: " ++ prog ++ " [OPTIONS]"])
putStrLn (usageInfo banner options) | 151 | false | true | 0 | 16 | 35 | 81 | 38 | 43 | null | null |
nushio3/ghc | compiler/typecheck/TcType.hs | bsd-3-clause | to_tc_mapper :: TyCoMapper VarSet Identity
to_tc_mapper
= TyCoMapper { tcm_smart = False -- more efficient not to use smart ctors
, tcm_tyvar = tyvar
, tcm_covar = covar
, tcm_hole = hole
, tcm_tybinder = tybinder }
where
tyvar :: VarSet... | 1,436 | to_tc_mapper :: TyCoMapper VarSet Identity
to_tc_mapper
= TyCoMapper { tcm_smart = False -- more efficient not to use smart ctors
, tcm_tyvar = tyvar
, tcm_covar = covar
, tcm_hole = hole
, tcm_tybinder = tybinder }
where
tyvar :: VarSet... | 1,436 | to_tc_mapper
= TyCoMapper { tcm_smart = False -- more efficient not to use smart ctors
, tcm_tyvar = tyvar
, tcm_covar = covar
, tcm_hole = hole
, tcm_tybinder = tybinder }
where
tyvar :: VarSet -> TyVar -> Identity Type
tyvar ftvs t... | 1,393 | false | true | 1 | 13 | 520 | 455 | 218 | 237 | null | null |
mortberg/AlgTop | Algebra/SNF_SparseF2.hs | bsd-3-clause | -- Transposition
transpose :: Mat -> Mat
transpose (Zero d0 d1) = Zero d1 d0 | 76 | transpose :: Mat -> Mat
transpose (Zero d0 d1) = Zero d1 d0 | 59 | transpose (Zero d0 d1) = Zero d1 d0 | 35 | true | true | 0 | 7 | 14 | 32 | 16 | 16 | null | null |
phischu/fragnix | builtins/base/GHC.IO.Encoding.UTF16.hs | bsd-3-clause | -- | @since 4.4.0.0
mkUTF16be :: CodingFailureMode -> TextEncoding
mkUTF16be cfm = TextEncoding { textEncodingName = "UTF-16BE",
mkTextDecoder = utf16be_DF cfm,
mkTextEncoder = utf16be_EF cfm } | 255 | mkUTF16be :: CodingFailureMode -> TextEncoding
mkUTF16be cfm = TextEncoding { textEncodingName = "UTF-16BE",
mkTextDecoder = utf16be_DF cfm,
mkTextEncoder = utf16be_EF cfm } | 235 | mkUTF16be cfm = TextEncoding { textEncodingName = "UTF-16BE",
mkTextDecoder = utf16be_DF cfm,
mkTextEncoder = utf16be_EF cfm } | 188 | true | true | 0 | 8 | 87 | 51 | 26 | 25 | null | null |
ekmett/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSTC_REBOL_IDENTIFIER :: Int
wxSTC_REBOL_IDENTIFIER = 20 | 57 | wxSTC_REBOL_IDENTIFIER :: Int
wxSTC_REBOL_IDENTIFIER = 20 | 57 | wxSTC_REBOL_IDENTIFIER = 20 | 27 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
meiersi/blaze-binary | src/Data/Blaze/Binary/StreamDecoding.hs | bsd-3-clause | benchWord8s :: S.ByteString -> [Word8]
benchWord8s bs = case runDecoder word8s bs of
Left msg -> error msg
Right x -> x | 128 | benchWord8s :: S.ByteString -> [Word8]
benchWord8s bs = case runDecoder word8s bs of
Left msg -> error msg
Right x -> x | 128 | benchWord8s bs = case runDecoder word8s bs of
Left msg -> error msg
Right x -> x | 89 | false | true | 3 | 6 | 30 | 51 | 25 | 26 | null | null |
aa755/roshask | src/Ros/Topic/Util.hs | bsd-3-clause | -- |Apply a function to each consecutive pair of elements from a 'Topic'.
finiteDifference :: (Functor m, Monad m) => (a -> a -> b) -> Topic m a -> Topic m b
finiteDifference f = fmap (uncurry f) . consecutive | 209 | finiteDifference :: (Functor m, Monad m) => (a -> a -> b) -> Topic m a -> Topic m b
finiteDifference f = fmap (uncurry f) . consecutive | 135 | finiteDifference f = fmap (uncurry f) . consecutive | 51 | true | true | 0 | 9 | 40 | 72 | 36 | 36 | null | null |
IreneKnapp/direct-http | Haskell/Network/HTTP.hs | mit | headerType HttpAllow = EntityHeader | 35 | headerType HttpAllow = EntityHeader | 35 | headerType HttpAllow = EntityHeader | 35 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
skogsbaer/HTF | Test/Framework/HUnitWrapper.hs | lgpl-2.1 | assertEqual_ :: (Eq a, Show a, AssertM m, HasCallStack)
=> String -> String -> a -> a -> m ()
assertEqual_ name s expected actual =
if expected /= actual
then do let x = equalityFailedMessage expected actual
genericAssertFailure (mkColorMsg name s $
... | 376 | assertEqual_ :: (Eq a, Show a, AssertM m, HasCallStack)
=> String -> String -> a -> a -> m ()
assertEqual_ name s expected actual =
if expected /= actual
then do let x = equalityFailedMessage expected actual
genericAssertFailure (mkColorMsg name s $
... | 376 | assertEqual_ name s expected actual =
if expected /= actual
then do let x = equalityFailedMessage expected actual
genericAssertFailure (mkColorMsg name s $
noColor failedAt +++ x)
else return () | 265 | false | true | 0 | 12 | 137 | 126 | 60 | 66 | null | null |
ariep/psqueues | src/Data/IntPSQ/Internal.hs | bsd-3-clause | merge :: Ord p => Mask -> IntPSQ p v -> IntPSQ p v -> IntPSQ p v
merge m l r = case l of
Nil -> r
Tip lk lp lx ->
case r of
Nil -> l
Tip rk rp rx
| (lp, lk) < (rp, rk) -> Bin lk lp lx m Nil r
| otherwise -> Bin rk rp rx m l Nil
B... | 1,472 | merge :: Ord p => Mask -> IntPSQ p v -> IntPSQ p v -> IntPSQ p v
merge m l r = case l of
Nil -> r
Tip lk lp lx ->
case r of
Nil -> l
Tip rk rp rx
| (lp, lk) < (rp, rk) -> Bin lk lp lx m Nil r
| otherwise -> Bin rk rp rx m l Nil
B... | 1,472 | merge m l r = case l of
Nil -> r
Tip lk lp lx ->
case r of
Nil -> l
Tip rk rp rx
| (lp, lk) < (rp, rk) -> Bin lk lp lx m Nil r
| otherwise -> Bin rk rp rx m l Nil
Bin rk rp rx rm rl rr
| (lp, lk) < (rp, rk) -> Bin lk lp... | 1,407 | false | true | 3 | 12 | 529 | 458 | 225 | 233 | null | null |
olsner/ghc | libraries/base/Data/Data.hs | bsd-3-clause | indexConstr :: DataType -> ConIndex -> Constr
indexConstr dt idx = case datarep dt of
(AlgRep cs) -> cs !! (idx-1)
_ -> errorWithoutStackTrace $ "Data.Data.indexConstr is not supported for "
++ dataTypeName dt ++
... | 471 | indexConstr :: DataType -> ConIndex -> Constr
indexConstr dt idx = case datarep dt of
(AlgRep cs) -> cs !! (idx-1)
_ -> errorWithoutStackTrace $ "Data.Data.indexConstr is not supported for "
++ dataTypeName dt ++
... | 471 | indexConstr dt idx = case datarep dt of
(AlgRep cs) -> cs !! (idx-1)
_ -> errorWithoutStackTrace $ "Data.Data.indexConstr is not supported for "
++ dataTypeName dt ++
"... | 425 | false | true | 0 | 10 | 208 | 76 | 38 | 38 | null | null |
Chase-C/Flocking-Haskell | src/OctreePar.hs | gpl-2.0 | octreeMap :: (Boid -> Boid) -> Octree -> Octree
octreeMap func tree = insertList (emptyOctree (center tree) (len tree)) $ map func boids
where boids = flattenTree tree | 171 | octreeMap :: (Boid -> Boid) -> Octree -> Octree
octreeMap func tree = insertList (emptyOctree (center tree) (len tree)) $ map func boids
where boids = flattenTree tree | 171 | octreeMap func tree = insertList (emptyOctree (center tree) (len tree)) $ map func boids
where boids = flattenTree tree | 123 | false | true | 0 | 10 | 31 | 74 | 36 | 38 | null | null |
ethercrow/yi | example-configs/yi-vim-pango-dynamic/yi.hs | gpl-2.0 | main :: IO ()
main = configMain defaultConfig $ do
configurePango
myVimConfig
configureHaskellMode
configureJavaScriptMode
configureMiscModes | 186 | main :: IO ()
main = configMain defaultConfig $ do
configurePango
myVimConfig
configureHaskellMode
configureJavaScriptMode
configureMiscModes | 186 | main = configMain defaultConfig $ do
configurePango
myVimConfig
configureHaskellMode
configureJavaScriptMode
configureMiscModes | 172 | false | true | 0 | 7 | 59 | 38 | 16 | 22 | null | null |
forked-upstream-packages-for-ghcjs/ghc | compiler/typecheck/TcClassDcl.hs | bsd-3-clause | lookupHsSig :: HsSigFun -> Name -> Maybe (LHsType Name)
lookupHsSig = lookupNameEnv | 83 | lookupHsSig :: HsSigFun -> Name -> Maybe (LHsType Name)
lookupHsSig = lookupNameEnv | 83 | lookupHsSig = lookupNameEnv | 27 | false | true | 0 | 9 | 11 | 28 | 14 | 14 | null | null |
whittle/bounty | lib/Network/Memcached/Parser.hs | mit | bytes :: Parser Bytes
bytes = space >> decimal | 46 | bytes :: Parser Bytes
bytes = space >> decimal | 46 | bytes = space >> decimal | 24 | false | true | 0 | 5 | 8 | 18 | 9 | 9 | null | null |
Raveline/FQuoter | testsuite/FQuoter/Parser/ParserSpec.hs | gpl-3.0 | ttags = "((Classic, Incipit))" | 30 | ttags = "((Classic, Incipit))" | 30 | ttags = "((Classic, Incipit))" | 30 | false | false | 1 | 5 | 3 | 10 | 3 | 7 | null | null |
jacekszymanski/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxSTC_CMD_DELLINERIGHT :: Int
wxSTC_CMD_DELLINERIGHT = 2396 | 59 | wxSTC_CMD_DELLINERIGHT :: Int
wxSTC_CMD_DELLINERIGHT = 2396 | 59 | wxSTC_CMD_DELLINERIGHT = 2396 | 29 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
MagneticDuck/simpleirc | Network/SimpleIRC/Messages.hs | bsd-3-clause | dropColon :: B.ByteString -> B.ByteString
dropColon xs =
if B.take 1 xs == B.pack ":"
then B.drop 1 xs
else xs | 120 | dropColon :: B.ByteString -> B.ByteString
dropColon xs =
if B.take 1 xs == B.pack ":"
then B.drop 1 xs
else xs | 120 | dropColon xs =
if B.take 1 xs == B.pack ":"
then B.drop 1 xs
else xs | 78 | false | true | 0 | 8 | 30 | 59 | 27 | 32 | null | null |
rahulmutt/codec-jvm | src/Codec/JVM/Types.hs | apache-2.0 | accessFlagValue :: AccessFlag -> Word16
accessFlagValue Public = 0x0001 | 78 | accessFlagValue :: AccessFlag -> Word16
accessFlagValue Public = 0x0001 | 78 | accessFlagValue Public = 0x0001 | 38 | false | true | 0 | 7 | 15 | 24 | 10 | 14 | null | null |
music-suite/music-preludes | src/Music/Prelude/CmdLine.hs | bsd-3-clause | -- |
-- Generates a basic converter program that invokes @lilypond@ to generate
-- music notation. Used for @music2pdf@ etc.
--
lilypondConverterMain
:: String -- ^ A file extension (supported by Lilypond).
-> IO ()
lilypondConverterMain ext = do
pgmName <- getProgName
options <- execParser (opts pgmName)
r... | 712 | lilypondConverterMain
:: String -- ^ A file extension (supported by Lilypond).
-> IO ()
lilypondConverterMain ext = do
pgmName <- getProgName
options <- execParser (opts pgmName)
runLilypondConverter ext options
where
opts pgmName = info
(helper <*> lilypondConverterOptions)
(fullDesc <>... | 583 | lilypondConverterMain ext = do
pgmName <- getProgName
options <- execParser (opts pgmName)
runLilypondConverter ext options
where
opts pgmName = info
(helper <*> lilypondConverterOptions)
(fullDesc <> header (pgmName ++ "-" ++ versionString))
runLilypondConverter ext (LilypondConverterOp... | 491 | true | true | 1 | 10 | 138 | 145 | 70 | 75 | null | null |
jaalonso/I1M-Cod-Temas | src/Tema_22/GrafoConVectorDeAdyacencia.hs | gpl-2.0 | -- (aristaEn g a) se verifica si a es una arista del grafo g. Por
-- ejemplo,
-- aristaEn ejGrafoND (5,1) == True
-- aristaEn ejGrafoND (4,1) == False
-- aristaEn ejGrafoD (5,1) == False
-- aristaEn ejGrafoD (1,5) == True
aristaEn :: (Ix v,Num p) => Grafo v p -> (v,v) -> Bool
aristaEn g (x,y) = y ... | 341 | aristaEn :: (Ix v,Num p) => Grafo v p -> (v,v) -> Bool
aristaEn g (x,y) = y `elem` adyacentes g x | 97 | aristaEn g (x,y) = y `elem` adyacentes g x | 42 | true | true | 0 | 8 | 84 | 73 | 42 | 31 | null | null |
hvr/lens | src/Control/Lens/Fold.hs | bsd-3-clause | -- | Right-associative fold of parts of a structure that are viewed through an 'IndexedFold' or 'IndexedTraversal' with
-- access to the @i@.
--
-- When you don't need access to the index then 'foldrOf' is more flexible in what it accepts.
--
-- @
-- 'foldrOf' l ≡ 'ifoldrOf' l '.' 'const'
-- @
--
-- @
-- 'ifoldrOf' :: ... | 740 | ifoldrOf :: IndexedGetting i (Endo r) s a -> (i -> a -> r -> r) -> r -> s -> r
ifoldrOf l = foldrOf l .# Indexed | 112 | ifoldrOf l = foldrOf l .# Indexed | 33 | true | true | 0 | 10 | 187 | 82 | 48 | 34 | null | null |
TGOlson/blockchain | lib/Data/Blockchain/Types/Blockchain.hs | bsd-3-clause | unspentTransactionOutputs :: Blockchain Validated -> H.HashMap Crypto.PublicKey [(TransactionOutRef, TransactionOut)]
unspentTransactionOutputs blockchain = H.fromListWith (<>) (toPair <$> unspentTxOuts)
where
toPair (txRef, txOut) = (signaturePubKey txOut, pure (txRef, txOut))
unspentTxOuts = H.toList $ unsp... | 393 | unspentTransactionOutputs :: Blockchain Validated -> H.HashMap Crypto.PublicKey [(TransactionOutRef, TransactionOut)]
unspentTransactionOutputs blockchain = H.fromListWith (<>) (toPair <$> unspentTxOuts)
where
toPair (txRef, txOut) = (signaturePubKey txOut, pure (txRef, txOut))
unspentTxOuts = H.toList $ unsp... | 393 | unspentTransactionOutputs blockchain = H.fromListWith (<>) (toPair <$> unspentTxOuts)
where
toPair (txRef, txOut) = (signaturePubKey txOut, pure (txRef, txOut))
unspentTxOuts = H.toList $ unspentTransactionOutputsInternal (NonEmpty.toList $ longestChain blockchain) | 275 | false | true | 0 | 9 | 45 | 116 | 61 | 55 | null | null |
YPBlib/NaiveFunGame_hs | cw/esolang.hs | gpl-3.0 | mainf (xs,[x],y:ys) '0' = (xs ++ [x],[y],ys) | 45 | mainf (xs,[x],y:ys) '0' = (xs ++ [x],[y],ys) | 45 | mainf (xs,[x],y:ys) '0' = (xs ++ [x],[y],ys) | 45 | false | false | 1 | 8 | 7 | 51 | 27 | 24 | null | null |
brendanhay/gogol | gogol-containeranalysis/gen/Network/Google/Resource/ContainerAnalysis/Projects/Notes/SetIAMPolicy.hs | mpl-2.0 | -- | Upload protocol for media (e.g. \"raw\", \"multipart\").
pnsipUploadProtocol :: Lens' ProjectsNotesSetIAMPolicy (Maybe Text)
pnsipUploadProtocol
= lens _pnsipUploadProtocol
(\ s a -> s{_pnsipUploadProtocol = a}) | 224 | pnsipUploadProtocol :: Lens' ProjectsNotesSetIAMPolicy (Maybe Text)
pnsipUploadProtocol
= lens _pnsipUploadProtocol
(\ s a -> s{_pnsipUploadProtocol = a}) | 162 | pnsipUploadProtocol
= lens _pnsipUploadProtocol
(\ s a -> s{_pnsipUploadProtocol = a}) | 94 | true | true | 0 | 9 | 33 | 48 | 25 | 23 | null | null |
flofehrenbacher/music-project | EasyNotes/MouseEvents.hs | gpl-3.0 | isYPositionBlackKey :: GLint -> GLint -> Bool
isYPositionBlackKey y ySize = fromEnum y > (yStartBlackKey + (fromEnum ((ySize - initHeight) `div` 2))) && fromEnum y < (yEndBlackKey + (fromEnum ((ySize - initHeight) `div` 2))) | 234 | isYPositionBlackKey :: GLint -> GLint -> Bool
isYPositionBlackKey y ySize = fromEnum y > (yStartBlackKey + (fromEnum ((ySize - initHeight) `div` 2))) && fromEnum y < (yEndBlackKey + (fromEnum ((ySize - initHeight) `div` 2))) | 234 | isYPositionBlackKey y ySize = fromEnum y > (yStartBlackKey + (fromEnum ((ySize - initHeight) `div` 2))) && fromEnum y < (yEndBlackKey + (fromEnum ((ySize - initHeight) `div` 2))) | 188 | false | true | 0 | 15 | 43 | 100 | 54 | 46 | null | null |
m4dc4p/haskelldb | test/TestCases.hs | bsd-3-clause | testCorrectGroupBy = noDBTest "Testing that groupby is correct with projections" $ do
let qryTxt = showSql $ do
p <- table int_tbl
r <- project (TInt.f01 << (p ! TInt.f01))
unique
return r
groupByTxt = mkRegex "GROUP BY.*f01.*"
hasMatch = maybe (False) (const True) (matchRe... | 419 | testCorrectGroupBy = noDBTest "Testing that groupby is correct with projections" $ do
let qryTxt = showSql $ do
p <- table int_tbl
r <- project (TInt.f01 << (p ! TInt.f01))
unique
return r
groupByTxt = mkRegex "GROUP BY.*f01.*"
hasMatch = maybe (False) (const True) (matchRe... | 419 | testCorrectGroupBy = noDBTest "Testing that groupby is correct with projections" $ do
let qryTxt = showSql $ do
p <- table int_tbl
r <- project (TInt.f01 << (p ! TInt.f01))
unique
return r
groupByTxt = mkRegex "GROUP BY.*f01.*"
hasMatch = maybe (False) (const True) (matchRe... | 419 | false | false | 0 | 20 | 106 | 125 | 59 | 66 | null | null |
mpickering/slack-api | src/Web/Slack/Types/IM.hs | mit | channelToIM :: ChannelId -> IMId
channelToIM = coerce | 53 | channelToIM :: ChannelId -> IMId
channelToIM = coerce | 53 | channelToIM = coerce | 20 | false | true | 0 | 5 | 7 | 15 | 8 | 7 | null | null |
dhruvrajan/haskell-parser | src/Anatomy/Evaluator.hs | bsd-3-clause | evaluateExpr _ (Number num) = num | 33 | evaluateExpr _ (Number num) = num | 33 | evaluateExpr _ (Number num) = num | 33 | false | false | 0 | 7 | 5 | 17 | 8 | 9 | null | null |
kawu/partage | src/NLP/Partage/AStar/Chart.hs | bsd-2-clause | rootSpan
:: (Ord n, MS.MonadState s m)
=> (s -> Chart n t)
-> n -> (Pos, Pos)
-> P.ListT m (Passive n t, DuoWeight)
rootSpan getChart x (i, j) = do
Chart{..} <- getChart <$> lift MS.get
P.Select $ do
P.each $ case M.lookup i donePassiveIni >>= M.lookup x >>= M.lookup j of
Nothing -> []
... | 694 | rootSpan
:: (Ord n, MS.MonadState s m)
=> (s -> Chart n t)
-> n -> (Pos, Pos)
-> P.ListT m (Passive n t, DuoWeight)
rootSpan getChart x (i, j) = do
Chart{..} <- getChart <$> lift MS.get
P.Select $ do
P.each $ case M.lookup i donePassiveIni >>= M.lookup x >>= M.lookup j of
Nothing -> []
... | 694 | rootSpan getChart x (i, j) = do
Chart{..} <- getChart <$> lift MS.get
P.Select $ do
P.each $ case M.lookup i donePassiveIni >>= M.lookup x >>= M.lookup j of
Nothing -> []
Just m -> map (Arr.second duoWeight) (M.toList m)
-- ((M.elems >=> M.toList) m)
P.each $ case M.lookup i don... | 562 | false | true | 0 | 17 | 186 | 278 | 136 | 142 | null | null |
leonschoorl/sprockell | src/Sprockell/BasicFunctions.hs | mit | -- usage of registers A-F to be chosen by the user
regB = 3 :: Int | 78 | regB = 3 :: Int | 27 | regB = 3 :: Int | 27 | true | false | 0 | 4 | 27 | 10 | 6 | 4 | null | null |
lpeterse/binary-generic | src/Data/Binary/Generic/Extensions.hs | bsd-3-clause | roll :: [Word8] -> Integer
roll = foldr unstep 0
where
unstep b a = a `shiftL` 8 .|. fromIntegral b | 107 | roll :: [Word8] -> Integer
roll = foldr unstep 0
where
unstep b a = a `shiftL` 8 .|. fromIntegral b | 107 | roll = foldr unstep 0
where
unstep b a = a `shiftL` 8 .|. fromIntegral b | 80 | false | true | 0 | 7 | 28 | 56 | 26 | 30 | null | null |
markus1189/xmonad-710 | XMonad/Config.hs | bsd-3-clause | -- | Perform an arbitrary action at xmonad startup.
startupHook :: X ()
startupHook = return () | 95 | startupHook :: X ()
startupHook = return () | 43 | startupHook = return () | 23 | true | true | 0 | 6 | 16 | 22 | 11 | 11 | null | null |
karshan/language-java | Language/Java/Parser.hs | bsd-3-clause | instanceCreation :: P Exp
instanceCreation = try instanceCreationNPS <|> do
p <- primaryNPS
ss <- list primarySuffix
let icp = foldl (\a s -> s a) p ss
case icp of
QualInstanceCreation {} -> return icp
_ -> fail ""
{-
instanceCreation =
(do tok KW_New
tas <- lopt typeArgs
... | 646 | instanceCreation :: P Exp
instanceCreation = try instanceCreationNPS <|> do
p <- primaryNPS
ss <- list primarySuffix
let icp = foldl (\a s -> s a) p ss
case icp of
QualInstanceCreation {} -> return icp
_ -> fail ""
{-
instanceCreation =
(do tok KW_New
tas <- lopt typeArgs
... | 646 | instanceCreation = try instanceCreationNPS <|> do
p <- primaryNPS
ss <- list primarySuffix
let icp = foldl (\a s -> s a) p ss
case icp of
QualInstanceCreation {} -> return icp
_ -> fail ""
{-
instanceCreation =
(do tok KW_New
tas <- lopt typeArgs
ct <- classType
a... | 620 | false | true | 1 | 15 | 228 | 97 | 45 | 52 | null | null |
ogma-project/ogma | test/GraphSpec.hs | mit | spec :: Spec
spec = do
checkSelectableLaws @(Edges (Character :- Relation :-> Character)) "Simple Edge"
checkSelectableLaws @(Edges TGraph) "Composed Edges"
checkRelation "Eq for Simple Edge" (\(x :: Edges (Character :- Relation :-> Character)) y -> x == y)
checkRelation "Eq for Composed Edges" (\(x :: Edges T... | 1,093 | spec :: Spec
spec = do
checkSelectableLaws @(Edges (Character :- Relation :-> Character)) "Simple Edge"
checkSelectableLaws @(Edges TGraph) "Composed Edges"
checkRelation "Eq for Simple Edge" (\(x :: Edges (Character :- Relation :-> Character)) y -> x == y)
checkRelation "Eq for Composed Edges" (\(x :: Edges T... | 1,093 | spec = do
checkSelectableLaws @(Edges (Character :- Relation :-> Character)) "Simple Edge"
checkSelectableLaws @(Edges TGraph) "Composed Edges"
checkRelation "Eq for Simple Edge" (\(x :: Edges (Character :- Relation :-> Character)) y -> x == y)
checkRelation "Eq for Composed Edges" (\(x :: Edges TGraph) y -> x... | 1,080 | false | true | 0 | 15 | 243 | 328 | 158 | 170 | null | null |
Coggroach/Gluon | src/SecurityServer.hs | bsd-3-clause | contains :: String -> ApiHandler CommonServer.Response
contains c = liftIO $ do
logConnection "" "securityServer" "GET contains"
client <- findClient c
logTrailing
case length client of
0 -> return (CommonServer.Response CommonServer.SecurityClientNotRegistered securityServerIdentity "")
... | 421 | contains :: String -> ApiHandler CommonServer.Response
contains c = liftIO $ do
logConnection "" "securityServer" "GET contains"
client <- findClient c
logTrailing
case length client of
0 -> return (CommonServer.Response CommonServer.SecurityClientNotRegistered securityServerIdentity "")
... | 421 | contains c = liftIO $ do
logConnection "" "securityServer" "GET contains"
client <- findClient c
logTrailing
case length client of
0 -> return (CommonServer.Response CommonServer.SecurityClientNotRegistered securityServerIdentity "")
_ -> return (CommonServer.Response CommonServer.Secur... | 366 | false | true | 0 | 14 | 72 | 106 | 48 | 58 | null | null |
rodrigogribeiro/mptc | src/Language/Haskell/Exts/Parser.hs | bsd-3-clause | -- | Parse of a string containing a Haskell type.
parseStmt :: String -> ParseResult S.Stmt
parseStmt = fmap sStmt . P.parseStmt | 128 | parseStmt :: String -> ParseResult S.Stmt
parseStmt = fmap sStmt . P.parseStmt | 78 | parseStmt = fmap sStmt . P.parseStmt | 36 | true | true | 0 | 7 | 21 | 30 | 15 | 15 | null | null |
kawu/tagger | src/LogMath.hs | bsd-3-clause | logAdd :: Double -> Double -> Double
logAdd x y
| logIsZero x = y
| x > y = x + log1p(exp(y - x))
| otherwise = y + log1p(exp(x - y)) | 159 | logAdd :: Double -> Double -> Double
logAdd x y
| logIsZero x = y
| x > y = x + log1p(exp(y - x))
| otherwise = y + log1p(exp(x - y)) | 159 | logAdd x y
| logIsZero x = y
| x > y = x + log1p(exp(y - x))
| otherwise = y + log1p(exp(x - y)) | 122 | false | true | 2 | 10 | 58 | 93 | 45 | 48 | null | null |
phaazon/OpenGLRaw | src/Graphics/Rendering/OpenGL/Raw/Tokens.hs | bsd-3-clause | gl_SLUMINANCE8_NV :: GLenum
gl_SLUMINANCE8_NV = 0x8C47 | 54 | gl_SLUMINANCE8_NV :: GLenum
gl_SLUMINANCE8_NV = 0x8C47 | 54 | gl_SLUMINANCE8_NV = 0x8C47 | 26 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
amccausl/RDF4H | src/Data/RDF/Namespace.hs | bsd-3-clause | -- |The SKOS namespace.
skos :: Namespace
skos = mkPrefixedNS' "skos" "http://www.w3.org/2004/02/skos/core#" | 113 | skos :: Namespace
skos = mkPrefixedNS' "skos" "http://www.w3.org/2004/02/skos/core#" | 89 | skos = mkPrefixedNS' "skos" "http://www.w3.org/2004/02/skos/core#" | 71 | true | true | 0 | 5 | 16 | 17 | 9 | 8 | null | null |
sherwoodwang/wxHaskell | wxcore/src/haskell/Graphics/UI/WXCore/WxcDefs.hs | lgpl-2.1 | wxCBAR_DOCKED_HORIZONTALLY :: Int
wxCBAR_DOCKED_HORIZONTALLY = 0 | 64 | wxCBAR_DOCKED_HORIZONTALLY :: Int
wxCBAR_DOCKED_HORIZONTALLY = 0 | 64 | wxCBAR_DOCKED_HORIZONTALLY = 0 | 30 | false | true | 0 | 6 | 5 | 18 | 7 | 11 | null | null |
ijks/hexagons | src/Grid.hs | mit | (!?) :: Grid a -> Hex Int -> Maybe a
(!?) = flip elemAt | 55 | (!?) :: Grid a -> Hex Int -> Maybe a
(!?) = flip elemAt | 55 | (!?) = flip elemAt | 18 | false | true | 0 | 7 | 13 | 35 | 18 | 17 | null | null |
hausdorff/pyle | src/Regex.hs | mit | union RegexEps y | isNullable y = y | 35 | union RegexEps y | isNullable y = y | 35 | union RegexEps y | isNullable y = y | 35 | false | false | 1 | 5 | 7 | 21 | 8 | 13 | null | null |
cgroza/HsRegex | HsRegex.hs | gpl-3.0 | -- return all matches of (combine rs)
matchRegex :: [Regex Bool] -> T.Text -> [(Int, Int)]
matchRegex rs ss = S.join $ map (snd . runWriter . subMatch ss (combine rs))
[0 .. T.length ss]
where subMatch :: T.Text -> Regex Bool -> Int -> Writer [(Int, Int)] ()
subMatch str re i =
... | 545 | matchRegex :: [Regex Bool] -> T.Text -> [(Int, Int)]
matchRegex rs ss = S.join $ map (snd . runWriter . subMatch ss (combine rs))
[0 .. T.length ss]
where subMatch :: T.Text -> Regex Bool -> Int -> Writer [(Int, Int)] ()
subMatch str re i =
let st = execState re (RegexS False [] ... | 506 | matchRegex rs ss = S.join $ map (snd . runWriter . subMatch ss (combine rs))
[0 .. T.length ss]
where subMatch :: T.Text -> Regex Bool -> Int -> Writer [(Int, Int)] ()
subMatch str re i =
let st = execState re (RegexS False [] str [[i]])
pos = position st in
... | 452 | true | true | 2 | 13 | 161 | 245 | 122 | 123 | null | null |
SeanTater/hypergraph-disambiguate | src/Main.hs | apache-2.0 | -- | Count the words prior to making contexts (to save much memory)
bloomChunk :: Text.Text -> P.Popularity
bloomChunk = P.countChunk . U.conservativeTokenize | 158 | bloomChunk :: Text.Text -> P.Popularity
bloomChunk = P.countChunk . U.conservativeTokenize | 90 | bloomChunk = P.countChunk . U.conservativeTokenize | 50 | true | true | 0 | 8 | 22 | 35 | 16 | 19 | null | null |
oshyshko/adventofcode | src.exe/SysInfo.hs | bsd-3-clause | execM :: FilePath -> IO (Maybe String)
execM cmd = tryOrNothing $
(\(_, out, _) -> out)
<$> readProcessWithExitCode c args ""
where c:args = words cmd
-- readFileM :: FilePath -> IO (Maybe String)
-- readFileM path = tryOrNothing $ readFile path | 270 | execM :: FilePath -> IO (Maybe String)
execM cmd = tryOrNothing $
(\(_, out, _) -> out)
<$> readProcessWithExitCode c args ""
where c:args = words cmd
-- readFileM :: FilePath -> IO (Maybe String)
-- readFileM path = tryOrNothing $ readFile path | 270 | execM cmd = tryOrNothing $
(\(_, out, _) -> out)
<$> readProcessWithExitCode c args ""
where c:args = words cmd
-- readFileM :: FilePath -> IO (Maybe String)
-- readFileM path = tryOrNothing $ readFile path | 231 | false | true | 1 | 9 | 67 | 81 | 41 | 40 | null | null |
spechub/Hets | Omega/ToLisp.hs | gpl-2.0 | -- | Outputs a library to omega's lisp format.
printLibrary :: Library -> String
printLibrary = toSExpr emptyEnv | 112 | printLibrary :: Library -> String
printLibrary = toSExpr emptyEnv | 65 | printLibrary = toSExpr emptyEnv | 31 | true | true | 0 | 5 | 17 | 19 | 10 | 9 | null | null |
mbg/monadic-state-hierarchies | Language/MSH/CodeGen/Decls.hs | mit | -- { _fieldToDef = lensLookup }
-- | Generates top-level declarations for a state declaration
genStateDecl :: StateEnv -> StateDecl -> Q [Dec]
genStateDecl env s@(StateDecl { stateParams = vars, stateBody = decls }) = do
let
tyvars = map (PlainTV . mkName) vars
d <- genStateData tyvars s
ls <- ... | 694 | genStateDecl :: StateEnv -> StateDecl -> Q [Dec]
genStateDecl env s@(StateDecl { stateParams = vars, stateBody = decls }) = do
let
tyvars = map (PlainTV . mkName) vars
d <- genStateData tyvars s
ls <- makeFieldOpticsForDec stateLensRules d
t <- genStateType tyvars s
o <- genStateObject... | 599 | genStateDecl env s@(StateDecl { stateParams = vars, stateBody = decls }) = do
let
tyvars = map (PlainTV . mkName) vars
d <- genStateData tyvars s
ls <- makeFieldOpticsForDec stateLensRules d
t <- genStateType tyvars s
o <- genStateObject tyvars s
c <- genStateClass env tyvars decl... | 550 | true | true | 0 | 13 | 171 | 249 | 120 | 129 | null | null |
emmanueltouzery/cigale-timesheet | src/WebServer/FilePickerServer.hs | mit | browseFolder :: Snap ()
browseFolder = do
homeDir <- liftIO $ TE.encodeUtf8 . T.pack <$> getHomeDirectory
modifyResponse $ setContentType "application/json"
curFolder <- T.unpack . TE.decodeUtf8 . fromMaybe homeDir <$> getParam "path"
files <- liftIO $ getDirectoryContents curFolder
fileInfos <- lif... | 442 | browseFolder :: Snap ()
browseFolder = do
homeDir <- liftIO $ TE.encodeUtf8 . T.pack <$> getHomeDirectory
modifyResponse $ setContentType "application/json"
curFolder <- T.unpack . TE.decodeUtf8 . fromMaybe homeDir <$> getParam "path"
files <- liftIO $ getDirectoryContents curFolder
fileInfos <- lif... | 442 | browseFolder = do
homeDir <- liftIO $ TE.encodeUtf8 . T.pack <$> getHomeDirectory
modifyResponse $ setContentType "application/json"
curFolder <- T.unpack . TE.decodeUtf8 . fromMaybe homeDir <$> getParam "path"
files <- liftIO $ getDirectoryContents curFolder
fileInfos <- liftIO $ mapM (fileInfo cur... | 418 | false | true | 0 | 11 | 82 | 138 | 62 | 76 | null | null |
cirquit/Personal-Repository | Haskell/RWH/FileSystem/BetterPredicate.hs | mit | -- path -> permissions -> filesize in (B) -> last modified
-- how to get the infix of operators -> :info ==
pathP :: InfoP FilePath
pathP path _ _ _ = path | 165 | pathP :: InfoP FilePath
pathP path _ _ _ = path | 47 | pathP path _ _ _ = path | 23 | true | true | 0 | 5 | 42 | 25 | 13 | 12 | null | null |
FranklinChen/Idris-dev | src/IRTS/CodegenJavaScript.hs | bsd-3-clause | jsTOP n = JSIndex jsSTACK (JSBinOp "+" jsSTACKTOP (JSNum (JSInt n))) | 68 | jsTOP n = JSIndex jsSTACK (JSBinOp "+" jsSTACKTOP (JSNum (JSInt n))) | 68 | jsTOP n = JSIndex jsSTACK (JSBinOp "+" jsSTACKTOP (JSNum (JSInt n))) | 68 | false | false | 1 | 11 | 10 | 40 | 17 | 23 | null | null |
lcycon/QuickScala | Language/Scala/Parse.hs | gpl-3.0 | parens = P.parens scalaLexer | 28 | parens = P.parens scalaLexer | 28 | parens = P.parens scalaLexer | 28 | false | false | 0 | 6 | 3 | 11 | 5 | 6 | null | null |
yliu120/K3 | src/Language/K3/Analysis/Provenance/Inference.hs | apache-2.0 | pifreshbp :: PIEnv -> Identifier -> UID -> K3 Provenance -> (K3 Provenance, PIEnv)
pifreshbp pienv i u p =
let j = pcnt pienv
p' = pbvar $ PMatVar i u j
in (p', piextp (pienv {pcnt=j+1}) j p) | 202 | pifreshbp :: PIEnv -> Identifier -> UID -> K3 Provenance -> (K3 Provenance, PIEnv)
pifreshbp pienv i u p =
let j = pcnt pienv
p' = pbvar $ PMatVar i u j
in (p', piextp (pienv {pcnt=j+1}) j p) | 202 | pifreshbp pienv i u p =
let j = pcnt pienv
p' = pbvar $ PMatVar i u j
in (p', piextp (pienv {pcnt=j+1}) j p) | 119 | false | true | 0 | 13 | 50 | 112 | 55 | 57 | null | null |
d-day/relation | src/Data/Relation.hs | bsd-3-clause | delete :: (Ord a, Ord b)
=> a -> b -> Relation a b -> Relation a b
delete x y r = r { domain = domain', range = range' }
where
domain' = M.update (erase y) x (domain r)
range' = M.update (erase x) y (range r)
erase e s = if S.singleton e == s
... | 451 | delete :: (Ord a, Ord b)
=> a -> b -> Relation a b -> Relation a b
delete x y r = r { domain = domain', range = range' }
where
domain' = M.update (erase y) x (domain r)
range' = M.update (erase x) y (range r)
erase e s = if S.singleton e == s
... | 448 | delete x y r = r { domain = domain', range = range' }
where
domain' = M.update (erase y) x (domain r)
range' = M.update (erase x) y (range r)
erase e s = if S.singleton e == s
then Nothing
else Just $ S.delete e s
-- | The Set of values ... | 358 | false | true | 0 | 9 | 187 | 163 | 83 | 80 | null | null |
abakst/liquidhaskell | benchmarks/nofib/imaginary/exp3_8/Main.hs | bsd-3-clause | int :: NatT -> Int
int Z = 0 | 33 | int :: NatT -> Int
int Z = 0 | 32 | int Z = 0 | 13 | false | true | 0 | 5 | 13 | 22 | 10 | 12 | null | null |
trenta3/zeno-0.2.0.1 | Example.hs | mit | count x (y:ys)
| x == y = Succ (count x ys)
| otherwise = count x ys | 73 | count x (y:ys)
| x == y = Succ (count x ys)
| otherwise = count x ys | 73 | count x (y:ys)
| x == y = Succ (count x ys)
| otherwise = count x ys | 73 | false | false | 1 | 8 | 22 | 53 | 24 | 29 | null | null |
ghorn/ois-input-manager | src/Key.hs | bsd-3-clause | decodeKey 26 = KC_LBRACKET | 26 | decodeKey 26 = KC_LBRACKET | 26 | decodeKey 26 = KC_LBRACKET | 26 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
ghcjs/jsaddle-dom | src/JSDOM/Generated/HTMLOptionsCollection.hs | mit | -- | <https://developer.mozilla.org/en-US/docs/Web/API/HTMLOptionsCollection.namedItem Mozilla HTMLOptionsCollection.namedItem documentation>
namedItem_ ::
(MonadDOM m, ToJSString name) =>
HTMLOptionsCollection -> name -> m ()
namedItem_ self name = liftDOM (void (self ! name)) | 303 | namedItem_ ::
(MonadDOM m, ToJSString name) =>
HTMLOptionsCollection -> name -> m ()
namedItem_ self name = liftDOM (void (self ! name)) | 160 | namedItem_ self name = liftDOM (void (self ! name)) | 51 | true | true | 0 | 9 | 52 | 61 | 31 | 30 | null | null |
foreverbell/project-euler-solutions | src/45.hs | bsd-3-clause | pentagonal = [ n * (3 * n - 1) `div` 2 | n <- [1 .. ] ] | 55 | pentagonal = [ n * (3 * n - 1) `div` 2 | n <- [1 .. ] ] | 55 | pentagonal = [ n * (3 * n - 1) `div` 2 | n <- [1 .. ] ] | 55 | false | false | 0 | 10 | 18 | 42 | 24 | 18 | null | null |
DougBurke/swish | src/Swish/RDF/ProofContext.hs | lgpl-2.1 | rdfsa29 :: RDFFormula
rdfsa29 = makeFormula scopeRDFS "a29"
"rdfs:comment rdfs:range rdfs:Literal ." | 111 | rdfsa29 :: RDFFormula
rdfsa29 = makeFormula scopeRDFS "a29"
"rdfs:comment rdfs:range rdfs:Literal ." | 111 | rdfsa29 = makeFormula scopeRDFS "a29"
"rdfs:comment rdfs:range rdfs:Literal ." | 89 | false | true | 0 | 5 | 22 | 19 | 9 | 10 | null | null |
avieth/InvertibleSyntax | Examples/Stack.hs | bsd-3-clause | invsynSequenceSemicolon
:: InvertibleSyntax String Identity (left h s ()) (left h s ())
-> InvertibleSyntax String Identity (right h s t) (right h s t)
-> InvertibleSyntax String Identity (Sequence left right h s t) (Sequence left right h s t)
invsynSequenceSemicolon left right = do
l <- lmap getLeft le... | 729 | invsynSequenceSemicolon
:: InvertibleSyntax String Identity (left h s ()) (left h s ())
-> InvertibleSyntax String Identity (right h s t) (right h s t)
-> InvertibleSyntax String Identity (Sequence left right h s t) (Sequence left right h s t)
invsynSequenceSemicolon left right = do
l <- lmap getLeft le... | 729 | invsynSequenceSemicolon left right = do
l <- lmap getLeft left
optional (many1 (char ' '))
char ';'
optional (many1 (char ' '))
pretty (char '\n')
r <- lmap getRight right
return (Sequence l r)
where
getLeft :: Sequence left right h s t -> left h s ()
getLeft term = case term of
... | 473 | false | true | 0 | 11 | 197 | 325 | 150 | 175 | null | null |
DeathByTape/LifeRaft | test/Network/LifeRaft/Internal/NetworkHelperSpec.hs | bsd-3-clause | getConnectedSockets :: IO (Socket, Socket)
getConnectedSockets = do
listener <- socket AF_INET Stream defaultProtocol
rightSock <- socket AF_INET Stream defaultProtocol
hAddr <- getSockAddr "localhost:1" >>= \saddr -> case saddr of
Nothing -> fail "Could not get SockAddr for localhost."
Just (SockAddrInet... | 786 | getConnectedSockets :: IO (Socket, Socket)
getConnectedSockets = do
listener <- socket AF_INET Stream defaultProtocol
rightSock <- socket AF_INET Stream defaultProtocol
hAddr <- getSockAddr "localhost:1" >>= \saddr -> case saddr of
Nothing -> fail "Could not get SockAddr for localhost."
Just (SockAddrInet... | 786 | getConnectedSockets = do
listener <- socket AF_INET Stream defaultProtocol
rightSock <- socket AF_INET Stream defaultProtocol
hAddr <- getSockAddr "localhost:1" >>= \saddr -> case saddr of
Nothing -> fail "Could not get SockAddr for localhost."
Just (SockAddrInet _ host) -> return host
_ -> fail "Retu... | 743 | false | true | 0 | 15 | 155 | 222 | 101 | 121 | null | null |
tjakway/ghcjvm | compiler/specialise/Rules.hs | bsd-3-clause | ruleCheck _ (Coercion _) = emptyBag | 38 | ruleCheck _ (Coercion _) = emptyBag | 38 | ruleCheck _ (Coercion _) = emptyBag | 38 | false | false | 1 | 6 | 8 | 20 | 8 | 12 | null | null |
exitmouse/proper | src/Visnov.hs | gpl-3.0 | pose :: String -> Dialogue u ()
pose s = Dialogue $ do
character <- ask
lift $ setPose character s | 102 | pose :: String -> Dialogue u ()
pose s = Dialogue $ do
character <- ask
lift $ setPose character s | 102 | pose s = Dialogue $ do
character <- ask
lift $ setPose character s | 70 | false | true | 0 | 9 | 24 | 48 | 22 | 26 | null | null |
freizl/freizl.github.com-old | src/Hakyll/Core/Compiler/Require.hs | bsd-3-clause | --------------------------------------------------------------------------------
save :: (Binary a, Typeable a) => Store -> Item a -> IO ()
save store item = saveSnapshot store final item | 187 | save :: (Binary a, Typeable a) => Store -> Item a -> IO ()
save store item = saveSnapshot store final item | 106 | save store item = saveSnapshot store final item | 47 | true | true | 0 | 9 | 22 | 55 | 27 | 28 | null | null |
input-output-hk/rscoin-haskell | src/RSCoin/Explorer/Web/Sockets/App.hs | gpl-3.0 | unsubscribeFully
:: MonadState ConnectionsState m
=> SessionId -> m ()
unsubscribeFully i = unsubscribeHBlocks i >> unsubscribeAddr i | 141 | unsubscribeFully
:: MonadState ConnectionsState m
=> SessionId -> m ()
unsubscribeFully i = unsubscribeHBlocks i >> unsubscribeAddr i | 141 | unsubscribeFully i = unsubscribeHBlocks i >> unsubscribeAddr i | 62 | false | true | 0 | 8 | 25 | 45 | 20 | 25 | null | null |
BartAdv/Idris-dev | src/Idris/Reflection.hs | bsd-3-clause | fromTTMaybe :: Term -> Maybe Term -- WARNING: Assumes the term has type Maybe a
fromTTMaybe (App _ (App _ (P (DCon _ _ _) (NS (UN just) _) _) ty) tm)
| just == txt "Just" = Just tm | 182 | fromTTMaybe :: Term -> Maybe Term
fromTTMaybe (App _ (App _ (P (DCon _ _ _) (NS (UN just) _) _) ty) tm)
| just == txt "Just" = Just tm | 136 | fromTTMaybe (App _ (App _ (P (DCon _ _ _) (NS (UN just) _) _) ty) tm)
| just == txt "Just" = Just tm | 102 | true | true | 0 | 15 | 41 | 92 | 44 | 48 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.