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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
saep/nvim-hs | test-suite/Neovim/API/THSpecFunctions.hs | apache-2.0 | testSucc :: Int -> Neovim env Int
testSucc = return . succ | 58 | testSucc :: Int -> Neovim env Int
testSucc = return . succ | 58 | testSucc = return . succ | 24 | false | true | 0 | 7 | 11 | 30 | 13 | 17 | null | null |
jqpeterson/roc-translator | src/Protocol/ROC/PointTypes.hs | bsd-3-clause | decodePTID (PTID20 _) = 20 | 26 | decodePTID (PTID20 _) = 20 | 26 | decodePTID (PTID20 _) = 20 | 26 | false | false | 0 | 6 | 4 | 16 | 7 | 9 | null | null |
jeremyjh/free-agent | core/test/FreeAgent/TestHelper.hs | bsd-3-clause | cachedContexts :: MVar (Map Text AgentContext)
cachedContexts = unsafePerformIO (newMVar mempty) | 96 | cachedContexts :: MVar (Map Text AgentContext)
cachedContexts = unsafePerformIO (newMVar mempty) | 96 | cachedContexts = unsafePerformIO (newMVar mempty) | 49 | false | true | 0 | 7 | 10 | 31 | 15 | 16 | null | null |
Concomitant/LambdaHack | GameDefinition/Content/PlaceKind.hs | bsd-3-clause | collapsed4 = collapsed
{ pfreq = [("noise", 400), ("battle", 200)]
, ptopLeft = [ "XXXO"
, "XXXO"
, "XOOO"
]
} | 164 | collapsed4 = collapsed
{ pfreq = [("noise", 400), ("battle", 200)]
, ptopLeft = [ "XXXO"
, "XXXO"
, "XOOO"
]
} | 164 | collapsed4 = collapsed
{ pfreq = [("noise", 400), ("battle", 200)]
, ptopLeft = [ "XXXO"
, "XXXO"
, "XOOO"
]
} | 164 | false | false | 0 | 9 | 74 | 51 | 31 | 20 | null | null |
ksaveljev/chip-8-emulator | Chip8/Emulator/SDL.hs | mit | screenScale :: CInt
screenScale = fromIntegral vScale | 53 | screenScale :: CInt
screenScale = fromIntegral vScale | 53 | screenScale = fromIntegral vScale | 33 | false | true | 0 | 5 | 6 | 14 | 7 | 7 | null | null |
rfranek/duckling | Duckling/Dimensions/JA.hs | bsd-3-clause | allDimensions :: [Some Dimension]
allDimensions =
[ This Duration
, This Numeral
, This Ordinal
, This Temperature
, This Time
] | 140 | allDimensions :: [Some Dimension]
allDimensions =
[ This Duration
, This Numeral
, This Ordinal
, This Temperature
, This Time
] | 140 | allDimensions =
[ This Duration
, This Numeral
, This Ordinal
, This Temperature
, This Time
] | 106 | false | true | 0 | 6 | 33 | 47 | 24 | 23 | null | null |
awto/chr2sql | CHR2/Target/PostgreSQL.hs | bsd-3-clause | needsPH :: RuleInfo -> Bool
needsPH _ = False | 45 | needsPH :: RuleInfo -> Bool
needsPH _ = False | 45 | needsPH _ = False | 17 | false | true | 0 | 7 | 8 | 24 | 10 | 14 | null | null |
parsonsmatt/routerhs | Router.hs | mit | indexComments :: Num a => Route a
indexComments = In Users 3 $ In Posts 2 $ Do Index Comments | 94 | indexComments :: Num a => Route a
indexComments = In Users 3 $ In Posts 2 $ Do Index Comments | 93 | indexComments = In Users 3 $ In Posts 2 $ Do Index Comments | 59 | false | true | 0 | 7 | 20 | 44 | 20 | 24 | null | null |
noinia/diagrams-ipe | src/Graphics/Rendering/Ipe.hs | bsd-3-clause | ipeDocument i = Document prologue (ipeElem i) []
where
prologue = Prologue [] (Just docType) [] | 105 | ipeDocument i = Document prologue (ipeElem i) []
where
prologue = Prologue [] (Just docType) [] | 105 | ipeDocument i = Document prologue (ipeElem i) []
where
prologue = Prologue [] (Just docType) [] | 105 | false | false | 2 | 7 | 25 | 59 | 23 | 36 | null | null |
ivanperez-keera/Yampa | yampa/tests/TestsRSwitch.hs | bsd-3-clause | -- Integration using rectangle rule assumed.
rswitch_t2r :: [Double]
rswitch_t2r =
[0.0, 1.0, 2.0, 4.0, 4.0,
4.0, 0.0, 0.0, 0.0, 3.0,
7.0, 11.0, 0.0, 5.0, 10.0,
18.0, 28.0, 0.0, 8.0, 17.0] | 212 | rswitch_t2r :: [Double]
rswitch_t2r =
[0.0, 1.0, 2.0, 4.0, 4.0,
4.0, 0.0, 0.0, 0.0, 3.0,
7.0, 11.0, 0.0, 5.0, 10.0,
18.0, 28.0, 0.0, 8.0, 17.0] | 167 | rswitch_t2r =
[0.0, 1.0, 2.0, 4.0, 4.0,
4.0, 0.0, 0.0, 0.0, 3.0,
7.0, 11.0, 0.0, 5.0, 10.0,
18.0, 28.0, 0.0, 8.0, 17.0] | 143 | true | true | 0 | 5 | 54 | 75 | 49 | 26 | null | null |
fmthoma/ghc | compiler/basicTypes/BasicTypes.hs | bsd-3-clause | isNeverActive, isAlwaysActive, isEarlyActive :: Activation -> Bool
isNeverActive NeverActive = True | 99 | isNeverActive, isAlwaysActive, isEarlyActive :: Activation -> Bool
isNeverActive NeverActive = True | 99 | isNeverActive NeverActive = True | 32 | false | true | 2 | 5 | 10 | 28 | 13 | 15 | null | null |
dtrsan/houndell | src/Houndell/Network/HTTP.hs | mit | fetchResults :: HoundSettings -> IO (Maybe HoundResponse)
fetchResults = parseRequest.mkRequest | 95 | fetchResults :: HoundSettings -> IO (Maybe HoundResponse)
fetchResults = parseRequest.mkRequest | 95 | fetchResults = parseRequest.mkRequest | 37 | false | true | 0 | 8 | 9 | 26 | 13 | 13 | null | null |
kawu/ltag | src/NLP/LTAG/Earley5.hs | bsd-2-clause | -- | Run the transformer.
runDupT
:: (Functor m, Monad m)
=> DupT n t i f a m b
-> m (b, S.Set (Rule n t i f a))
runDupT = fmap (second rulDepo) . flip E.runStateT
(DupS Part.empty S.empty) | 205 | runDupT
:: (Functor m, Monad m)
=> DupT n t i f a m b
-> m (b, S.Set (Rule n t i f a))
runDupT = fmap (second rulDepo) . flip E.runStateT
(DupS Part.empty S.empty) | 179 | runDupT = fmap (second rulDepo) . flip E.runStateT
(DupS Part.empty S.empty) | 80 | true | true | 0 | 11 | 56 | 106 | 53 | 53 | null | null |
mettekou/ghc | compiler/deSugar/Coverage.hs | bsd-3-clause | addTickHsExpr (ArithSeq ty wit arith_seq) =
liftM3 ArithSeq
(return ty)
(addTickWit wit)
(addTickArithSeqInfo arith_seq)
where addTickWit Nothing = return Nothing
addTickWit (Just fl) = do fl' <- addTickSyntaxExpr hpcSrcSpan fl
... | 444 | addTickHsExpr (ArithSeq ty wit arith_seq) =
liftM3 ArithSeq
(return ty)
(addTickWit wit)
(addTickArithSeqInfo arith_seq)
where addTickWit Nothing = return Nothing
addTickWit (Just fl) = do fl' <- addTickSyntaxExpr hpcSrcSpan fl
... | 444 | addTickHsExpr (ArithSeq ty wit arith_seq) =
liftM3 ArithSeq
(return ty)
(addTickWit wit)
(addTickArithSeqInfo arith_seq)
where addTickWit Nothing = return Nothing
addTickWit (Just fl) = do fl' <- addTickSyntaxExpr hpcSrcSpan fl
... | 444 | false | false | 0 | 11 | 176 | 98 | 46 | 52 | null | null |
rudymatela/llcheck | src/Test/LeanCheck/Utils/Types.hs | bsd-3-clause | oNat6 ::(Int->Int->Int)->(Nat6->Nat6->Nat6) ; oNat6 = oNewtype nat6 unNat6 | 79 | oNat6 ::(Int->Int->Int)->(Nat6->Nat6->Nat6)
oNat6 = oNewtype nat6 unNat6 | 75 | oNat6 = oNewtype nat6 unNat6 | 30 | false | true | 0 | 8 | 12 | 46 | 24 | 22 | null | null |
romanb/amazonka | amazonka-rds/gen/Network/AWS/RDS/DescribeDBSnapshots.hs | mpl-2.0 | -- | This parameter is not currently supported.
ddbsFilters :: Lens' DescribeDBSnapshots [Filter]
ddbsFilters = lens _ddbsFilters (\s a -> s { _ddbsFilters = a }) . _List | 170 | ddbsFilters :: Lens' DescribeDBSnapshots [Filter]
ddbsFilters = lens _ddbsFilters (\s a -> s { _ddbsFilters = a }) . _List | 122 | ddbsFilters = lens _ddbsFilters (\s a -> s { _ddbsFilters = a }) . _List | 72 | true | true | 1 | 10 | 27 | 53 | 26 | 27 | null | null |
hvr/lens | src/Language/Haskell/TH/Lens.hs | bsd-3-clause | _StringL :: Prism' Lit String
_StringL
= prism remitter reviewer
where
remitter = StringL
reviewer (StringL x) = Right x
reviewer x = Left x | 162 | _StringL :: Prism' Lit String
_StringL
= prism remitter reviewer
where
remitter = StringL
reviewer (StringL x) = Right x
reviewer x = Left x | 162 | _StringL
= prism remitter reviewer
where
remitter = StringL
reviewer (StringL x) = Right x
reviewer x = Left x | 132 | false | true | 2 | 6 | 46 | 71 | 28 | 43 | null | null |
mstksg/hledger | hledger-lib/Hledger/Query.hs | gpl-3.0 | -- XXX pack
matchesAccount (Depth d) a = accountNameLevel a <= d | 64 | matchesAccount (Depth d) a = accountNameLevel a <= d | 52 | matchesAccount (Depth d) a = accountNameLevel a <= d | 52 | true | false | 0 | 7 | 11 | 25 | 12 | 13 | null | null |
odanielb/Spanish-Syllabification | syllabification.hs | mit | --Vowel + ConsGroup = Vowel
getFirstCategorySyllable (x:xs) = x : getFirstCategorySyllable(xs) | 100 | getFirstCategorySyllable (x:xs) = x : getFirstCategorySyllable(xs) | 66 | getFirstCategorySyllable (x:xs) = x : getFirstCategorySyllable(xs) | 66 | true | false | 0 | 7 | 16 | 27 | 14 | 13 | null | null |
mikeizbicki/typeparams | examples/coretest.hs | bsd-3-clause | -- resulting core:
--
-- doRuntime :: Int -> Int
-- doRuntime =
-- doRuntime1
-- `cast` (<Int>_R -> UnivCo representational Any Int
-- :: (Int -> Any) ~# (Int -> Int))
--
main = do
print $ doStatic 1234
print $ doRuntime 1233
print (rationalToFloat 2 1)
| 286 | main = do
print $ doStatic 1234
print $ doRuntime 1233
print (rationalToFloat 2 1)
| 98 | main = do
print $ doStatic 1234
print $ doRuntime 1233
print (rationalToFloat 2 1)
| 98 | true | false | 0 | 9 | 80 | 48 | 25 | 23 | null | null |
eigengo/hwsexp | core/main/Custom/Codegen.hs | apache-2.0 | addBlock :: String -> Codegen Name
addBlock bname = do
bls <- gets blocks
ix <- gets blockCount
nms <- gets names
let new = emptyBlock ix
(qname, supply) = uniqueName bname nms
modify $ \s -> s { blocks = Map.insert (Name qname) new bls
, blockCount = ix + 1
, names... | 372 | addBlock :: String -> Codegen Name
addBlock bname = do
bls <- gets blocks
ix <- gets blockCount
nms <- gets names
let new = emptyBlock ix
(qname, supply) = uniqueName bname nms
modify $ \s -> s { blocks = Map.insert (Name qname) new bls
, blockCount = ix + 1
, names... | 372 | addBlock bname = do
bls <- gets blocks
ix <- gets blockCount
nms <- gets names
let new = emptyBlock ix
(qname, supply) = uniqueName bname nms
modify $ \s -> s { blocks = Map.insert (Name qname) new bls
, blockCount = ix + 1
, names = supply
}
re... | 337 | false | true | 0 | 14 | 134 | 148 | 70 | 78 | null | null |
dgtized/dotfiles | dot/xmonad/xmonad.hs | bsd-3-clause | myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList
[ ((modm, xK_p), spawn "dmenu_run -b" )
, ((modm, xK_o), nextScreen)
, ((modm .|. shiftMask, xK_o), shiftNextScreen)
, ((modm, xK_semicolon), toggleWS)
, ((modm, xK_quoteright), moveTo Next HiddenNonEm... | 340 | myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList
[ ((modm, xK_p), spawn "dmenu_run -b" )
, ((modm, xK_o), nextScreen)
, ((modm .|. shiftMask, xK_o), shiftNextScreen)
, ((modm, xK_semicolon), toggleWS)
, ((modm, xK_quoteright), moveTo Next HiddenNonEm... | 340 | myKeys conf@(XConfig {XMonad.modMask = modm}) = M.fromList
[ ((modm, xK_p), spawn "dmenu_run -b" )
, ((modm, xK_o), nextScreen)
, ((modm .|. shiftMask, xK_o), shiftNextScreen)
, ((modm, xK_semicolon), toggleWS)
, ((modm, xK_quoteright), moveTo Next HiddenNonEm... | 340 | false | false | 0 | 10 | 106 | 118 | 71 | 47 | null | null |
JonathanReeve/JonathanReeve.github.io | src/Pandoc.hs | gpl-2.0 | render :: Monad m => Pandoc -> HtmlT m ()
render doc =
either error id $ first show $ runExcept $ do
runPure'
$ fmap toHtmlRaw
$ writeHtml5String writerSettings doc | 178 | render :: Monad m => Pandoc -> HtmlT m ()
render doc =
either error id $ first show $ runExcept $ do
runPure'
$ fmap toHtmlRaw
$ writeHtml5String writerSettings doc | 178 | render doc =
either error id $ first show $ runExcept $ do
runPure'
$ fmap toHtmlRaw
$ writeHtml5String writerSettings doc | 136 | false | true | 0 | 10 | 44 | 71 | 32 | 39 | null | null |
conal/shady-render | src/Shady/Attribute.hs | agpl-3.0 | vsink' _ v = error ("vsink: non-vector variable " ++ show v) | 60 | vsink' _ v = error ("vsink: non-vector variable " ++ show v) | 60 | vsink' _ v = error ("vsink: non-vector variable " ++ show v) | 60 | false | false | 1 | 8 | 11 | 25 | 11 | 14 | null | null |
DanielG/kvm-in-a-box | src/Passwd.hs | agpl-3.0 | checkSystemId :: (Num a, Ord a) => [a] -> a -> a
checkSystemId uids uid =
if uid >= 65533 || uid `elem` uids
then error "Out of system U/GIDs!"
else uid | 168 | checkSystemId :: (Num a, Ord a) => [a] -> a -> a
checkSystemId uids uid =
if uid >= 65533 || uid `elem` uids
then error "Out of system U/GIDs!"
else uid | 168 | checkSystemId uids uid =
if uid >= 65533 || uid `elem` uids
then error "Out of system U/GIDs!"
else uid | 119 | false | true | 0 | 8 | 47 | 67 | 36 | 31 | null | null |
tjakway/ghcjvm | compiler/simplCore/SetLevels.hs | bsd-3-clause | lvlExpr env (_, AnnCase scrut case_bndr ty alts)
= do { scrut' <- lvlMFE True env scrut
; lvlCase env (freeVarsOf scrut) scrut' case_bndr ty alts } | 156 | lvlExpr env (_, AnnCase scrut case_bndr ty alts)
= do { scrut' <- lvlMFE True env scrut
; lvlCase env (freeVarsOf scrut) scrut' case_bndr ty alts } | 156 | lvlExpr env (_, AnnCase scrut case_bndr ty alts)
= do { scrut' <- lvlMFE True env scrut
; lvlCase env (freeVarsOf scrut) scrut' case_bndr ty alts } | 156 | false | false | 0 | 9 | 35 | 65 | 32 | 33 | null | null |
snoyberg/ghc | compiler/typecheck/TcRnTypes.hs | bsd-3-clause | pprCtO ProcOrigin = text "a proc expression" | 55 | pprCtO ProcOrigin = text "a proc expression" | 55 | pprCtO ProcOrigin = text "a proc expression" | 55 | false | false | 0 | 5 | 17 | 13 | 5 | 8 | null | null |
peterokagey/haskellOEIS | src/Palindromes/A094536.hs | apache-2.0 | a094536_list :: [Integer]
a094536_list = [0, 0] ++ remainder 2 where
remainder n = 2 * a094536 (n - 1) + delta : remainder (n + 1) where
delta = if odd n then 0 else 2^(n `div` 2) - a094536 (n `div` 2) | 211 | a094536_list :: [Integer]
a094536_list = [0, 0] ++ remainder 2 where
remainder n = 2 * a094536 (n - 1) + delta : remainder (n + 1) where
delta = if odd n then 0 else 2^(n `div` 2) - a094536 (n `div` 2) | 211 | a094536_list = [0, 0] ++ remainder 2 where
remainder n = 2 * a094536 (n - 1) + delta : remainder (n + 1) where
delta = if odd n then 0 else 2^(n `div` 2) - a094536 (n `div` 2) | 185 | false | true | 9 | 8 | 53 | 134 | 64 | 70 | null | null |
castaway/pandoc | src/Text/Pandoc/Readers/LaTeX.hs | gpl-2.0 | cedilla 'C' = 'Ç' | 17 | cedilla 'C' = 'Ç' | 17 | cedilla 'C' = 'Ç' | 17 | false | false | 0 | 5 | 3 | 9 | 4 | 5 | null | null |
diku-dk/futhark | src/Futhark/Optimise/Simplify/Rule.hs | isc | rulesForStm :: Stm rep -> Rules rep a -> [SimplificationRule rep a]
rulesForStm stm = case stmExp stm of
BasicOp {} -> rulesBasicOp
DoLoop {} -> rulesDoLoop
Op {} -> rulesOp
If {} -> rulesIf
_ -> rulesAny | 214 | rulesForStm :: Stm rep -> Rules rep a -> [SimplificationRule rep a]
rulesForStm stm = case stmExp stm of
BasicOp {} -> rulesBasicOp
DoLoop {} -> rulesDoLoop
Op {} -> rulesOp
If {} -> rulesIf
_ -> rulesAny | 214 | rulesForStm stm = case stmExp stm of
BasicOp {} -> rulesBasicOp
DoLoop {} -> rulesDoLoop
Op {} -> rulesOp
If {} -> rulesIf
_ -> rulesAny | 146 | false | true | 0 | 10 | 47 | 97 | 45 | 52 | null | null |
dysinger/amazonka | amazonka-opsworks/gen/Network/AWS/OpsWorks/AssociateElasticIp.hs | mpl-2.0 | -- | The Elastic IP address.
aeiElasticIp :: Lens' AssociateElasticIp Text
aeiElasticIp = lens _aeiElasticIp (\s a -> s { _aeiElasticIp = a }) | 142 | aeiElasticIp :: Lens' AssociateElasticIp Text
aeiElasticIp = lens _aeiElasticIp (\s a -> s { _aeiElasticIp = a }) | 113 | aeiElasticIp = lens _aeiElasticIp (\s a -> s { _aeiElasticIp = a }) | 67 | true | true | 0 | 9 | 23 | 40 | 22 | 18 | null | null |
bravit/Idris-dev | src/Idris/Delaborate.hs | bsd-3-clause | bugaddr = "https://github.com/idris-lang/Idris-dev/issues" | 58 | bugaddr = "https://github.com/idris-lang/Idris-dev/issues" | 58 | bugaddr = "https://github.com/idris-lang/Idris-dev/issues" | 58 | false | false | 0 | 4 | 2 | 6 | 3 | 3 | null | null |
mparusinski/Haskell-number-theory-library | ProjectiveSpaces/ModularProjectiveSpace.hs | gpl-3.0 | getCoordinate ::
(Ring a) => Int -> ModularProjectiveSpace a -> IO (ModularRing a)
getCoordinate ix (MPS point)
= readArray point ix | 136 | getCoordinate ::
(Ring a) => Int -> ModularProjectiveSpace a -> IO (ModularRing a)
getCoordinate ix (MPS point)
= readArray point ix | 136 | getCoordinate ix (MPS point)
= readArray point ix | 51 | false | true | 0 | 10 | 24 | 56 | 27 | 29 | null | null |
UCSD-PL/RefScript | src/Language/Rsc/Lookup.hs | bsd-3-clause | extractCtor :: (PPRD r, CEnv r g) => g r -> RType r -> Maybe (RType r)
--------------------------------------------------------------------------------
extractCtor γ t = go t
where
go (TClass (BGen x _)) | Just (TD _ _ ms) <- resolveTypeInEnv γ x
= tm_ctor ms
go (TRef _ _) ... | 516 | extractCtor :: (PPRD r, CEnv r g) => g r -> RType r -> Maybe (RType r)
extractCtor γ t = go t
where
go (TClass (BGen x _)) | Just (TD _ _ ms) <- resolveTypeInEnv γ x
= tm_ctor ms
go (TRef _ _) = expandType def (envCHA γ) t >>= go
go (TObj _ ms _) = tm_ctor ms
... | 435 | extractCtor γ t = go t
where
go (TClass (BGen x _)) | Just (TD _ _ ms) <- resolveTypeInEnv γ x
= tm_ctor ms
go (TRef _ _) = expandType def (envCHA γ) t >>= go
go (TObj _ ms _) = tm_ctor ms
go _ = Nothing
------------------------------------... | 364 | true | true | 3 | 11 | 147 | 177 | 85 | 92 | null | null |
leshchevds/ganeti | src/Ganeti/THH/PyRPC.hs | bsd-2-clause | nameToFunc :: Name -> Q Doc
nameToFunc name = do
(as, _) <- funArgs `liftM` typeOfFun name
-- If the function has just one argument, try if it isn't a tuple;
-- if not, use the arguments as they are.
let as' = fromMaybe as $ case as of
[t] -> tupleArgs t -- TODO CHECK!
... | 568 | nameToFunc :: Name -> Q Doc
nameToFunc name = do
(as, _) <- funArgs `liftM` typeOfFun name
-- If the function has just one argument, try if it isn't a tuple;
-- if not, use the arguments as they are.
let as' = fromMaybe as $ case as of
[t] -> tupleArgs t -- TODO CHECK!
... | 568 | nameToFunc name = do
(as, _) <- funArgs `liftM` typeOfFun name
-- If the function has just one argument, try if it isn't a tuple;
-- if not, use the arguments as they are.
let as' = fromMaybe as $ case as of
[t] -> tupleArgs t -- TODO CHECK!
... | 540 | false | true | 0 | 15 | 182 | 109 | 55 | 54 | null | null |
PaulGustafson/stringnet | Stringnet.hs | mit | treeLabel :: (Edge -> Object) -> Tree Edge -> Object
treeLabel label (Leaf e) = label e | 87 | treeLabel :: (Edge -> Object) -> Tree Edge -> Object
treeLabel label (Leaf e) = label e | 87 | treeLabel label (Leaf e) = label e | 34 | false | true | 0 | 10 | 16 | 49 | 22 | 27 | null | null |
diku-dk/futhark | src/Futhark/Analysis/SymbolTable.hs | isc | insertStm ::
(ASTRep rep, IndexOp (Op rep), Aliases.Aliased rep) =>
Stm rep ->
SymbolTable rep ->
SymbolTable rep
insertStm stm vtable =
flip (foldl' $ flip consume) (namesToList stm_consumed) $
flip (foldl' addRevAliases) (patElems $ stmPat stm) $
insertEntries (zip names $ map LetBound $ bindingEn... | 1,396 | insertStm ::
(ASTRep rep, IndexOp (Op rep), Aliases.Aliased rep) =>
Stm rep ->
SymbolTable rep ->
SymbolTable rep
insertStm stm vtable =
flip (foldl' $ flip consume) (namesToList stm_consumed) $
flip (foldl' addRevAliases) (patElems $ stmPat stm) $
insertEntries (zip names $ map LetBound $ bindingEn... | 1,396 | insertStm stm vtable =
flip (foldl' $ flip consume) (namesToList stm_consumed) $
flip (foldl' addRevAliases) (patElems $ stmPat stm) $
insertEntries (zip names $ map LetBound $ bindingEntries stm vtable) vtable
where
names = patNames $ stmPat stm
stm_consumed = expandAliases (Aliases.consumedInStm... | 1,274 | false | true | 6 | 12 | 463 | 419 | 205 | 214 | null | null |
timjs/spl-compiler | Old/Analyzer.hs | bsd-3-clause | info :: (MonadReader Environment m) => Name -> m Info
info n = asks (M.lookup n) | 80 | info :: (MonadReader Environment m) => Name -> m Info
info n = asks (M.lookup n) | 80 | info n = asks (M.lookup n) | 26 | false | true | 0 | 8 | 15 | 43 | 21 | 22 | null | null |
Crazycolorz5/AlgebraicPrelude | Groups.hs | mit | negate :: (AbelianGroup g) => g -> g
negate = neg | 50 | negate :: (AbelianGroup g) => g -> g
negate = neg | 49 | negate = neg | 12 | false | true | 0 | 6 | 11 | 24 | 13 | 11 | null | null |
brendanhay/gogol | gen/src/Gen/Types/Id.hs | mpl-2.0 | pname = pre (flip Text.snoc '_' . Text.cons 'p' . upperHead . renameField) | 74 | pname = pre (flip Text.snoc '_' . Text.cons 'p' . upperHead . renameField) | 74 | pname = pre (flip Text.snoc '_' . Text.cons 'p' . upperHead . renameField) | 74 | false | false | 1 | 11 | 12 | 39 | 17 | 22 | null | null |
gleachkr/Carnap | Carnap/src/Carnap/Languages/Util/GenericParsers.hs | gpl-3.0 | altQuantifiedSentenceParser ::
( QuantLanguage (FixLang lex f) (FixLang lex t)
, BoundVars lex
, Show (FixLang lex t)
, Monad m
) => ParsecT String u m (FixLang lex t) -> ParsecT String u m (FixLang lex f)
-> ParsecT String u m (FixLang lex f)
altQuantifiedSentenceParser parseFreeVar f... | 744 | altQuantifiedSentenceParser ::
( QuantLanguage (FixLang lex f) (FixLang lex t)
, BoundVars lex
, Show (FixLang lex t)
, Monad m
) => ParsecT String u m (FixLang lex t) -> ParsecT String u m (FixLang lex f)
-> ParsecT String u m (FixLang lex f)
altQuantifiedSentenceParser parseFreeVar f... | 744 | altQuantifiedSentenceParser parseFreeVar formulaParser =
do char '('
s <- optionMaybe (oneOf "E∃" <?> "a quantifer symbol")
v <- parseFreeVar
char ')'
spaces
f <- formulaParser
let bf x = subBoundVar v x f
--partially applied, retu... | 466 | false | true | 0 | 13 | 255 | 249 | 117 | 132 | null | null |
beni55/LambdaHack | Game/LambdaHack/Client/AI/ConditionClient.hs | bsd-3-clause | condHpTooLowM :: MonadClient m => ActorId -> m Bool
condHpTooLowM aid = do
b <- getsState $ getActorBody aid
activeItems <- activeItemsClient aid
return $! hpTooLow b activeItems
-- | Require the actor stands over a triggerable tile. | 240 | condHpTooLowM :: MonadClient m => ActorId -> m Bool
condHpTooLowM aid = do
b <- getsState $ getActorBody aid
activeItems <- activeItemsClient aid
return $! hpTooLow b activeItems
-- | Require the actor stands over a triggerable tile. | 240 | condHpTooLowM aid = do
b <- getsState $ getActorBody aid
activeItems <- activeItemsClient aid
return $! hpTooLow b activeItems
-- | Require the actor stands over a triggerable tile. | 188 | false | true | 0 | 9 | 44 | 65 | 29 | 36 | null | null |
tomahawkins/statechart | src/Code.hs | bsd-3-clause | codeAttr :: Attribute -> String
codeAttr a = printf "static %s %s%s;\n" (attrType a) (attrName a) (case attrInit a of { Nothing -> ""; Just i -> " = " ++ i}) | 157 | codeAttr :: Attribute -> String
codeAttr a = printf "static %s %s%s;\n" (attrType a) (attrName a) (case attrInit a of { Nothing -> ""; Just i -> " = " ++ i}) | 157 | codeAttr a = printf "static %s %s%s;\n" (attrType a) (attrName a) (case attrInit a of { Nothing -> ""; Just i -> " = " ++ i}) | 125 | false | true | 0 | 10 | 31 | 71 | 36 | 35 | null | null |
zobot/MeshGenerator | src/Types.hs | bsd-3-clause | toV3fromList _ = Nothing | 33 | toV3fromList _ = Nothing | 33 | toV3fromList _ = Nothing | 33 | false | false | 0 | 5 | 12 | 9 | 4 | 5 | null | null |
karknu/rws | src/Util.hs | bsd-3-clause | parseIntAttribute :: Num b => String -> Parser b
parseIntAttribute s = do
symbol s
symbol "="
a <- integer
whiteSpace
return (fromIntegral a) | 151 | parseIntAttribute :: Num b => String -> Parser b
parseIntAttribute s = do
symbol s
symbol "="
a <- integer
whiteSpace
return (fromIntegral a) | 151 | parseIntAttribute s = do
symbol s
symbol "="
a <- integer
whiteSpace
return (fromIntegral a) | 102 | false | true | 0 | 9 | 33 | 62 | 26 | 36 | null | null |
tjakway/ghcjvm | compiler/cmm/CLabel.hs | bsd-3-clause | pprCLbl (CaseLabel u CaseReturnInfo)
= hcat [pprUnique u, text "_info"] | 73 | pprCLbl (CaseLabel u CaseReturnInfo)
= hcat [pprUnique u, text "_info"] | 73 | pprCLbl (CaseLabel u CaseReturnInfo)
= hcat [pprUnique u, text "_info"] | 73 | false | false | 0 | 6 | 11 | 33 | 15 | 18 | null | null |
rueshyna/gogol | gogol-analytics/gen/Network/Google/Resource/Analytics/Management/CustomDimensions/Insert.hs | mpl-2.0 | -- | Multipart request metadata.
mcdiPayload :: Lens' ManagementCustomDimensionsInsert CustomDimension
mcdiPayload
= lens _mcdiPayload (\ s a -> s{_mcdiPayload = a}) | 167 | mcdiPayload :: Lens' ManagementCustomDimensionsInsert CustomDimension
mcdiPayload
= lens _mcdiPayload (\ s a -> s{_mcdiPayload = a}) | 134 | mcdiPayload
= lens _mcdiPayload (\ s a -> s{_mcdiPayload = a}) | 64 | true | true | 0 | 9 | 22 | 42 | 22 | 20 | null | null |
spechub/Hets | CommonLogic/Parse_CLIF.hs | gpl-2.0 | symbs :: GenParser Char st ([NAME_OR_SEQMARK], [Token])
symbs = do
s <- intNameOrSeqMark
do c <- commaT `followedWith` intNameOrSeqMark
(is, ps) <- symbs
return (s : is, c : ps)
<|> return ([s], [])
-- | parse a list of symbol mappings | 278 | symbs :: GenParser Char st ([NAME_OR_SEQMARK], [Token])
symbs = do
s <- intNameOrSeqMark
do c <- commaT `followedWith` intNameOrSeqMark
(is, ps) <- symbs
return (s : is, c : ps)
<|> return ([s], [])
-- | parse a list of symbol mappings | 278 | symbs = do
s <- intNameOrSeqMark
do c <- commaT `followedWith` intNameOrSeqMark
(is, ps) <- symbs
return (s : is, c : ps)
<|> return ([s], [])
-- | parse a list of symbol mappings | 222 | false | true | 0 | 12 | 84 | 105 | 56 | 49 | null | null |
alanz/annotations-play | src/ch6-generics.hs | unlicense | {-
>let expr2 = readExpr "(1 :: (Int, Int), 2 + (3, 4))"
>errorCata (mkErrorAlg inferType) Expr expr2
Failed
[("lhs and rhs of :: must have equal types", Bounds {leftMargin = (1, 1), rightMargin = (16, 16)})
, ("lhs and rhs of + must have equal types"
-}
expr2 = readExpr "(1 :: (Int, Int), 2 + (3, 4))" | 306 | expr2 = readExpr "(1 :: (Int, Int), 2 + (3, 4))" | 48 | expr2 = readExpr "(1 :: (Int, Int), 2 + (3, 4))" | 48 | true | false | 0 | 5 | 61 | 10 | 5 | 5 | null | null |
michaelfeathers/vih | editbuffer.hs | mit | moveLeft, moveRight, moveUp, moveDown :: EditBuffer -> EditBuffer
moveLeft = saturate (-1, 0) | 94 | moveLeft, moveRight, moveUp, moveDown :: EditBuffer -> EditBuffer
moveLeft = saturate (-1, 0) | 94 | moveLeft = saturate (-1, 0) | 28 | false | true | 0 | 7 | 13 | 32 | 20 | 12 | null | null |
thalerjonathan/phd | coding/prototyping/haskell/HerosAndCowardsIO/src/HACFrontend.hs | gpl-3.0 | truncateToWorld :: AgentPosition -> AgentPosition
truncateToWorld (x, y) = wrap (xFract, yFract)
where
xFract = fractionalPart x
yFract = fractionalPart y | 174 | truncateToWorld :: AgentPosition -> AgentPosition
truncateToWorld (x, y) = wrap (xFract, yFract)
where
xFract = fractionalPart x
yFract = fractionalPart y | 174 | truncateToWorld (x, y) = wrap (xFract, yFract)
where
xFract = fractionalPart x
yFract = fractionalPart y | 124 | false | true | 0 | 6 | 40 | 52 | 27 | 25 | null | null |
wuxb45/Haskell-RBTree | Data/Tree/RBTree.hs | bsd-3-clause | topMostZip :: RBZip a -> RBZip a
topMostZip (RBZip s ((Step c v d s1):path)) = case d of
ToLeft -> topMostZip (RBZip (Node c v s s1) path)
ToRight -> topMostZip (RBZip (Node c v s1 s) path) | 206 | topMostZip :: RBZip a -> RBZip a
topMostZip (RBZip s ((Step c v d s1):path)) = case d of
ToLeft -> topMostZip (RBZip (Node c v s s1) path)
ToRight -> topMostZip (RBZip (Node c v s1 s) path) | 206 | topMostZip (RBZip s ((Step c v d s1):path)) = case d of
ToLeft -> topMostZip (RBZip (Node c v s s1) path)
ToRight -> topMostZip (RBZip (Node c v s1 s) path) | 173 | false | true | 0 | 12 | 55 | 113 | 55 | 58 | null | null |
ComputationWithBoundedResources/tct-common | src/Tct/Common/CeTA.hs | bsd-3-clause | certificationProblem :: Xml.XmlContent -> Xml.XmlContent -> Xml.XmlContent
certificationProblem complexityInput' complexityProof' =
flip Xml.setAtts [att1, att2] $ Xml.elt "certificationProblem" [input, cpfVersion, proof, origin]
where
att1 = Xml.att "xmlns:xsi" "http://www.w3.org/2001/XMLSchema-instance"
... | 774 | certificationProblem :: Xml.XmlContent -> Xml.XmlContent -> Xml.XmlContent
certificationProblem complexityInput' complexityProof' =
flip Xml.setAtts [att1, att2] $ Xml.elt "certificationProblem" [input, cpfVersion, proof, origin]
where
att1 = Xml.att "xmlns:xsi" "http://www.w3.org/2001/XMLSchema-instance"
... | 774 | certificationProblem complexityInput' complexityProof' =
flip Xml.setAtts [att1, att2] $ Xml.elt "certificationProblem" [input, cpfVersion, proof, origin]
where
att1 = Xml.att "xmlns:xsi" "http://www.w3.org/2001/XMLSchema-instance"
att2 = Xml.att "xsi:noNamespaceSchemaLocation" "cpf.xsd"
input = Xml.e... | 699 | false | true | 10 | 8 | 153 | 268 | 119 | 149 | null | null |
brendanhay/gogol | gogol-cloudtrace/gen/Network/Google/CloudTrace/Types/Product.hs | mpl-2.0 | -- | Creates a value of 'StackFrame' with the minimum fields required to make a request.
--
-- Use one of the following lenses to modify other fields as desired:
--
-- * 'sfLoadModule'
--
-- * 'sfOriginalFunctionName'
--
-- * 'sfLineNumber'
--
-- * 'sfSourceVersion'
--
-- * 'sfFunctionName'
--
-- * 'sfColumnNumber'
--
... | 624 | stackFrame
:: StackFrame
stackFrame =
StackFrame'
{ _sfLoadModule = Nothing
, _sfOriginalFunctionName = Nothing
, _sfLineNumber = Nothing
, _sfSourceVersion = Nothing
, _sfFunctionName = Nothing
, _sfColumnNumber = Nothing
, _sfFileName = Nothing
} | 286 | stackFrame =
StackFrame'
{ _sfLoadModule = Nothing
, _sfOriginalFunctionName = Nothing
, _sfLineNumber = Nothing
, _sfSourceVersion = Nothing
, _sfFunctionName = Nothing
, _sfColumnNumber = Nothing
, _sfFileName = Nothing
} | 257 | true | true | 0 | 7 | 130 | 82 | 54 | 28 | null | null |
holdenlee/fluidity | SeekWhence/Functions.hs | mit | _fun = makeF2 _fun' | 19 | _fun = makeF2 _fun' | 19 | _fun = makeF2 _fun' | 19 | false | false | 1 | 5 | 3 | 13 | 4 | 9 | null | null |
suhailshergill/liboleg | Language/TEval/TInfLetI.hs | bsd-3-clause | -- TInt
-- these are essentially tests of hygiene
testl4 = teval env0 $ L "x" (Let ("x",vx `A` (I 1)) (vx :+ (I 2))) | 118 | testl4 = teval env0 $ L "x" (Let ("x",vx `A` (I 1)) (vx :+ (I 2))) | 67 | testl4 = teval env0 $ L "x" (Let ("x",vx `A` (I 1)) (vx :+ (I 2))) | 67 | true | false | 0 | 12 | 26 | 59 | 32 | 27 | null | null |
fhsjaagshs/niagra | src/Data/Niagra/AccumulatorT.hs | mit | -- |Get the accumulations.
getAccumulation :: (Monad m) => AccumulatorT s i m (Accumulation s)
getAccumulation = AccumulatorT $ \_ _ st i -> return (st, st, i) | 159 | getAccumulation :: (Monad m) => AccumulatorT s i m (Accumulation s)
getAccumulation = AccumulatorT $ \_ _ st i -> return (st, st, i) | 132 | getAccumulation = AccumulatorT $ \_ _ st i -> return (st, st, i) | 64 | true | true | 0 | 9 | 27 | 68 | 35 | 33 | null | null |
penteract/HigherOrderHornRefinement | HOCHC/Printing.hs | bsd-3-clause | smtl = [ ("and","∧"), ("=>","⇒"), ("or","∨"), ("not","¬")] | 58 | smtl = [ ("and","∧"), ("=>","⇒"), ("or","∨"), ("not","¬")] | 58 | smtl = [ ("and","∧"), ("=>","⇒"), ("or","∨"), ("not","¬")] | 58 | false | false | 1 | 6 | 6 | 45 | 27 | 18 | null | null |
fsestini/stlc-machine | src/Parser.hs | mit | point :: Parser ()
point = char '.' *> spaces *> return () | 58 | point :: Parser ()
point = char '.' *> spaces *> return () | 58 | point = char '.' *> spaces *> return () | 39 | false | true | 2 | 7 | 12 | 39 | 17 | 22 | null | null |
hvr/ghci-ng | ghc/GhciTags.hs | bsd-3-clause | ghciCreateTagsFile :: TagsKind -> FilePath -> GHCi ()
ghciCreateTagsFile kind file = do
createTagsFile kind file
-- ToDo:
-- - remove restriction that all modules must be interpreted
-- (problem: we don't know source locations for entities unless
-- we compiled the module.
--
-- - extract cr... | 445 | ghciCreateTagsFile :: TagsKind -> FilePath -> GHCi ()
ghciCreateTagsFile kind file = do
createTagsFile kind file
-- ToDo:
-- - remove restriction that all modules must be interpreted
-- (problem: we don't know source locations for entities unless
-- we compiled the module.
--
-- - extract cr... | 445 | ghciCreateTagsFile kind file = do
createTagsFile kind file
-- ToDo:
-- - remove restriction that all modules must be interpreted
-- (problem: we don't know source locations for entities unless
-- we compiled the module.
--
-- - extract createTagsFile so it can be used from the command-line
-... | 391 | false | true | 0 | 9 | 102 | 50 | 26 | 24 | null | null |
UU-ComputerScience/uulib | src/UU/Util/BinaryTrees.hs | bsd-3-clause | btLookup :: (a -> b) -> (a -> c) -> (b -> d -> Ordering) -> BinSearchTree a -> d -> Maybe c
btLookup key val cmp (Node Nil kv Nil)
= let comp = cmp (key kv)
r = val kv
in \i -> case comp i of
LT -> Nothing
EQ -> Just r
GT -> Nothing | 296 | btLookup :: (a -> b) -> (a -> c) -> (b -> d -> Ordering) -> BinSearchTree a -> d -> Maybe c
btLookup key val cmp (Node Nil kv Nil)
= let comp = cmp (key kv)
r = val kv
in \i -> case comp i of
LT -> Nothing
EQ -> Just r
GT -> Nothing | 296 | btLookup key val cmp (Node Nil kv Nil)
= let comp = cmp (key kv)
r = val kv
in \i -> case comp i of
LT -> Nothing
EQ -> Just r
GT -> Nothing | 204 | false | true | 0 | 13 | 122 | 147 | 71 | 76 | null | null |
thalerjonathan/phd | coding/libraries/chimera/examples/ABS/BilateralTrade/Model.hs | gpl-3.0 | -------------------------------------------------------------------------------
-------------------------------------------------------------------------------
-- Model parameters
-------------------------------------------------------------------------------
-- Number of agents
agents :: Int
agents = 100 | 307 | agents :: Int
agents = 100 | 26 | agents = 100 | 12 | true | true | 0 | 4 | 16 | 16 | 11 | 5 | null | null |
kadena-io/pact | src/Pact/Persist/MockPersist.hs | bsd-3-clause | mkMockPersistEnv :: Loggers -> MockPersist -> IO (PactDbEnv (DbEnv ()))
mkMockPersistEnv l mp = mkPactDbEnv pactdb (initDbEnv l (persister mp) ()) | 146 | mkMockPersistEnv :: Loggers -> MockPersist -> IO (PactDbEnv (DbEnv ()))
mkMockPersistEnv l mp = mkPactDbEnv pactdb (initDbEnv l (persister mp) ()) | 146 | mkMockPersistEnv l mp = mkPactDbEnv pactdb (initDbEnv l (persister mp) ()) | 74 | false | true | 0 | 12 | 20 | 64 | 31 | 33 | null | null |
nevrenato/Hets_Fork | Driver/WriteLibDefn.hs | gpl-2.0 | {- |
Write the given LIB_DEFN in every format that HetcatsOpts includes.
Filenames are determined by the output formats.
-}
writeLibDefn :: GlobalAnnos -> FilePath -> HetcatsOpts -> LIB_DEFN -> IO ()
writeLibDefn ga file opts ld = do
let (odir, filePrefix) = getFilePrefix opts file
printXml fn = writeFi... | 1,121 | writeLibDefn :: GlobalAnnos -> FilePath -> HetcatsOpts -> LIB_DEFN -> IO ()
writeLibDefn ga file opts ld = do
let (odir, filePrefix) = getFilePrefix opts file
printXml fn = writeFile fn $ ppTopElement (xmlLibDefn ga ld)
printAscii fn = writeEncFile (ioEncoding opts) fn
$ showGlobalDoc ga l... | 993 | writeLibDefn ga file opts ld = do
let (odir, filePrefix) = getFilePrefix opts file
printXml fn = writeFile fn $ ppTopElement (xmlLibDefn ga ld)
printAscii fn = writeEncFile (ioEncoding opts) fn
$ showGlobalDoc ga ld "\n"
printHtml fn = writeEncFile (ioEncoding opts) fn
$ ... | 917 | true | true | 0 | 19 | 361 | 312 | 145 | 167 | null | null |
vikraman/ghc | compiler/basicTypes/Var.hs | bsd-3-clause | setVarType :: Id -> Type -> Id
setVarType id ty = id { varType = ty } | 69 | setVarType :: Id -> Type -> Id
setVarType id ty = id { varType = ty } | 69 | setVarType id ty = id { varType = ty } | 38 | false | true | 0 | 8 | 16 | 41 | 19 | 22 | null | null |
tjunier/mlgsc | src/Output.hs | mit | run :: Show a => Parser a -> String -> IO ()
run p input
= case (parse p "" input) of
Left err -> do { putStr "parse error at "
; print err
}
Right x -> print x | 214 | run :: Show a => Parser a -> String -> IO ()
run p input
= case (parse p "" input) of
Left err -> do { putStr "parse error at "
; print err
}
Right x -> print x | 214 | run p input
= case (parse p "" input) of
Left err -> do { putStr "parse error at "
; print err
}
Right x -> print x | 169 | false | true | 0 | 10 | 94 | 93 | 42 | 51 | null | null |
JamesSullivan1/Mpp | src/MppSymbolTable.hs | mit | sym_removescope (S_Tab (l:ls,nc,m)) = sym_deletelev l (S_Tab (ls,nc,m)) | 71 | sym_removescope (S_Tab (l:ls,nc,m)) = sym_deletelev l (S_Tab (ls,nc,m)) | 71 | sym_removescope (S_Tab (l:ls,nc,m)) = sym_deletelev l (S_Tab (ls,nc,m)) | 71 | false | false | 0 | 9 | 7 | 48 | 26 | 22 | null | null |
GaloisInc/galua | galua-jit/src/Galua/Micro/Translate/ExplicitRefs.hs | mit | doM :: M a -> R a
doM m = reader (const m) | 42 | doM :: M a -> R a
doM m = reader (const m) | 42 | doM m = reader (const m) | 24 | false | true | 0 | 7 | 12 | 37 | 16 | 21 | null | null |
plow-technologies/persistent | persistent-test/src/DataTypeTest.hs | mit | randomValues :: Int -> IO [DataTypeTable]
randomValues i = do
gs <- replicateM i newQCGen
return $ zipWith (unGen arbitrary) gs [0..] | 137 | randomValues :: Int -> IO [DataTypeTable]
randomValues i = do
gs <- replicateM i newQCGen
return $ zipWith (unGen arbitrary) gs [0..] | 137 | randomValues i = do
gs <- replicateM i newQCGen
return $ zipWith (unGen arbitrary) gs [0..] | 95 | false | true | 0 | 11 | 25 | 64 | 29 | 35 | null | null |
stevedonnelly/haskell | code/Text/Scanner.hs | mit | scan :: [String] -> String -> ([Token], [(Int, Char)])
scan = \patterns input -> let
rules = (zipIndices0 patterns)
selectMatch = \input previous rule -> let
(is_match, text) = (matchFront input (snd rule))
select_new = ((&&) is_match ((>) (length text) (length (snd previous))))
in (ifEl... | 995 | scan :: [String] -> String -> ([Token], [(Int, Char)])
scan = \patterns input -> let
rules = (zipIndices0 patterns)
selectMatch = \input previous rule -> let
(is_match, text) = (matchFront input (snd rule))
select_new = ((&&) is_match ((>) (length text) (length (snd previous))))
in (ifEl... | 995 | scan = \patterns input -> let
rules = (zipIndices0 patterns)
selectMatch = \input previous rule -> let
(is_match, text) = (matchFront input (snd rule))
select_new = ((&&) is_match ((>) (length text) (length (snd previous))))
in (ifElse select_new (fst rule, text) previous)
scan = \in... | 940 | false | true | 0 | 22 | 235 | 435 | 243 | 192 | null | null |
blanu/Dust-tools | Dust/Services/Shaper/ShaperClient.hs | gpl-2.0 | main :: IO()
main = do
eitherObs <- loadObservations "traffic.model"
case eitherObs of
Left error -> putStrLn "Error loading model"
Right obs -> do
let model = makeModel obs
let gen = makeGenerator model
shaperClient gen | 281 | main :: IO()
main = do
eitherObs <- loadObservations "traffic.model"
case eitherObs of
Left error -> putStrLn "Error loading model"
Right obs -> do
let model = makeModel obs
let gen = makeGenerator model
shaperClient gen | 281 | main = do
eitherObs <- loadObservations "traffic.model"
case eitherObs of
Left error -> putStrLn "Error loading model"
Right obs -> do
let model = makeModel obs
let gen = makeGenerator model
shaperClient gen | 268 | false | true | 0 | 17 | 96 | 91 | 37 | 54 | null | null |
tonymorris/story-board | example/Main.hs | bsd-3-clause | main :: IO ()
main = storyBoard 3000 $ map brand $ drop 0
[ titleSlide
, haskell_code
, bigBackground
, alignSlide
, bulletSlide
, orderedListSlide
, actSlide
, subSuperSlide
, cachingTiles
, scalingTiles
] | 228 | main :: IO ()
main = storyBoard 3000 $ map brand $ drop 0
[ titleSlide
, haskell_code
, bigBackground
, alignSlide
, bulletSlide
, orderedListSlide
, actSlide
, subSuperSlide
, cachingTiles
, scalingTiles
] | 228 | main = storyBoard 3000 $ map brand $ drop 0
[ titleSlide
, haskell_code
, bigBackground
, alignSlide
, bulletSlide
, orderedListSlide
, actSlide
, subSuperSlide
, cachingTiles
, scalingTiles
] | 214 | false | true | 0 | 7 | 56 | 66 | 36 | 30 | null | null |
siddhanathan/ghc | compiler/main/HscTypes.hs | bsd-3-clause | tyThingTyCon :: TyThing -> TyCon
tyThingTyCon (ATyCon tc) = tc | 62 | tyThingTyCon :: TyThing -> TyCon
tyThingTyCon (ATyCon tc) = tc | 62 | tyThingTyCon (ATyCon tc) = tc | 29 | false | true | 0 | 7 | 9 | 24 | 12 | 12 | null | null |
dsvictor94/pt-estruturado | PTEstruturado/Interpreter.hs | bsd-3-clause | interpreterLogica (ConsLogica v) = return $ Logi v | 50 | interpreterLogica (ConsLogica v) = return $ Logi v | 50 | interpreterLogica (ConsLogica v) = return $ Logi v | 50 | false | false | 0 | 7 | 7 | 22 | 10 | 12 | null | null |
lukemaurer/sequent-core | src/SequentCore.hs | bsd-3-clause | plugin :: Plugin
plugin = defaultPlugin {
installCoreToDos = \cmdLine todos -> do
reinitializeGlobals
let cmdLine' = concatMap words cmdLine
-- Allow -fplugin-opt=plugin:"opt1 opt2"
(sflags, leftovers, warns) <- parseSeqFlags cmdLine'
dflags <- getDynFlags
unless (null leftovers) $
... | 557 | plugin :: Plugin
plugin = defaultPlugin {
installCoreToDos = \cmdLine todos -> do
reinitializeGlobals
let cmdLine' = concatMap words cmdLine
-- Allow -fplugin-opt=plugin:"opt1 opt2"
(sflags, leftovers, warns) <- parseSeqFlags cmdLine'
dflags <- getDynFlags
unless (null leftovers) $
... | 557 | plugin = defaultPlugin {
installCoreToDos = \cmdLine todos -> do
reinitializeGlobals
let cmdLine' = concatMap words cmdLine
-- Allow -fplugin-opt=plugin:"opt1 opt2"
(sflags, leftovers, warns) <- parseSeqFlags cmdLine'
dflags <- getDynFlags
unless (null leftovers) $
liftIO $ errorMs... | 540 | false | true | 0 | 17 | 136 | 171 | 78 | 93 | null | null |
haroldcarr/learn-haskell-coq-ml-etc | agda/course/2017-conor_mcbride_cs410/CS410-17-master/lectures/ANSIEscapes.hs | unlicense | brownOnGrey str = "\ESC[0;33m\ESC[47m" ++ str ++ "\ESC[0m\ESC[47m" | 74 | brownOnGrey str = "\ESC[0;33m\ESC[47m" ++ str ++ "\ESC[0m\ESC[47m" | 74 | brownOnGrey str = "\ESC[0;33m\ESC[47m" ++ str ++ "\ESC[0m\ESC[47m" | 74 | false | false | 1 | 6 | 15 | 21 | 8 | 13 | null | null |
sdiehl/ghc | compiler/basicTypes/IdInfo.hs | bsd-3-clause | coVarDetails :: IdDetails
coVarDetails = CoVarId | 48 | coVarDetails :: IdDetails
coVarDetails = CoVarId | 48 | coVarDetails = CoVarId | 22 | false | true | 0 | 4 | 5 | 11 | 6 | 5 | null | null |
haskell/haddock | haddock-library/test/Documentation/Haddock/ParserSpec.hs | bsd-2-clause | main :: IO ()
main = hspec spec | 31 | main :: IO ()
main = hspec spec | 31 | main = hspec spec | 17 | false | true | 0 | 7 | 7 | 25 | 10 | 15 | null | null |
shapr/ghclive | src-main/Main.hs | bsd-3-clause | mkClientId :: MonadIO m => Editor -> m ClientId
mkClientId e = liftIO (modifyMVar (unique e) $ \u -> let u' = succ u in return (u',u')) | 135 | mkClientId :: MonadIO m => Editor -> m ClientId
mkClientId e = liftIO (modifyMVar (unique e) $ \u -> let u' = succ u in return (u',u')) | 135 | mkClientId e = liftIO (modifyMVar (unique e) $ \u -> let u' = succ u in return (u',u')) | 87 | false | true | 0 | 13 | 26 | 79 | 37 | 42 | null | null |
nomeata/sat-britney | IndexMap.hs | gpl-2.0 | elems :: Map t a1 -> [a1]
elems (IndexMap m1) = M.elems m1 | 58 | elems :: Map t a1 -> [a1]
elems (IndexMap m1) = M.elems m1 | 58 | elems (IndexMap m1) = M.elems m1 | 32 | false | true | 0 | 7 | 12 | 37 | 18 | 19 | null | null |
hausdorff/pyli | src/Lexer.hs | mit | dropSpace :: String -> String
dropSpace s = dropWhile isSpace s | 63 | dropSpace :: String -> String
dropSpace s = dropWhile isSpace s | 63 | dropSpace s = dropWhile isSpace s | 33 | false | true | 0 | 7 | 10 | 28 | 12 | 16 | null | null |
cordawyn/rdf4h | src/Text/RDF/RDF4H/Interact.hs | bsd-3-clause | -- Load an RDF using the given parseFunc, parser, and the location (filesystem path
-- or HTTP URL), calling error with the 'ParseFailure' message if unable to load
-- or parse for any reason.
_load :: forall p rdf. (RdfParser p, RDF rdf) =>
(p -> String -> IO (Either ParseFailure rdf)) ->
p ... | 411 | _load :: forall p rdf. (RdfParser p, RDF rdf) =>
(p -> String -> IO (Either ParseFailure rdf)) ->
p -> String -> IO rdf
_load parseFunc parser location = parseFunc parser location >>= _handle | 218 | _load parseFunc parser location = parseFunc parser location >>= _handle | 71 | true | true | 0 | 14 | 95 | 93 | 47 | 46 | null | null |
chreekat/yesod | yesod-default/Yesod/Default/Main.hs | bsd-2-clause | -- | Run your app, taking environment and port settings from the
-- commandline.
--
-- Use @'fromArgs'@ when using the provided @'DefaultEnv'@ type, or
-- @'fromArgsWith'@ when using a custom type
--
-- > main :: IO ()
-- > main = defaultMain fromArgs withMySite
--
-- or
--
-- > main :: IO ()
-- > main ... | 1,142 | defaultMain :: (Show env, Read env)
=> IO (AppConfig env extra)
-> (AppConfig env extra -> Logger -> IO Application)
-> IO ()
defaultMain load getApp = do
config <- load
logger <- defaultDevelopmentLogger
app <- getApp config logger
runSettings defaultSettings
... | 763 | defaultMain load getApp = do
config <- load
logger <- defaultDevelopmentLogger
app <- getApp config logger
runSettings defaultSettings
{ settingsPort = appPort config
} app
-- | Run your application continously, listening for SIGINT and exiting
-- when recieved
--
-- > withYourSite ... | 601 | true | true | 0 | 11 | 291 | 141 | 78 | 63 | null | null |
elieux/ghc | compiler/types/Type.hs | bsd-3-clause | isClosedAlgType :: Type -> Bool
isClosedAlgType ty
= case splitTyConApp_maybe ty of
Just (tc, ty_args) | isAlgTyCon tc && not (isFamilyTyCon tc)
-> ASSERT2( ty_args `lengthIs` tyConArity tc, ppr ty ) True
_other -> False
-- | Computes whether an argument (or let right hand side) should
-- be... | 415 | isClosedAlgType :: Type -> Bool
isClosedAlgType ty
= case splitTyConApp_maybe ty of
Just (tc, ty_args) | isAlgTyCon tc && not (isFamilyTyCon tc)
-> ASSERT2( ty_args `lengthIs` tyConArity tc, ppr ty ) True
_other -> False
-- | Computes whether an argument (or let right hand side) should
-- be... | 415 | isClosedAlgType ty
= case splitTyConApp_maybe ty of
Just (tc, ty_args) | isAlgTyCon tc && not (isFamilyTyCon tc)
-> ASSERT2( ty_args `lengthIs` tyConArity tc, ppr ty ) True
_other -> False
-- | Computes whether an argument (or let right hand side) should
-- be computed strictly or lazily, ba... | 383 | false | true | 0 | 14 | 90 | 100 | 48 | 52 | null | null |
sdiehl/ghc | testsuite/tests/perf/compiler/T12227.hs | bsd-3-clause | crash :: () -> Int
crash p1 = x + y
where
p2 = p1 -- This indirection is required to trigger the problem.
x = fst $ case goodConstructor (Proxy :: Proxy Foo) of
Dict -> (0, p2)
y = fst $ case goodConstructor (Proxy :: Proxy Foo) of
Dict -> (0, p2)
| 275 | crash :: () -> Int
crash p1 = x + y
where
p2 = p1 -- This indirection is required to trigger the problem.
x = fst $ case goodConstructor (Proxy :: Proxy Foo) of
Dict -> (0, p2)
y = fst $ case goodConstructor (Proxy :: Proxy Foo) of
Dict -> (0, p2)
| 275 | crash p1 = x + y
where
p2 = p1 -- This indirection is required to trigger the problem.
x = fst $ case goodConstructor (Proxy :: Proxy Foo) of
Dict -> (0, p2)
y = fst $ case goodConstructor (Proxy :: Proxy Foo) of
Dict -> (0, p2)
| 256 | false | true | 2 | 10 | 81 | 108 | 56 | 52 | null | null |
ssaavedra/liquidhaskell | benchmarks/esop2013-submission/Base.hs | bsd-3-clause | -- | /O(log n)/. The expression @('findWithDefault' def k map)@ returns
-- the value at key @k@ or returns default value @def@
-- when the key is not in the map.
--
-- > findWithDefault 'x' 1 (fromList [(5,'a'), (3,'b')]) == 'x'
-- > findWithDefault 'x' 5 (fromList [(5,'a'), (3,'b')]) == 'a'
{-@ findWithDefault :: (Or... | 625 | findWithDefault :: Ord k => a -> k -> Map k a -> a
findWithDefault = go
where
STRICT_2_OF_3(go)
go def _ Tip = def
go def k (Bin _ kx x l r) = case compare k kx of
LT -> go def k l
GT -> go def k r
EQ -> x
#if __GLASGOW_HASKELL__ >= 700
| 269 | findWithDefault = go
where
STRICT_2_OF_3(go)
go def _ Tip = def
go def k (Bin _ kx x l r) = case compare k kx of
LT -> go def k l
GT -> go def k r
EQ -> x
#if __GLASGOW_HASKELL__ >= 700
| 218 | true | true | 1 | 9 | 160 | 132 | 68 | 64 | null | null |
johnjcamilleri/maltese-functional-morphology | lib/Tokenize.hs | lgpl-3.0 | isPunctS (c:_) = isPunct c | 27 | isPunctS (c:_) = isPunct c | 27 | isPunctS (c:_) = isPunct c | 27 | false | false | 0 | 7 | 5 | 19 | 9 | 10 | null | null |
sebastiaanvisser/frp-js | src/Property/Geometry.hs | bsd-3-clause | inside :: Point -> Rect -> Val Boolean
inside a b =
px a >= left b
&& px a <= right b
&& py a >= top b
&& py a <= bottom b | 139 | inside :: Point -> Rect -> Val Boolean
inside a b =
px a >= left b
&& px a <= right b
&& py a >= top b
&& py a <= bottom b | 139 | inside a b =
px a >= left b
&& px a <= right b
&& py a >= top b
&& py a <= bottom b | 100 | false | true | 14 | 8 | 51 | 95 | 40 | 55 | null | null |
Heather/Idris-dev | src/Idris/IBC.hs | bsd-3-clause | processMetaInformation :: Archive -> Idris ()
processMetaInformation ar = do
ds <- getEntry [] "ibc_metainformation" ar
mapM_ (\ (n, m) -> updateIState (\i ->
i { tt_ctxt = setMetaInformation n m (tt_ctxt i) })) ds | 253 | processMetaInformation :: Archive -> Idris ()
processMetaInformation ar = do
ds <- getEntry [] "ibc_metainformation" ar
mapM_ (\ (n, m) -> updateIState (\i ->
i { tt_ctxt = setMetaInformation n m (tt_ctxt i) })) ds | 253 | processMetaInformation ar = do
ds <- getEntry [] "ibc_metainformation" ar
mapM_ (\ (n, m) -> updateIState (\i ->
i { tt_ctxt = setMetaInformation n m (tt_ctxt i) })) ds | 207 | false | true | 0 | 17 | 73 | 93 | 47 | 46 | null | null |
oopsno/hrank | src/HackerRank/Utilities/Manager/IOError.hs | unlicense | withDirExsit :: (FilePath -> IO a) -> (FilePath -> IO a) -> FilePath -> IO a
withDirExsit = withExsit doesDirectoryExist | 120 | withDirExsit :: (FilePath -> IO a) -> (FilePath -> IO a) -> FilePath -> IO a
withDirExsit = withExsit doesDirectoryExist | 120 | withDirExsit = withExsit doesDirectoryExist | 43 | false | true | 0 | 9 | 19 | 49 | 24 | 25 | null | null |
ak1211/tractor | app/Main.hs | agpl-3.0 | -- |
-- バッチ処理スケジュール
batchProcessSchedule :: Conf.Info -> Scd.AsiaTokyoDay -> Scd.ZonedTimeJobs
batchProcessSchedule conf day =
[(t, act) | t<-Scd.batchProcessTime day]
where
act = updateSomeRates conf
-- |
-- 平日の報告スケジュール | 233 | batchProcessSchedule :: Conf.Info -> Scd.AsiaTokyoDay -> Scd.ZonedTimeJobs
batchProcessSchedule conf day =
[(t, act) | t<-Scd.batchProcessTime day]
where
act = updateSomeRates conf
-- |
-- 平日の報告スケジュール | 213 | batchProcessSchedule conf day =
[(t, act) | t<-Scd.batchProcessTime day]
where
act = updateSomeRates conf
-- |
-- 平日の報告スケジュール | 138 | true | true | 0 | 9 | 41 | 67 | 36 | 31 | null | null |
tlaitinen/mailchimp | Web/Mailchimp.hs | bsd-3-clause | apiEndpointUrl :: Text -> Text -> Text -> Text
apiEndpointUrl datacenter section apiMethod =
Data.Text.concat ["https://", datacenter, ".api.mailchimp.com/2.0/", section, "/", apiMethod, ".json"] | 198 | apiEndpointUrl :: Text -> Text -> Text -> Text
apiEndpointUrl datacenter section apiMethod =
Data.Text.concat ["https://", datacenter, ".api.mailchimp.com/2.0/", section, "/", apiMethod, ".json"] | 198 | apiEndpointUrl datacenter section apiMethod =
Data.Text.concat ["https://", datacenter, ".api.mailchimp.com/2.0/", section, "/", apiMethod, ".json"] | 151 | false | true | 0 | 7 | 24 | 57 | 32 | 25 | null | null |
AmpersandTarski/ampersand | src/Ampersand/Input/ADL1/Lexer.hs | gpl-3.0 | getSeconds :: String -> (Float,Int,String)
getSeconds cs =
case cs of
(':':s1:s2:rest) ->
if all isDigit [s1,s2]
then let (fraction,lf,rf) = getFraction (s1:s2:rest)
in (fraction,1+lf,rf)
else (0,0,cs)
_ -> (0,0,cs) | 247 | getSeconds :: String -> (Float,Int,String)
getSeconds cs =
case cs of
(':':s1:s2:rest) ->
if all isDigit [s1,s2]
then let (fraction,lf,rf) = getFraction (s1:s2:rest)
in (fraction,1+lf,rf)
else (0,0,cs)
_ -> (0,0,cs) | 247 | getSeconds cs =
case cs of
(':':s1:s2:rest) ->
if all isDigit [s1,s2]
then let (fraction,lf,rf) = getFraction (s1:s2:rest)
in (fraction,1+lf,rf)
else (0,0,cs)
_ -> (0,0,cs) | 204 | false | true | 0 | 16 | 61 | 149 | 81 | 68 | null | null |
uwap/Idris-dev | src/Idris/Reflection.hs | bsd-3-clause | -- | Lift a term into its Language.Reflection.TT representation
reflect :: Term -> Raw
reflect = reflectTTQuote [] | 114 | reflect :: Term -> Raw
reflect = reflectTTQuote [] | 50 | reflect = reflectTTQuote [] | 27 | true | true | 0 | 6 | 17 | 21 | 11 | 10 | null | null |
timjb/diagrams-rubiks-cube | src/Diagrams/RubiksCube/Draw.hs | mit | drawMove D' = drawMoveD True | 28 | drawMove D' = drawMoveD True | 28 | drawMove D' = drawMoveD True | 28 | false | false | 0 | 5 | 4 | 12 | 5 | 7 | null | null |
creichert/persistent | persistent-postgresql/Database/Persist/Postgresql.hs | mit | -- | Generate a 'SqlBackend' from a 'PG.Connection', but takes a callback for
-- obtaining the server version.
--
-- @since 2.9.1
openSimpleConnWithVersion :: (PG.Connection -> IO (Maybe Double)) -> LogFunc -> PG.Connection -> IO SqlBackend
openSimpleConnWithVersion getVer logFunc conn = do
smap <- newIORef $ Map.e... | 526 | openSimpleConnWithVersion :: (PG.Connection -> IO (Maybe Double)) -> LogFunc -> PG.Connection -> IO SqlBackend
openSimpleConnWithVersion getVer logFunc conn = do
smap <- newIORef $ Map.empty
serverVersion <- getVer conn
return $ createBackend logFunc serverVersion smap conn
-- | Create the backend given a ... | 396 | openSimpleConnWithVersion getVer logFunc conn = do
smap <- newIORef $ Map.empty
serverVersion <- getVer conn
return $ createBackend logFunc serverVersion smap conn
-- | Create the backend given a logging function, server version, mutable statement cell,
-- and connection. | 285 | true | true | 0 | 10 | 87 | 98 | 49 | 49 | null | null |
parsonsmatt/cis194 | hw11/SExpr.hs | apache-2.0 | ------------------------------------------------------------
-- 1. Parsing repetitions
------------------------------------------------------------
zeroOrMore :: Parser a -> Parser [a]
zeroOrMore p = oneOrMore p <|> pure [] | 225 | zeroOrMore :: Parser a -> Parser [a]
zeroOrMore p = oneOrMore p <|> pure [] | 75 | zeroOrMore p = oneOrMore p <|> pure [] | 38 | true | true | 0 | 8 | 22 | 46 | 22 | 24 | null | null |
tamarin-prover/tamarin-prover | lib/theory/src/Theory/Constraint/Solver/ProofMethod.hs | gpl-3.0 | isDisjGoalButNotProgress :: Goal -> Bool
isDisjGoalButNotProgress g = isDisjGoal g && not (isProgressDisj g) | 108 | isDisjGoalButNotProgress :: Goal -> Bool
isDisjGoalButNotProgress g = isDisjGoal g && not (isProgressDisj g) | 108 | isDisjGoalButNotProgress g = isDisjGoal g && not (isProgressDisj g) | 67 | false | true | 0 | 8 | 13 | 34 | 16 | 18 | null | null |
LeventErkok/hArduino | System/Hardware/Arduino/Data.hs | bsd-3-clause | sysExCmdVal SYSEX_REALTIME = 0x7F | 42 | sysExCmdVal SYSEX_REALTIME = 0x7F | 42 | sysExCmdVal SYSEX_REALTIME = 0x7F | 42 | false | false | 0 | 5 | 12 | 9 | 4 | 5 | null | null |
FranklinChen/hugs98-plus-Sep2006 | packages/network/tests/URITest.hs | bsd-3-clause | testRelative64 = testRelJoin "testRelative64"
"ftp://example/x/y" "http://example/a/b/c/d/../../../../e" "http://example/e" | 143 | testRelative64 = testRelJoin "testRelative64"
"ftp://example/x/y" "http://example/a/b/c/d/../../../../e" "http://example/e" | 143 | testRelative64 = testRelJoin "testRelative64"
"ftp://example/x/y" "http://example/a/b/c/d/../../../../e" "http://example/e" | 143 | false | false | 1 | 5 | 26 | 21 | 7 | 14 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.